Skip to content

Commit edb85c3

Browse files
authored
Merge pull request #167 from nikic/rust-18-rc3
Update to LLVM 18.1.0 rc 3
2 parents 9ea7f73 + 3e722cc commit edb85c3

File tree

165 files changed

+6067
-722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+6067
-722
lines changed

.github/workflows/llvm-project-tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ jobs:
5858
lit-tests:
5959
name: Lit Tests
6060
runs-on: ${{ matrix.os }}
61+
container:
62+
image: ${{(startsWith(matrix.os, 'ubuntu') && 'ghcr.io/llvm/ci-ubuntu-22.04:latest') || null}}
63+
volumes:
64+
- /mnt/:/mnt/
6165
strategy:
6266
fail-fast: false
6367
matrix:
@@ -77,6 +81,7 @@ jobs:
7781
with:
7882
python-version: ${{ inputs.python_version }}
7983
- name: Install Ninja
84+
if: runner.os != 'Linux'
8085
uses: llvm/actions/install-ninja@main
8186
# actions/checkout deletes any existing files in the new git directory,
8287
# so this needs to either run before ccache-action or it has to use
@@ -108,8 +113,8 @@ jobs:
108113
run: |
109114
if [ "${{ runner.os }}" == "Linux" ]; then
110115
builddir="/mnt/build/"
111-
sudo mkdir -p $builddir
112-
sudo chown `whoami`:`whoami` $builddir
116+
mkdir -p $builddir
117+
extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
113118
else
114119
builddir="$(pwd)"/build
115120
fi
@@ -123,6 +128,7 @@ jobs:
123128
-DLLDB_INCLUDE_TESTS=OFF \
124129
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
125130
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
131+
$extra_cmake_args \
126132
${{ inputs.extra_cmake_args }}
127133
ninja -C "$builddir" '${{ inputs.build_target }}'
128134

.github/workflows/release-tasks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
name: Create a New Release
2929
runs-on: ubuntu-latest
3030
needs: validate-tag
31+
3132
steps:
3233
- name: Install Dependencies
3334
run: |
@@ -40,8 +41,9 @@ jobs:
4041
- name: Create Release
4142
env:
4243
GITHUB_TOKEN: ${{ github.token }}
44+
USER_TOKEN: ${{ secrets.RELEASE_TASKS_USER_TOKEN }}
4345
run: |
44-
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} --user ${{ github.actor }} create
46+
./llvm/utils/release/./github-upload-release.py --token "$GITHUB_TOKEN" --release ${{ needs.validate-tag.outputs.release-version }} --user ${{ github.actor }} --user-token "$USER_TOKEN" create
4547
release-documentation:
4648
name: Build and Upload Release Documentation
4749
needs:

clang/docs/ReleaseNotes.rst

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,22 @@ AST Dumping Potentially Breaking Changes
171171
"qualType": "foo"
172172
}
173173
174+
Clang Frontend Potentially Breaking Changes
175+
-------------------------------------------
176+
- Target OS macros extension
177+
A new Clang extension (see :ref:`here <target_os_detail>`) is enabled for
178+
Darwin (Apple platform) targets. Clang now defines ``TARGET_OS_*`` macros for
179+
these targets, which could break existing code bases with improper checks for
180+
the ``TARGET_OS_`` macros. For example, existing checks might fail to include
181+
the ``TargetConditionals.h`` header from Apple SDKs and therefore leaving the
182+
macros undefined and guarded code unexercised.
183+
184+
Affected code should be checked to see if it's still intended for the specific
185+
target and fixed accordingly.
186+
187+
The extension can be turned off by the option ``-fno-define-target-os-macros``
188+
as a workaround.
189+
174190
What's New in Clang |release|?
175191
==============================
176192
Some of the major new features and improvements to Clang are listed
@@ -304,6 +320,10 @@ Non-comprehensive list of changes in this release
304320

305321
* The version of Unicode used by Clang (primarily to parse identifiers) has been updated to 15.1.
306322

323+
* Clang now defines macro ``__LLVM_INSTR_PROFILE_GENERATE`` when compiling with
324+
PGO instrumentation profile generation, and ``__LLVM_INSTR_PROFILE_USE`` when
325+
compiling with PGO profile use.
326+
307327
New Compiler Flags
308328
------------------
309329

@@ -344,6 +364,17 @@ New Compiler Flags
344364
attribute the replaceable global new and delete operators behave normally
345365
(like other functions) with respect to visibility attributes, pragmas and
346366
options (e.g ``--fvisibility=``).
367+
* Full register names can be used when printing assembly via ``-mregnames``.
368+
This option now matches the one used by GCC.
369+
370+
.. _target_os_detail:
371+
372+
* ``-fdefine-target-os-macros`` and its complement
373+
``-fno-define-target-os-macros``. Enables or disables the Clang extension to
374+
provide built-in definitions of a list of ``TARGET_OS_*`` macros based on the
375+
target triple.
376+
377+
The extension is enabled by default for Darwin (Apple platform) targets.
347378

348379
Deprecated Compiler Flags
349380
-------------------------
@@ -363,6 +394,7 @@ Modified Compiler Flags
363394
* ``-fvisibility-global-new-delete-hidden`` is now a deprecated spelling of
364395
``-fvisibility-global-new-delete=force-hidden`` (``-fvisibility-global-new-delete=``
365396
is new in this release).
397+
* ``-fprofile-update`` is enabled for ``-fprofile-generate``.
366398

367399
Removed Compiler Flags
368400
-------------------------
@@ -860,6 +892,9 @@ Bug Fixes in This Version
860892
Fixes (`#78290 <https://github.com/llvm/llvm-project/issues/78290>`_)
861893
- Fixed assertion failure with deleted overloaded unary operators.
862894
Fixes (`#78314 <https://github.com/llvm/llvm-project/issues/78314>`_)
895+
- The XCOFF object file format does not support aliases to symbols having common
896+
linkage. Clang now diagnoses the use of an alias for a common symbol when
897+
compiling for AIX.
863898

864899
- Clang now doesn't produce false-positive warning `-Wconstant-logical-operand`
865900
for logical operators in C23.
@@ -1261,6 +1296,16 @@ CUDA Support
12611296
- Clang now supports CUDA SDK up to 12.3
12621297
- Added support for sm_90a
12631298

1299+
PowerPC Support
1300+
^^^^^^^^^^^^^^^
1301+
1302+
- Added ``nmmintrin.h`` to intrinsics headers.
1303+
- Added ``__builtin_ppc_fence`` as barrier of code motion, and
1304+
``__builtin_ppc_mffsl`` for corresponding instruction.
1305+
- Supported ``__attribute__((target("tune=cpu")))``.
1306+
- Emit ``float-abi`` module flag on 64-bit ELFv2 PowerPC targets if
1307+
``long double`` type is used in current module.
1308+
12641309
AIX Support
12651310
^^^^^^^^^^^
12661311

@@ -1269,6 +1314,10 @@ AIX Support
12691314
base is encoded as an immediate operand.
12701315
This access sequence is not used for TLS variables larger than 32KB, and is
12711316
currently only supported on 64-bit mode.
1317+
- Inline assembler supports VSR register in pure digits.
1318+
- Enabled ThinLTO support. Requires AIX 7.2 TL5 SP7 or newer, or AIX 7.3 TL2
1319+
or newer. Similar to the LTO support on AIX, ThinLTO is implemented with
1320+
the libLTO.so plugin.
12721321

12731322
WebAssembly Support
12741323
^^^^^^^^^^^^^^^^^^^
@@ -1332,6 +1381,8 @@ libclang
13321381
- Exposed arguments of ``clang::annotate``.
13331382
- ``clang::getCursorKindForDecl`` now recognizes linkage specifications such as
13341383
``extern "C"`` and reports them as ``CXCursor_LinkageSpec``.
1384+
- Changed the libclang library on AIX to export only the necessary symbols to
1385+
prevent issues of resolving to the wrong duplicate symbol.
13351386

13361387
Static Analyzer
13371388
---------------
@@ -1343,9 +1394,6 @@ New features
13431394
of static analysis tools, such as the Clang Static Analyzer.
13441395
`Documentation <https://clang.llvm.org/docs/AttributeReference.html#suppress>`__.
13451396

1346-
- Added support for the ``cleanup`` attribute.
1347-
`Documentation <https://clang.llvm.org/docs/AttributeReference.html#cleanup>`__.
1348-
13491397
- Support "Deducing this" (P0847R7). (Worked out of the box)
13501398
(`af4751738db8 <https://github.com/llvm/llvm-project/commit/af4751738db89a142a8880c782d12d4201b222a8>`__)
13511399

clang/include/clang/Driver/Options.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5815,6 +5815,18 @@ def mvis3 : Flag<["-"], "mvis3">, Group<m_sparc_Features_Group>;
58155815
def mno_vis3 : Flag<["-"], "mno-vis3">, Group<m_sparc_Features_Group>;
58165816
def mhard_quad_float : Flag<["-"], "mhard-quad-float">, Group<m_sparc_Features_Group>;
58175817
def msoft_quad_float : Flag<["-"], "msoft-quad-float">, Group<m_sparc_Features_Group>;
5818+
foreach i = 1 ... 7 in
5819+
def ffixed_g#i : Flag<["-"], "ffixed-g"#i>, Group<m_sparc_Features_Group>,
5820+
HelpText<"Reserve the G"#i#" register (SPARC only)">;
5821+
foreach i = 0 ... 5 in
5822+
def ffixed_o#i : Flag<["-"], "ffixed-o"#i>, Group<m_sparc_Features_Group>,
5823+
HelpText<"Reserve the O"#i#" register (SPARC only)">;
5824+
foreach i = 0 ... 7 in
5825+
def ffixed_l#i : Flag<["-"], "ffixed-l"#i>, Group<m_sparc_Features_Group>,
5826+
HelpText<"Reserve the L"#i#" register (SPARC only)">;
5827+
foreach i = 0 ... 5 in
5828+
def ffixed_i#i : Flag<["-"], "ffixed-i"#i>, Group<m_sparc_Features_Group>,
5829+
HelpText<"Reserve the I"#i#" register (SPARC only)">;
58185830
} // let Flags = [TargetSpecific]
58195831

58205832
// M68k features flags

clang/lib/Basic/Targets/AArch64.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,8 @@ TargetInfo::BuiltinVaListKind AArch64TargetInfo::getBuiltinVaListKind() const {
11871187
}
11881188

11891189
const char *const AArch64TargetInfo::GCCRegNames[] = {
1190+
// clang-format off
1191+
11901192
// 32-bit Integer registers
11911193
"w0", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8", "w9", "w10", "w11",
11921194
"w12", "w13", "w14", "w15", "w16", "w17", "w18", "w19", "w20", "w21", "w22",
@@ -1223,7 +1225,12 @@ const char *const AArch64TargetInfo::GCCRegNames[] = {
12231225

12241226
// SVE predicate-as-counter registers
12251227
"pn0", "pn1", "pn2", "pn3", "pn4", "pn5", "pn6", "pn7", "pn8",
1226-
"pn9", "pn10", "pn11", "pn12", "pn13", "pn14", "pn15"
1228+
"pn9", "pn10", "pn11", "pn12", "pn13", "pn14", "pn15",
1229+
1230+
// SME registers
1231+
"za", "zt0",
1232+
1233+
// clang-format on
12271234
};
12281235

12291236
ArrayRef<const char *> AArch64TargetInfo::getGCCRegNames() const {

clang/lib/Driver/ToolChains/Arch/Sparc.cpp

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,85 @@ void sparc::getSparcTargetFeatures(const Driver &D, const ArgList &Args,
178178
else
179179
Features.push_back("-hard-quad-float");
180180
}
181+
182+
if (Args.hasArg(options::OPT_ffixed_g1))
183+
Features.push_back("+reserve-g1");
184+
185+
if (Args.hasArg(options::OPT_ffixed_g2))
186+
Features.push_back("+reserve-g2");
187+
188+
if (Args.hasArg(options::OPT_ffixed_g3))
189+
Features.push_back("+reserve-g3");
190+
191+
if (Args.hasArg(options::OPT_ffixed_g4))
192+
Features.push_back("+reserve-g4");
193+
194+
if (Args.hasArg(options::OPT_ffixed_g5))
195+
Features.push_back("+reserve-g5");
196+
197+
if (Args.hasArg(options::OPT_ffixed_g6))
198+
Features.push_back("+reserve-g6");
199+
200+
if (Args.hasArg(options::OPT_ffixed_g7))
201+
Features.push_back("+reserve-g7");
202+
203+
if (Args.hasArg(options::OPT_ffixed_o0))
204+
Features.push_back("+reserve-o0");
205+
206+
if (Args.hasArg(options::OPT_ffixed_o1))
207+
Features.push_back("+reserve-o1");
208+
209+
if (Args.hasArg(options::OPT_ffixed_o2))
210+
Features.push_back("+reserve-o2");
211+
212+
if (Args.hasArg(options::OPT_ffixed_o3))
213+
Features.push_back("+reserve-o3");
214+
215+
if (Args.hasArg(options::OPT_ffixed_o4))
216+
Features.push_back("+reserve-o4");
217+
218+
if (Args.hasArg(options::OPT_ffixed_o5))
219+
Features.push_back("+reserve-o5");
220+
221+
if (Args.hasArg(options::OPT_ffixed_l0))
222+
Features.push_back("+reserve-l0");
223+
224+
if (Args.hasArg(options::OPT_ffixed_l1))
225+
Features.push_back("+reserve-l1");
226+
227+
if (Args.hasArg(options::OPT_ffixed_l2))
228+
Features.push_back("+reserve-l2");
229+
230+
if (Args.hasArg(options::OPT_ffixed_l3))
231+
Features.push_back("+reserve-l3");
232+
233+
if (Args.hasArg(options::OPT_ffixed_l4))
234+
Features.push_back("+reserve-l4");
235+
236+
if (Args.hasArg(options::OPT_ffixed_l5))
237+
Features.push_back("+reserve-l5");
238+
239+
if (Args.hasArg(options::OPT_ffixed_l6))
240+
Features.push_back("+reserve-l6");
241+
242+
if (Args.hasArg(options::OPT_ffixed_l7))
243+
Features.push_back("+reserve-l7");
244+
245+
if (Args.hasArg(options::OPT_ffixed_i0))
246+
Features.push_back("+reserve-i0");
247+
248+
if (Args.hasArg(options::OPT_ffixed_i1))
249+
Features.push_back("+reserve-i1");
250+
251+
if (Args.hasArg(options::OPT_ffixed_i2))
252+
Features.push_back("+reserve-i2");
253+
254+
if (Args.hasArg(options::OPT_ffixed_i3))
255+
Features.push_back("+reserve-i3");
256+
257+
if (Args.hasArg(options::OPT_ffixed_i4))
258+
Features.push_back("+reserve-i4");
259+
260+
if (Args.hasArg(options::OPT_ffixed_i5))
261+
Features.push_back("+reserve-i5");
181262
}

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2515,7 +2515,7 @@ bool UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType) {
25152515
parseChildBlock();
25162516
break;
25172517
case tok::r_paren:
2518-
if (!MightBeStmtExpr &&
2518+
if (!MightBeStmtExpr && !Line->InMacroBody &&
25192519
Style.RemoveParentheses > FormatStyle::RPS_Leave) {
25202520
const auto *Prev = LeftParen->Previous;
25212521
const auto *Next = Tokens->peekNextToken();

clang/lib/Serialization/ASTReaderDecl.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,11 +800,12 @@ void ASTDeclReader::VisitEnumDecl(EnumDecl *ED) {
800800
BitsUnpacker EnumDeclBits(Record.readInt());
801801
ED->setNumPositiveBits(EnumDeclBits.getNextBits(/*Width=*/8));
802802
ED->setNumNegativeBits(EnumDeclBits.getNextBits(/*Width=*/8));
803+
bool ShouldSkipCheckingODR = EnumDeclBits.getNextBit();
803804
ED->setScoped(EnumDeclBits.getNextBit());
804805
ED->setScopedUsingClassTag(EnumDeclBits.getNextBit());
805806
ED->setFixed(EnumDeclBits.getNextBit());
806807

807-
if (!shouldSkipCheckingODR(ED)) {
808+
if (!ShouldSkipCheckingODR) {
808809
ED->setHasODRHash(true);
809810
ED->ODRHash = Record.readInt();
810811
}
@@ -1073,6 +1074,7 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) {
10731074

10741075
FD->setCachedLinkage((Linkage)FunctionDeclBits.getNextBits(/*Width=*/3));
10751076
FD->setStorageClass((StorageClass)FunctionDeclBits.getNextBits(/*Width=*/3));
1077+
bool ShouldSkipCheckingODR = FunctionDeclBits.getNextBit();
10761078
FD->setInlineSpecified(FunctionDeclBits.getNextBit());
10771079
FD->setImplicitlyInline(FunctionDeclBits.getNextBit());
10781080
FD->setHasSkippedBody(FunctionDeclBits.getNextBit());
@@ -1102,7 +1104,7 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) {
11021104
if (FD->isExplicitlyDefaulted())
11031105
FD->setDefaultLoc(readSourceLocation());
11041106

1105-
if (!shouldSkipCheckingODR(FD)) {
1107+
if (!ShouldSkipCheckingODR) {
11061108
FD->ODRHash = Record.readInt();
11071109
FD->setHasODRHash(true);
11081110
}
@@ -1973,6 +1975,8 @@ void ASTDeclReader::ReadCXXDefinitionData(
19731975

19741976
BitsUnpacker CXXRecordDeclBits = Record.readInt();
19751977

1978+
bool ShouldSkipCheckingODR = CXXRecordDeclBits.getNextBit();
1979+
19761980
#define FIELD(Name, Width, Merge) \
19771981
if (!CXXRecordDeclBits.canGetNextNBits(Width)) \
19781982
CXXRecordDeclBits.updateValue(Record.readInt()); \
@@ -1982,7 +1986,7 @@ void ASTDeclReader::ReadCXXDefinitionData(
19821986
#undef FIELD
19831987

19841988
// We only perform ODR checks for decls not in GMF.
1985-
if (!shouldSkipCheckingODR(D)) {
1989+
if (!ShouldSkipCheckingODR) {
19861990
// Note: the caller has deserialized the IsLambda bit already.
19871991
Data.ODRHash = Record.readInt();
19881992
Data.HasODRHash = true;

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6010,6 +6010,9 @@ void ASTRecordWriter::AddCXXDefinitionData(const CXXRecordDecl *D) {
60106010

60116011
BitsPacker DefinitionBits;
60126012

6013+
bool ShouldSkipCheckingODR = shouldSkipCheckingODR(D);
6014+
DefinitionBits.addBit(ShouldSkipCheckingODR);
6015+
60136016
#define FIELD(Name, Width, Merge) \
60146017
if (!DefinitionBits.canWriteNextNBits(Width)) { \
60156018
Record->push_back(DefinitionBits); \
@@ -6023,11 +6026,10 @@ void ASTRecordWriter::AddCXXDefinitionData(const CXXRecordDecl *D) {
60236026
Record->push_back(DefinitionBits);
60246027

60256028
// We only perform ODR checks for decls not in GMF.
6026-
if (!shouldSkipCheckingODR(D)) {
6029+
if (!ShouldSkipCheckingODR)
60276030
// getODRHash will compute the ODRHash if it has not been previously
60286031
// computed.
60296032
Record->push_back(D->getODRHash());
6030-
}
60316033

60326034
bool ModulesDebugInfo =
60336035
Writer->Context->getLangOpts().ModulesDebugInfo && !D->isDependentType();

0 commit comments

Comments
 (0)