Skip to content

Commit 1583f80

Browse files
author
iclsrc
committed
Merge from 'main' to 'sycl-web'
2 parents 6a02e42 + 8a5a1b7 commit 1583f80

File tree

698 files changed

+33513
-19428
lines changed

Some content is hidden

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

698 files changed

+33513
-19428
lines changed

.github/workflows/email-check.yaml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "Check for private emails used in PRs"
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types:
66
- opened
77

@@ -10,8 +10,6 @@ permissions:
1010

1111
jobs:
1212
validate_email:
13-
permissions:
14-
pull-requests: write
1513
runs-on: ubuntu-latest
1614
if: github.repository == 'llvm/llvm-project'
1715
steps:
@@ -25,20 +23,24 @@ jobs:
2523
run: |
2624
git log -1
2725
echo "EMAIL=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
26+
# Create empty comment file
27+
echo "[]" > comments
2828
2929
- name: Validate author email
3030
if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }}
31-
uses: actions/github-script@v6
3231
env:
33-
EMAIL: ${{ steps.author.outputs.EMAIL }}
32+
COMMENT: >-
33+
⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>
34+
Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.<br/>
35+
See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
36+
run: |
37+
cat << EOF > comments
38+
[{"body" : "$COMMENT"}]
39+
EOF
40+
41+
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
42+
if: always()
3443
with:
35-
script: |
36-
const { EMAIL } = process.env
37-
await github.rest.issues.createComment({
38-
issue_number: context.issue.number,
39-
owner: context.repo.owner,
40-
repo: context.repo.repo,
41-
body: `⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
42-
Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.
43-
See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
44-
`})
44+
name: workflow-args
45+
path: |
46+
comments

.github/workflows/issue-write.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Comment on an issue
22

33
on:
44
workflow_run:
5-
workflows: ["Check code formatting"]
5+
workflows:
6+
- "Check code formatting"
7+
- "Check for private emails used in PRs"
68
types:
79
- completed
810

@@ -31,7 +33,7 @@ jobs:
3133
script: |
3234
var fs = require('fs');
3335
const comments = JSON.parse(fs.readFileSync('./comments'));
34-
if (!comments) {
36+
if (!comments || comments.length == 0) {
3537
return;
3638
}
3739
@@ -77,6 +79,15 @@ jobs:
7779
}
7880
const gql_result = await github.graphql(gql_query, gql_variables);
7981
console.log(gql_result);
82+
// If the branch for the PR was deleted before this job has a chance
83+
// to run, then the ref will be null. This can happen if someone:
84+
// 1. Rebase the PR, which triggers some workflow.
85+
// 2. Immediately merges the PR and deletes the branch.
86+
// 3. The workflow finishes and triggers this job.
87+
if (!gql_result.repository.ref) {
88+
console.log("Ref has been deleted");
89+
return;
90+
}
8091
console.log(gql_result.repository.ref.associatedPullRequests.nodes);
8192
8293
var pr_number = 0;

.github/workflows/pr-code-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Fetch code formatting utils
3737
uses: actions/checkout@v4
3838
with:
39-
reository: ${{ github.repository }}
39+
repository: ${{ github.repository }}
4040
ref: ${{ github.base_ref }}
4141
sparse-checkout: |
4242
llvm/utils/git/requirements_formatting.txt

bolt/include/bolt/Core/BinaryFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ class BinaryFunction {
11681168
/// Pass an offset of the entry point in the input binary and a corresponding
11691169
/// global symbol to the callback function.
11701170
///
1171-
/// Return true of all callbacks returned true, false otherwise.
1171+
/// Return true if all callbacks returned true, false otherwise.
11721172
bool forEachEntryPoint(EntryPointCallbackTy Callback) const;
11731173

11741174
/// Return MC symbol associated with the end of the function.

clang-tools-extra/test/clang-tidy/infrastructure/diagnostic.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// RUN: not clang-tidy -checks='-*,modernize-use-override' %T/diagnostics/input.cpp -- -DCOMPILATION_ERROR 2>&1 | FileCheck -check-prefix=CHECK6 -implicit-check-not='{{warning:|error:}}' %s
2626
// RUN: clang-tidy -checks='-*,modernize-use-override,clang-diagnostic-macro-redefined' %s -- -DMACRO_FROM_COMMAND_LINE -std=c++20 | FileCheck -check-prefix=CHECK4 -implicit-check-not='{{warning:|error:}}' %s
2727
// RUN: clang-tidy -checks='-*,modernize-use-override,clang-diagnostic-macro-redefined,clang-diagnostic-literal-conversion' %s -- -DMACRO_FROM_COMMAND_LINE -std=c++20 -Wno-macro-redefined | FileCheck --check-prefix=CHECK7 -implicit-check-not='{{warning:|error:}}' %s
28-
// RUN: not clang-tidy -checks='-*,modernize-use-override' %s -- -std=c++20 -DPR64602 | FileCheck -check-prefix=CHECK8 -implicit-check-not='{{warning:|error:}}' %s
28+
// RUN: clang-tidy -checks='-*,modernize-use-override' %s -- -std=c++20 -DPR64602
2929

3030
// CHECK1: error: no input files [clang-diagnostic-error]
3131
// CHECK1: error: no such file or directory: '{{.*}}nonexistent.cpp' [clang-diagnostic-error]
@@ -68,6 +68,4 @@ auto S<>::foo(auto)
6868
{
6969
return 1;
7070
}
71-
// CHECK8: error: conflicting types for 'foo' [clang-diagnostic-error]
72-
// CHECK8: note: previous declaration is here
7371
#endif

clang/cmake/caches/Fuchsia.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH
7171
Python3_LIBRARIES
7272
Python3_INCLUDE_DIRS
7373
Python3_RPATH
74+
SWIG_DIR
75+
SWIG_EXECUTABLE
7476
CMAKE_FIND_PACKAGE_PREFER_CONFIG
7577
CMAKE_SYSROOT
7678
CMAKE_MODULE_LINKER_FLAGS

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3295,6 +3295,21 @@ the configuration (without a prefix: ``Auto``).
32953295

32963296

32973297

3298+
.. _BreakFunctionDefinitionParameters:
3299+
3300+
**BreakFunctionDefinitionParameters** (``Boolean``) :versionbadge:`clang-format 19` :ref:`<BreakFunctionDefinitionParameters>`
3301+
If ``true``, clang-format will always break before function definition
3302+
parameters.
3303+
3304+
.. code-block:: c++
3305+
3306+
true:
3307+
void functionDefinition(
3308+
int A, int B) {}
3309+
3310+
false:
3311+
void functionDefinition(int A, int B) {}
3312+
32983313
.. _BreakInheritanceList:
32993314

33003315
**BreakInheritanceList** (``BreakInheritanceListStyle``) :versionbadge:`clang-format 7` :ref:`<BreakInheritanceList>`

clang/docs/ReleaseNotes.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,15 @@ Non-comprehensive list of changes in this release
193193
with support for any unsigned integer type. Like the previous builtins, these
194194
new builtins are constexpr and may be used in constant expressions.
195195

196+
- ``__typeof_unqual__`` is available in all C modes as an extension, which behaves
197+
like ``typeof_unqual`` from C23, similar to ``__typeof__`` and ``typeof``.
198+
196199
New Compiler Flags
197200
------------------
201+
- ``-fsanitize=implicit-bitfield-conversion`` checks implicit truncation and
202+
sign change.
203+
- ``-fsanitize=implicit-integer-conversion`` a group that replaces the previous
204+
group ``-fsanitize=implicit-conversion``.
198205

199206
- ``-Wmissing-designated-field-initializers``, grouped under ``-Wmissing-field-initializers``.
200207
This diagnostic can be disabled to make ``-Wmissing-field-initializers`` behave
@@ -208,6 +215,9 @@ Modified Compiler Flags
208215
- Added a new diagnostic flag ``-Wreturn-mismatch`` which is grouped under
209216
``-Wreturn-type``, and moved some of the diagnostics previously controlled by
210217
``-Wreturn-type`` under this new flag. Fixes #GH72116.
218+
- ``-fsanitize=implicit-conversion`` is now a group for both
219+
``-fsanitize=implicit-integer-conversion`` and
220+
``-fsanitize=implicit-bitfield-conversion``.
211221

212222
- Added ``-Wcast-function-type-mismatch`` under the ``-Wcast-function-type``
213223
warning group. Moved the diagnostic previously controlled by
@@ -253,6 +263,21 @@ Attribute Changes in Clang
253263
added a new extension query ``__has_extension(swiftcc)`` corresponding to the
254264
``__attribute__((swiftcc))`` attribute.
255265

266+
- The ``_Nullable`` and ``_Nonnull`` family of type attributes can now apply
267+
to certain C++ class types, such as smart pointers:
268+
``void useObject(std::unique_ptr<Object> _Nonnull obj);``.
269+
270+
This works for standard library types including ``unique_ptr``, ``shared_ptr``,
271+
and ``function``. See
272+
`the attribute reference documentation <https://llvm.org/docs/AttributeReference.html#nullability-attributes>`_
273+
for the full list.
274+
275+
- The ``_Nullable`` attribute can be applied to C++ class declarations:
276+
``template <class T> class _Nullable MySmartPointer {};``.
277+
278+
This allows the ``_Nullable`` and ``_Nonnull`` family of type attributes to
279+
apply to this class.
280+
256281
Improvements to Clang's diagnostics
257282
-----------------------------------
258283
- Clang now applies syntax highlighting to the code snippets it
@@ -313,6 +338,9 @@ Improvements to Clang's diagnostics
313338
- New ``-Wformat-signedness`` diagnostic that warn if the format string requires an
314339
unsigned argument and the argument is signed and vice versa.
315340

341+
- Clang now emits ``unused argument`` warning when the -fmodule-output flag is used
342+
with an input that is not of type c++-module.
343+
316344
Improvements to Clang's time-trace
317345
----------------------------------
318346

@@ -468,6 +496,11 @@ Bug Fixes to C++ Support
468496
following the first `::` were ignored).
469497
- Fix an out-of-bounds crash when checking the validity of template partial specializations. (part of #GH86757).
470498
- Fix an issue caused by not handling invalid cases when substituting into the parameter mapping of a constraint. Fixes (#GH86757).
499+
- Fixed a bug that prevented member function templates of class templates declared with a deduced return type
500+
from being explicitly specialized for a given implicit instantiation of the class template.
501+
502+
- Fix crash when inheriting from a cv-qualified type. Fixes:
503+
(`#35603 <https://github.com/llvm/llvm-project/issues/35603>`_)
471504

472505
Bug Fixes to AST Handling
473506
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/docs/UndefinedBehaviorSanitizer.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ Available checks are:
148148
Issues caught by this sanitizer are not undefined behavior,
149149
but are often unintentional.
150150
- ``-fsanitize=integer-divide-by-zero``: Integer division by zero.
151+
- ``-fsanitize=implicit-bitfield-conversion``: Implicit conversion from
152+
integer of larger bit width to smaller bitfield, if that results in data
153+
loss. This includes unsigned/signed truncations and sign changes, similarly
154+
to how the ``-fsanitize=implicit-integer-conversion`` group works, but
155+
explicitly for bitfields.
151156
- ``-fsanitize=nonnull-attribute``: Passing null pointer as a function
152157
parameter which is declared to never be null.
153158
- ``-fsanitize=null``: Use of a null pointer or creation of a null
@@ -193,16 +198,16 @@ Available checks are:
193198
signed division overflow (``INT_MIN/-1``). Note that checks are still
194199
added even when ``-fwrapv`` is enabled. This sanitizer does not check for
195200
lossy implicit conversions performed before the computation (see
196-
``-fsanitize=implicit-conversion``). Both of these two issues are handled
197-
by ``-fsanitize=implicit-conversion`` group of checks.
201+
``-fsanitize=implicit-integer-conversion``). Both of these two issues are handled
202+
by ``-fsanitize=implicit-integer-conversion`` group of checks.
198203
- ``-fsanitize=unreachable``: If control flow reaches an unreachable
199204
program point.
200205
- ``-fsanitize=unsigned-integer-overflow``: Unsigned integer overflow, where
201206
the result of an unsigned integer computation cannot be represented in its
202207
type. Unlike signed integer overflow, this is not undefined behavior, but
203208
it is often unintentional. This sanitizer does not check for lossy implicit
204209
conversions performed before such a computation
205-
(see ``-fsanitize=implicit-conversion``).
210+
(see ``-fsanitize=implicit-integer-conversion``).
206211
- ``-fsanitize=vla-bound``: A variable-length array whose bound
207212
does not evaluate to a positive value.
208213
- ``-fsanitize=vptr``: Use of an object whose vptr indicates that it is of
@@ -224,11 +229,15 @@ You can also use the following check groups:
224229
- ``-fsanitize=implicit-integer-arithmetic-value-change``: Catches implicit
225230
conversions that change the arithmetic value of the integer. Enables
226231
``implicit-signed-integer-truncation`` and ``implicit-integer-sign-change``.
227-
- ``-fsanitize=implicit-conversion``: Checks for suspicious
228-
behavior of implicit conversions. Enables
232+
- ``-fsanitize=implicit-integer-conversion``: Checks for suspicious
233+
behavior of implicit integer conversions. Enables
229234
``implicit-unsigned-integer-truncation``,
230235
``implicit-signed-integer-truncation``, and
231236
``implicit-integer-sign-change``.
237+
- ``-fsanitize=implicit-conversion``: Checks for suspicious
238+
behavior of implicit conversions. Enables
239+
``implicit-integer-conversion``, and
240+
``implicit-bitfield-conversion``.
232241
- ``-fsanitize=integer``: Checks for undefined or suspicious integer
233242
behavior (e.g. unsigned integer overflow).
234243
Enables ``signed-integer-overflow``, ``unsigned-integer-overflow``,

clang/include/clang/AST/Expr.h

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3215,23 +3215,12 @@ class CallExpr : public Expr {
32153215
}
32163216
};
32173217

3218-
/// Extra data stored in some MemberExpr objects.
3219-
struct MemberExprNameQualifier {
3220-
/// The nested-name-specifier that qualifies the name, including
3221-
/// source-location information.
3222-
NestedNameSpecifierLoc QualifierLoc;
3223-
3224-
/// The DeclAccessPair through which the MemberDecl was found due to
3225-
/// name qualifiers.
3226-
DeclAccessPair FoundDecl;
3227-
};
3228-
32293218
/// MemberExpr - [C99 6.5.2.3] Structure and Union Members. X->F and X.F.
32303219
///
32313220
class MemberExpr final
32323221
: public Expr,
3233-
private llvm::TrailingObjects<MemberExpr, MemberExprNameQualifier,
3234-
ASTTemplateKWAndArgsInfo,
3222+
private llvm::TrailingObjects<MemberExpr, NestedNameSpecifierLoc,
3223+
DeclAccessPair, ASTTemplateKWAndArgsInfo,
32353224
TemplateArgumentLoc> {
32363225
friend class ASTReader;
32373226
friend class ASTStmtReader;
@@ -3253,26 +3242,30 @@ class MemberExpr final
32533242
/// MemberLoc - This is the location of the member name.
32543243
SourceLocation MemberLoc;
32553244

3256-
size_t numTrailingObjects(OverloadToken<MemberExprNameQualifier>) const {
3257-
return hasQualifierOrFoundDecl();
3245+
size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>) const {
3246+
return hasQualifier();
3247+
}
3248+
3249+
size_t numTrailingObjects(OverloadToken<DeclAccessPair>) const {
3250+
return hasFoundDecl();
32583251
}
32593252

32603253
size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>) const {
32613254
return hasTemplateKWAndArgsInfo();
32623255
}
32633256

3264-
bool hasQualifierOrFoundDecl() const {
3265-
return MemberExprBits.HasQualifierOrFoundDecl;
3266-
}
3257+
bool hasFoundDecl() const { return MemberExprBits.HasFoundDecl; }
32673258

32683259
bool hasTemplateKWAndArgsInfo() const {
32693260
return MemberExprBits.HasTemplateKWAndArgsInfo;
32703261
}
32713262

32723263
MemberExpr(Expr *Base, bool IsArrow, SourceLocation OperatorLoc,
3273-
ValueDecl *MemberDecl, const DeclarationNameInfo &NameInfo,
3274-
QualType T, ExprValueKind VK, ExprObjectKind OK,
3275-
NonOdrUseReason NOUR);
3264+
NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc,
3265+
ValueDecl *MemberDecl, DeclAccessPair FoundDecl,
3266+
const DeclarationNameInfo &NameInfo,
3267+
const TemplateArgumentListInfo *TemplateArgs, QualType T,
3268+
ExprValueKind VK, ExprObjectKind OK, NonOdrUseReason NOUR);
32763269
MemberExpr(EmptyShell Empty)
32773270
: Expr(MemberExprClass, Empty), Base(), MemberDecl() {}
32783271

@@ -3316,24 +3309,24 @@ class MemberExpr final
33163309

33173310
/// Retrieves the declaration found by lookup.
33183311
DeclAccessPair getFoundDecl() const {
3319-
if (!hasQualifierOrFoundDecl())
3312+
if (!hasFoundDecl())
33203313
return DeclAccessPair::make(getMemberDecl(),
33213314
getMemberDecl()->getAccess());
3322-
return getTrailingObjects<MemberExprNameQualifier>()->FoundDecl;
3315+
return *getTrailingObjects<DeclAccessPair>();
33233316
}
33243317

33253318
/// Determines whether this member expression actually had
33263319
/// a C++ nested-name-specifier prior to the name of the member, e.g.,
33273320
/// x->Base::foo.
3328-
bool hasQualifier() const { return getQualifier() != nullptr; }
3321+
bool hasQualifier() const { return MemberExprBits.HasQualifier; }
33293322

33303323
/// If the member name was qualified, retrieves the
33313324
/// nested-name-specifier that precedes the member name, with source-location
33323325
/// information.
33333326
NestedNameSpecifierLoc getQualifierLoc() const {
3334-
if (!hasQualifierOrFoundDecl())
3327+
if (!hasQualifier())
33353328
return NestedNameSpecifierLoc();
3336-
return getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc;
3329+
return *getTrailingObjects<NestedNameSpecifierLoc>();
33373330
}
33383331

33393332
/// If the member name was qualified, retrieves the

clang/include/clang/AST/Stmt.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,13 @@ class alignas(void *) Stmt {
583583
unsigned IsArrow : 1;
584584

585585
/// True if this member expression used a nested-name-specifier to
586-
/// refer to the member, e.g., "x->Base::f", or found its member via
587-
/// a using declaration. When true, a MemberExprNameQualifier
588-
/// structure is allocated immediately after the MemberExpr.
586+
/// refer to the member, e.g., "x->Base::f".
589587
LLVM_PREFERRED_TYPE(bool)
590-
unsigned HasQualifierOrFoundDecl : 1;
588+
unsigned HasQualifier : 1;
589+
590+
// True if this member expression found its member via a using declaration.
591+
LLVM_PREFERRED_TYPE(bool)
592+
unsigned HasFoundDecl : 1;
591593

592594
/// True if this member expression specified a template keyword
593595
/// and/or a template argument list explicitly, e.g., x->f<int>,

0 commit comments

Comments
 (0)