Skip to content

Commit d3335aa

Browse files
Merge branch 'main' into sve_neon_fp8
2 parents 0178e8d + e290152 commit d3335aa

File tree

394 files changed

+24690
-4952
lines changed

Some content is hidden

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

394 files changed

+24690
-4952
lines changed

bolt/lib/Passes/Instrumentation.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,8 @@ static bool hasAArch64ExclusiveMemop(
109109
BinaryBasicBlock *BB = BBQueue.front().first;
110110
bool IsLoad = BBQueue.front().second;
111111
BBQueue.pop();
112-
if (Visited.find(BB) != Visited.end())
112+
if (!Visited.insert(BB).second)
113113
continue;
114-
Visited.insert(BB);
115114

116115
for (const MCInst &Inst : *BB) {
117116
// Two loads one after another - skip whole function
@@ -126,8 +125,7 @@ static bool hasAArch64ExclusiveMemop(
126125
if (BC.MIB->isAArch64ExclusiveLoad(Inst))
127126
IsLoad = true;
128127

129-
if (IsLoad && BBToSkip.find(BB) == BBToSkip.end()) {
130-
BBToSkip.insert(BB);
128+
if (IsLoad && BBToSkip.insert(BB).second) {
131129
if (opts::Verbosity >= 2) {
132130
outs() << "BOLT-INSTRUMENTER: skip BB " << BB->getName()
133131
<< " due to exclusive instruction in function "

bolt/tools/driver/llvm-bolt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ int main(int argc, char **argv) {
202202

203203
ToolName = argv[0];
204204

205-
if (llvm::sys::path::filename(ToolName) == "perf2bolt")
205+
if (llvm::sys::path::filename(ToolName).starts_with("perf2bolt"))
206206
perf2boltMode(argc, argv);
207-
else if (llvm::sys::path::filename(ToolName) == "llvm-boltdiff")
207+
else if (llvm::sys::path::filename(ToolName).starts_with("llvm-boltdiff"))
208208
boltDiffMode(argc, argv);
209209
else
210210
boltMode(argc, argv);

clang-tools-extra/clang-tidy/bugprone/CrtpConstructorAccessibilityCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void CrtpConstructorAccessibilityCheck::check(
165165

166166
WithFriendHintIfNeeded(
167167
diag(Ctor->getLocation(),
168-
"%0 contructor allows the CRTP to be %select{inherited "
168+
"%0 constructor allows the CRTP to be %select{inherited "
169169
"from|constructed}1 as a regular template class; consider making "
170170
"it private%select{| and declaring the derived class as friend}2")
171171
<< Access << IsPublic << NeedsFriend

clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,9 @@ StyleKind IdentifierNamingCheck::findStyleKind(
11351135
if (isa<TypeAliasDecl>(D) && NamingStyles[SK_TypeAlias])
11361136
return SK_TypeAlias;
11371137

1138+
if (isa<NamespaceAliasDecl>(D) && NamingStyles[SK_Namespace])
1139+
return SK_Namespace;
1140+
11381141
if (const auto *Decl = dyn_cast<NamespaceDecl>(D)) {
11391142
if (Decl->isAnonymousNamespace())
11401143
return SK_Invalid;

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ Changes in existing checks
244244
<clang-tidy/checks/readability/redundant-smartptr-get>` check to
245245
remove `->`, when redundant `get()` is removed.
246246

247+
- Improved :doc:`readability-identifier-naming
248+
<clang-tidy/checks/readability/identifier-naming>` check to
249+
validate ``namespace`` aliases.
250+
247251
Removed checks
248252
^^^^^^^^^^^^^^
249253

clang-tools-extra/test/clang-tidy/checkers/bugprone/crtp-constructor-accessibility.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ template <typename T>
2626
class CRTP {
2727
public:
2828
CRTP() = default;
29-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
29+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
3030
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP() = default;{{[[:space:]]*}}public:
3131
// CHECK-FIXES: friend T;
3232
};
@@ -39,7 +39,7 @@ template <typename T>
3939
class CRTP {
4040
public:
4141
CRTP(int) {}
42-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
42+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
4343
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP(int) {}{{[[:space:]]*}}public:
4444
// CHECK-FIXES: friend T;
4545
};
@@ -52,10 +52,10 @@ template <typename T>
5252
class CRTP {
5353
public:
5454
CRTP(int) {}
55-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
55+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
5656
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP(int) {}{{[[:space:]]*}}public:
5757
CRTP(float) {}
58-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
58+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
5959
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP(float) {}{{[[:space:]]*}}public:
6060

6161
// CHECK-FIXES: friend T;
@@ -70,13 +70,13 @@ template <typename T>
7070
class CRTP {
7171
protected:
7272
CRTP(int) {}
73-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected contructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
73+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected constructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
7474
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP(int) {}{{[[:space:]]*}}protected:
7575
CRTP() = default;
76-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected contructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
76+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected constructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
7777
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP() = default;{{[[:space:]]*}}protected:
7878
CRTP(float) {}
79-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected contructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
79+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: protected constructor allows the CRTP to be inherited from as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
8080
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP(float) {}{{[[:space:]]*}}protected:
8181

8282
// CHECK-FIXES: friend T;
@@ -101,7 +101,7 @@ namespace struct_default_ctor {
101101
template <typename T>
102102
struct CRTP {
103103
CRTP() = default;
104-
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public contructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
104+
// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: public constructor allows the CRTP to be constructed as a regular template class; consider making it private and declaring the derived class as friend [bugprone-crtp-constructor-accessibility]
105105
// CHECK-FIXES: private:{{[[:space:]]*}}CRTP() = default;{{[[:space:]]*}}public:
106106
// CHECK-FIXES: friend T;
107107
};

clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ inline namespace InlineNamespace {
101101
// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for inline namespace 'InlineNamespace'
102102
// CHECK-FIXES: {{^}}inline namespace inline_namespace {{{$}}
103103

104+
namespace FOO_ALIAS = FOO_NS;
105+
// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for namespace 'FOO_ALIAS' [readability-identifier-naming]
106+
// CHECK-FIXES: {{^}}namespace foo_alias = FOO_NS;{{$}}
107+
104108
SYSTEM_NS::structure g_s1;
105109
// NO warnings or fixes expected as SYSTEM_NS and structure are declared in a header file
106110

clang/cmake/modules/AddClang.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ macro(add_clang_library name)
108108
endif()
109109
llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs})
110110

111+
if(MSVC AND NOT CLANG_LINK_CLANG_DYLIB)
112+
# Make sure all consumers also turn off visibility macros so there not trying to dllimport symbols.
113+
target_compile_definitions(${name} PUBLIC CLANG_BUILD_STATIC)
114+
if(TARGET "obj.${name}")
115+
target_compile_definitions("obj.${name}" PUBLIC CLANG_BUILD_STATIC)
116+
endif()
117+
elseif(NOT ARG_SHARED AND NOT ARG_STATIC)
118+
# Clang component libraries linked in to clang-cpp are declared without SHARED or STATIC
119+
target_compile_definitions("obj.${name}" PUBLIC CLANG_EXPORTS)
120+
endif()
121+
111122
set(libs ${name})
112123
if(ARG_SHARED AND ARG_STATIC)
113124
list(APPEND libs ${name}_static)

clang/docs/LanguageExtensions.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5883,3 +5883,26 @@ specify the starting offset to begin embedding from. The resources is treated
58835883
as being empty if the specified offset is larger than the number of bytes in
58845884
the resource. The offset will be applied *before* any ``limit`` parameters are
58855885
applied.
5886+
5887+
Union and aggregate initialization in C
5888+
=======================================
5889+
5890+
In C23 (N2900), when an object is initialized from initializer ``= {}``, all
5891+
elements of arrays, all members of structs, and the first members of unions are
5892+
empty-initialized recursively. In addition, all padding bits are initialized to
5893+
zero.
5894+
5895+
Clang guarantees the following behaviors:
5896+
5897+
* ``1:`` Clang supports initializer ``= {}`` mentioned above in all C
5898+
standards.
5899+
5900+
* ``2:`` When unions are initialized from initializer ``= {}``, bytes outside
5901+
of the first members of unions are also initialized to zero.
5902+
5903+
* ``3:`` When unions, structures and arrays are initialized from initializer
5904+
``= { initializer-list }``, all members not explicitly initialized in
5905+
the initializer list are empty-initialized recursively. In addition, all
5906+
padding bits are initialized to zero.
5907+
5908+
Currently, the above extension only applies to C source code, not C++.

clang/docs/ReleaseNotes.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,13 @@ Bug Fixes to C++ Support
509509
a class template. (#GH102320)
510510
- Fix a crash when parsing a pseudo destructor involving an invalid type. (#GH111460)
511511
- Fixed an assertion failure when invoking recovery call expressions with explicit attributes
512-
and undeclared templates. (#GH107047, #GH49093)
512+
and undeclared templates. (#GH107047), (#GH49093)
513513
- Clang no longer crashes when a lambda contains an invalid block declaration that contains an unexpanded
514514
parameter pack. (#GH109148)
515515
- Fixed overload handling for object parameters with top-level cv-qualifiers in explicit member functions (#GH100394)
516+
- Fixed a bug in lambda captures where ``constexpr`` class-type objects were not properly considered ODR-used in
517+
certain situations. (#GH47400), (#GH90896)
518+
- Fix erroneous templated array size calculation leading to crashes in generated code. (#GH41441)
516519

517520
Bug Fixes to AST Handling
518521
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -620,6 +623,8 @@ CUDA/HIP Language Changes
620623

621624
CUDA Support
622625
^^^^^^^^^^^^
626+
- Clang now supports CUDA SDK up to 12.6
627+
- Added support for sm_100
623628

624629
AIX Support
625630
^^^^^^^^^^^

0 commit comments

Comments
 (0)