Skip to content

Commit afa6448

Browse files
authored
Merge branch 'main' into gisel-vop3p
2 parents daae1ae + 8338fbe commit afa6448

File tree

696 files changed

+18186
-10385
lines changed

Some content is hidden

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

696 files changed

+18186
-10385
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
cc: 'gcc-14'
5656
cxx: 'g++-14'
5757
steps:
58-
- uses: actions/checkout@v4
58+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5959
- name: ${{ matrix.config }}.${{ matrix.cxx }}
6060
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
6161
env:
@@ -105,7 +105,7 @@ jobs:
105105
cc: 'clang-18'
106106
cxx: 'clang++-18'
107107
steps:
108-
- uses: actions/checkout@v4
108+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
109109
- name: ${{ matrix.config }}
110110
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
111111
env:
@@ -169,7 +169,7 @@ jobs:
169169
runs-on: ${{ matrix.machine }}
170170
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
171171
steps:
172-
- uses: actions/checkout@v4
172+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
173173
- name: ${{ matrix.config }}
174174
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
175175
env:
@@ -207,11 +207,11 @@ jobs:
207207
os: macos-13
208208
runs-on: ${{ matrix.os }}
209209
steps:
210-
- uses: actions/checkout@v4
211-
- uses: maxim-lobanov/setup-xcode@v1
210+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
211+
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
212212
with:
213213
xcode-version: 'latest'
214-
- uses: seanmiddleditch/gha-setup-ninja@master
214+
- uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
215215
- name: Build and test
216216
run: |
217217
python3 -m venv .venv
@@ -247,7 +247,7 @@ jobs:
247247
- { config: mingw-dll-i686, mingw: true }
248248
- { config: mingw-incomplete-sysroot, mingw: true }
249249
steps:
250-
- uses: actions/checkout@v4
250+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
251251
- name: Install dependencies
252252
run: |
253253
choco install -y ninja
@@ -275,7 +275,7 @@ jobs:
275275
echo "c:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
276276
- name: Set up the MSVC dev environment
277277
if: ${{ matrix.mingw != true }}
278-
uses: ilammy/msvc-dev-cmd@v1
278+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
279279
- name: Build and test
280280
run: |
281281
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}

.github/workflows/libcxx-build-containers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
packages: write
3333

3434
steps:
35-
- uses: actions/checkout@v4
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3636

3737
- name: Build the Linux builder image
3838
working-directory: libcxx/utils/ci
@@ -47,7 +47,7 @@ jobs:
4747
# TAG: ${{ github.sha }}
4848

4949
- name: Log in to GitHub Container Registry
50-
uses: docker/login-action@v3
50+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
5151
with:
5252
registry: ghcr.io
5353
username: ${{ github.actor }}

.github/workflows/libcxx-check-generated-files.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-24.04
1313
steps:
1414
- name: Fetch LLVM sources
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1616

1717
- name: Install dependencies
18-
uses: aminya/setup-cpp@v1
18+
uses: aminya/setup-cpp@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
1919
with:
2020
clangformat: 17.0.1
2121
ninja: true

.github/workflows/release-asset-audit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _get_uploaders(release_version):
2424
return set(
2525
[
2626
"DimitryAndric",
27-
"stefanp-ibm",
27+
"stefanp-synopsys",
2828
"lei137",
2929
"omjavaid",
3030
"nicolerabjohn",

clang/docs/ReleaseNotes.rst

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ related warnings within the method body.
161161
``__attribute__((model("large")))`` on non-TLS globals in x86-64 compilations.
162162
This forces the global to be considered small or large in regards to the
163163
x86-64 code model, regardless of the code model specified for the compilation.
164-
- Clang now emits a warning ``-Wreserved-init-priority`` instead of a hard error
165-
when ``__attribute__((init_priority(n)))`` is used with values of n in the
164+
- Clang now emits a warning ``-Wreserved-init-priority`` instead of a hard error
165+
when ``__attribute__((init_priority(n)))`` is used with values of n in the
166166
reserved range [0, 100]. The warning will be treated as an error by default.
167167

168168
- There is a new ``format_matches`` attribute to complement the existing
@@ -234,12 +234,16 @@ Improvements to Clang's diagnostics
234234
- Diagnostics on chained comparisons (``a < b < c``) are now an error by default. This can be disabled with
235235
``-Wno-error=parentheses``.
236236
- The ``-Wshift-bool`` warning has been added to warn about shifting a boolean. (#GH28334)
237-
237+
- Fixed diagnostics adding a trailing ``::`` when printing some source code
238+
constructs, like base classes.
238239
- The :doc:`ThreadSafetyAnalysis` now supports ``-Wthread-safety-pointer``,
239240
which enables warning on passing or returning pointers to guarded variables
240241
as function arguments or return value respectively. Note that
241242
:doc:`ThreadSafetyAnalysis` still does not perform alias analysis. The
242243
feature will be default-enabled with ``-Wthread-safety`` in a future release.
244+
- The ``-Wsign-compare`` warning now treats expressions with bitwise not(~) and minus(-) as signed integers
245+
except for the case where the operand is an unsigned integer
246+
and throws warning if they are compared with unsigned integers (##18878).
243247

244248
- Improve the diagnostics for chained comparisons to report actual expressions and operators (#GH129069).
245249

@@ -294,18 +298,13 @@ Bug Fixes to C++ Support
294298
direct-list-initialized from an array is corrected to direct-initialization.
295299
- Clang no longer crashes when a coroutine is declared ``[[noreturn]]``. (#GH127327)
296300
- Clang now uses the parameter location for abbreviated function templates in ``extern "C"``. (#GH46386)
301+
- Clang will emit an error instead of crash when use co_await or co_yield in
302+
C++26 braced-init-list template parameter initialization. (#GH78426)
303+
- Fixes matching of nested template template parameters. (#GH130362)
304+
- Correctly diagnoses template template paramters which have a pack parameter
305+
not in the last position.
297306
- Clang now correctly parses ``if constexpr`` expressions in immediate function context. (#GH123524)
298307

299-
Improvements to C++ diagnostics
300-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
301-
302-
- Clang now more consistently adds a note pointing to the relevant template
303-
parameter. Some diagnostics are reworded to better take advantage of this.
304-
- Template Template Parameter diagnostics now stop referring to template
305-
parameters as template arguments, in some circumstances, better hiding
306-
from the users template template parameter partial ordering arcana.
307-
308-
309308
Bug Fixes to AST Handling
310309
^^^^^^^^^^^^^^^^^^^^^^^^^
311310
- Fixed type checking when a statement expression ends in an l-value of atomic type. (#GH106576)

clang/docs/UsersManual.rst

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4681,25 +4681,7 @@ Clang supports generation of SPIR-V conformant to `the OpenCL Environment
46814681
Specification
46824682
<https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_Env.html>`_.
46834683

4684-
To generate SPIR-V binaries, Clang uses the external ``llvm-spirv`` tool from the
4685-
`SPIRV-LLVM-Translator repo
4686-
<https://github.com/KhronosGroup/SPIRV-LLVM-Translator>`_.
4687-
4688-
Prior to the generation of SPIR-V binary with Clang, ``llvm-spirv``
4689-
should be built or installed. Please refer to `the following instructions
4690-
<https://github.com/KhronosGroup/SPIRV-LLVM-Translator#build-instructions>`_
4691-
for more details. Clang will look for ``llvm-spirv-<LLVM-major-version>`` and
4692-
``llvm-spirv`` executables, in this order, in the ``PATH`` environment variable.
4693-
Clang uses ``llvm-spirv`` with `the widely adopted assembly syntax package
4694-
<https://github.com/KhronosGroup/SPIRV-LLVM-Translator/#build-with-spirv-tools>`_.
4695-
4696-
`The versioning
4697-
<https://github.com/KhronosGroup/SPIRV-LLVM-Translator/releases>`_ of
4698-
``llvm-spirv`` is aligned with Clang major releases. The same applies to the
4699-
main development branch. It is therefore important to ensure the ``llvm-spirv``
4700-
version is in alignment with the Clang version. For troubleshooting purposes
4701-
``llvm-spirv`` can be `tested in isolation
4702-
<https://github.com/KhronosGroup/SPIRV-LLVM-Translator#test-instructions>`_.
4684+
To generate SPIR-V binaries, Clang uses the in-tree LLVM SPIR-V backend.
47034685

47044686
Example usage for OpenCL kernel compilation:
47054687

@@ -4717,18 +4699,6 @@ Converting to SPIR-V produced with the optimization levels other than `-O0` is
47174699
currently available as an experimental feature and it is not guaranteed to work
47184700
in all cases.
47194701

4720-
Clang also supports integrated generation of SPIR-V without use of ``llvm-spirv``
4721-
tool as an experimental feature when ``-fintegrated-objemitter`` flag is passed in
4722-
the command line.
4723-
4724-
.. code-block:: console
4725-
4726-
$ clang --target=spirv32 -fintegrated-objemitter -c test.cl
4727-
4728-
Note that only very basic functionality is supported at this point and therefore
4729-
it is not suitable for arbitrary use cases. This feature is only enabled when clang
4730-
build is configured with ``-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV`` option.
4731-
47324702
Linking is done using ``spirv-link`` from `the SPIRV-Tools project
47334703
<https://github.com/KhronosGroup/SPIRV-Tools#linker>`_. Similar to other external
47344704
linkers, Clang will expect ``spirv-link`` to be installed separately and to be

clang/docs/analyzer/checkers.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3522,6 +3522,19 @@ Raw pointers and references to an object which supports CheckedPtr or CheckedRef
35223522
35233523
See `WebKit Guidelines for Safer C++ Programming <https://github.com/WebKit/WebKit/wiki/Safer-CPP-Guidelines>`_ for details.
35243524
3525+
alpha.webkit.NoUnretainedMemberChecker
3526+
""""""""""""""""""""""""""""""""""""""""
3527+
Raw pointers and references to a NS or CF object can't be used as class members or ivars. Only RetainPtr is allowed for CF types regardless of whether ARC is enabled or disabled. Only RetainPtr is allowed for NS types when ARC is disabled.
3528+
3529+
.. code-block:: cpp
3530+
3531+
struct Foo {
3532+
NSObject *ptr; // warn
3533+
// ...
3534+
};
3535+
3536+
See `WebKit Guidelines for Safer C++ Programming <https://github.com/WebKit/WebKit/wiki/Safer-CPP-Guidelines>`_ for details.
3537+
35253538
alpha.webkit.UnretainedLambdaCapturesChecker
35263539
""""""""""""""""""""""""""""""""""""""""""""
35273540
Raw pointers and references to NS or CF types can't be captured in lambdas. Only RetainPtr is allowed for CF types regardless of whether ARC is enabled or disabled, and only RetainPtr is allowed for NS types when ARC is disabled.

clang/include/clang/AST/Mangle.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class MangleContext {
140140
virtual void mangleCXXRTTIName(QualType T, raw_ostream &,
141141
bool NormalizeIntegers = false) = 0;
142142
virtual void mangleStringLiteral(const StringLiteral *SL, raw_ostream &) = 0;
143-
virtual void mangleMSGuidDecl(const MSGuidDecl *GD, raw_ostream &);
143+
virtual void mangleMSGuidDecl(const MSGuidDecl *GD, raw_ostream &) const;
144144

145145
void mangleGlobalBlock(const BlockDecl *BD, const NamedDecl *ID,
146146
raw_ostream &Out);
@@ -153,9 +153,9 @@ class MangleContext {
153153

154154
void mangleObjCMethodName(const ObjCMethodDecl *MD, raw_ostream &OS,
155155
bool includePrefixByte = true,
156-
bool includeCategoryNamespace = true);
156+
bool includeCategoryNamespace = true) const;
157157
void mangleObjCMethodNameAsSourceName(const ObjCMethodDecl *MD,
158-
raw_ostream &);
158+
raw_ostream &) const;
159159

160160
virtual void mangleStaticGuardVariable(const VarDecl *D, raw_ostream &) = 0;
161161

clang/include/clang/AST/NestedNameSpecifier.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ class NestedNameSpecifier : public llvm::FoldingSetNode {
223223
/// `ns::SomeTemplate<int, MyClass>` instead of
224224
/// `ns::SomeTemplate<Container::value_type, T>`.
225225
void print(raw_ostream &OS, const PrintingPolicy &Policy,
226-
bool ResolveTemplateArguments = false) const;
226+
bool ResolveTemplateArguments = false,
227+
bool PrintFinalScopeResOp = true) const;
227228

228229
void Profile(llvm::FoldingSetNodeID &ID) const {
229230
ID.AddPointer(Prefix.getOpaqueValue());

clang/include/clang/AST/OpenACCClause.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "clang/Basic/OpenACCKinds.h"
1919

2020
#include <utility>
21+
#include <variant>
2122

2223
namespace clang {
2324
/// This is the base type for all OpenACC Clauses.
@@ -206,6 +207,50 @@ class OpenACCClauseWithParams : public OpenACCClause {
206207
}
207208
};
208209

210+
class OpenACCBindClause final : public OpenACCClauseWithParams {
211+
std::variant<const StringLiteral *, const IdentifierInfo *> Argument;
212+
213+
OpenACCBindClause(SourceLocation BeginLoc, SourceLocation LParenLoc,
214+
const clang::StringLiteral *SL, SourceLocation EndLoc)
215+
: OpenACCClauseWithParams(OpenACCClauseKind::Bind, BeginLoc, LParenLoc,
216+
EndLoc),
217+
Argument(SL) {}
218+
OpenACCBindClause(SourceLocation BeginLoc, SourceLocation LParenLoc,
219+
const IdentifierInfo *ID, SourceLocation EndLoc)
220+
: OpenACCClauseWithParams(OpenACCClauseKind::Bind, BeginLoc, LParenLoc,
221+
EndLoc),
222+
Argument(ID) {}
223+
224+
public:
225+
static bool classof(const OpenACCClause *C) {
226+
return C->getClauseKind() == OpenACCClauseKind::Bind;
227+
}
228+
static OpenACCBindClause *Create(const ASTContext &C, SourceLocation BeginLoc,
229+
SourceLocation LParenLoc,
230+
const IdentifierInfo *ID,
231+
SourceLocation EndLoc);
232+
static OpenACCBindClause *Create(const ASTContext &C, SourceLocation BeginLoc,
233+
SourceLocation LParenLoc,
234+
const StringLiteral *SL,
235+
SourceLocation EndLoc);
236+
237+
bool isStringArgument() const {
238+
return std::holds_alternative<const StringLiteral *>(Argument);
239+
}
240+
241+
const StringLiteral *getStringArgument() const {
242+
return std::get<const StringLiteral *>(Argument);
243+
}
244+
245+
bool isIdentifierArgument() const {
246+
return std::holds_alternative<const IdentifierInfo *>(Argument);
247+
}
248+
249+
const IdentifierInfo *getIdentifierArgument() const {
250+
return std::get<const IdentifierInfo *>(Argument);
251+
}
252+
};
253+
209254
using DeviceTypeArgument = std::pair<IdentifierInfo *, SourceLocation>;
210255
/// A 'device_type' or 'dtype' clause, takes a list of either an 'asterisk' or
211256
/// an identifier. The 'asterisk' means 'the rest'.

0 commit comments

Comments
 (0)