Skip to content

Commit 1ff1ea1

Browse files
Merge branch 'main' into extend-offloading-api-llvm-readobj
2 parents 81e2cc8 + 432b589 commit 1ff1ea1

File tree

490 files changed

+18709
-10703
lines changed

Some content is hidden

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

490 files changed

+18709
-10703
lines changed

.ci/compute_projects.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
"mlir": "check-mlir",
151151
"openmp": "check-openmp",
152152
"polly": "check-polly",
153+
"lit": "check-lit",
153154
}
154155

155156
RUNTIMES = {"libcxx", "libcxxabi", "libunwind", "compiler-rt", "libc", "flang-rt"}
@@ -166,8 +167,12 @@
166167
("llvm", "utils", "gn"): "gn",
167168
(".github", "workflows", "premerge.yaml"): ".ci",
168169
("third-party",): ".ci",
170+
("llvm", "utils", "lit"): "lit",
169171
}
170172

173+
# Projects that should run tests but cannot be explicitly built.
174+
SKIP_BUILD_PROJECTS = ["CIR", "lit"]
175+
171176
# Projects that should not run any tests. These need to be metaprojects.
172177
SKIP_PROJECTS = ["docs", "gn"]
173178

@@ -315,7 +320,9 @@ def get_env_variables(modified_files: list[str], platform: str) -> Set[str]:
315320
# clang build, but it requires an explicit option to enable. We set that
316321
# option here, and remove it from the projects_to_build list.
317322
enable_cir = "ON" if "CIR" in projects_to_build else "OFF"
318-
projects_to_build.discard("CIR")
323+
# Remove any metaprojects from the list of projects to build.
324+
for project in SKIP_BUILD_PROJECTS:
325+
projects_to_build.discard(project)
319326

320327
# We use a semicolon to separate the projects/runtimes as they get passed
321328
# to the CMake invocation and thus we need to use the CMake list separator

.ci/compute_projects_test.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,30 @@ def test_third_party_benchmark(self):
413413
"check-cxx check-cxxabi check-unwind",
414414
)
415415

416+
def test_lit(self):
417+
env_variables = compute_projects.get_env_variables(
418+
["llvm/utils/lit/CMakeLists.txt"], "Linux"
419+
)
420+
self.assertEqual(
421+
env_variables["projects_to_build"],
422+
"bolt;clang;clang-tools-extra;flang;lld;lldb;llvm;mlir;polly",
423+
)
424+
self.assertEqual(
425+
env_variables["project_check_targets"],
426+
"check-bolt check-clang check-clang-tools check-flang check-lit check-lld check-lldb check-llvm check-mlir check-polly",
427+
)
428+
self.assertEqual(
429+
env_variables["runtimes_to_build"], "libcxx;libcxxabi;libunwind"
430+
)
431+
self.assertEqual(
432+
env_variables["runtimes_check_targets"],
433+
"",
434+
)
435+
self.assertEqual(
436+
env_variables["runtimes_check_targets_needs_reconfig"],
437+
"check-cxx check-cxxabi check-unwind",
438+
)
439+
416440

417441
if __name__ == "__main__":
418442
unittest.main()

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@
132132
/mlir/**/Transforms/Mem2Reg.* @moxinilian
133133
/mlir/**/Transforms/SROA.* @moxinilian
134134

135+
# MLIR IRDL-related
136+
/mlir/**/*IRDL* @moxinilian
137+
135138
# BOLT
136139
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @yota9 @paschalis-mpeis @yozhu
137140

clang-tools-extra/test/clang-tidy/checkers/modernize/return-braced-init-list.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %check_clang_tidy -std=c++14-or-later %s modernize-return-braced-init-list %t
1+
// RUN: %check_clang_tidy -std=c++11-or-later %s modernize-return-braced-init-list %t
22

33
namespace std {
44
typedef decltype(sizeof(int)) size_t;
@@ -80,10 +80,12 @@ Foo f2() {
8080
return {b2};
8181
}
8282

83+
#if __cplusplus >= 201402L
8384
auto f3() {
8485
Bar b3;
8586
return Foo(b3);
8687
}
88+
#endif
8789

8890
#define A(b) Foo(b)
8991

clang/cmake/caches/PGO.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")
55
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
66

77
set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
8-
set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED IR CACHE BOOL "")
8+
set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "")
99
set(CLANG_BOOTSTRAP_TARGETS
1010
generate-profdata
1111
stage2

clang/docs/ReleaseNotes.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,23 @@ Potentially Breaking Changes
5252
``--gcc-install-dir`` command line argument. This will silence the
5353
warning. It can also be disabled using the
5454
``-Wno-gcc-install-dir-libstdcxx`` command line flag.
55+
- Scalar deleting destructor support has been aligned with MSVC when
56+
targeting the MSVC ABI. Clang previously implemented support for
57+
``::delete`` by calling the complete object destructor and then the
58+
appropriate global delete operator (as is done for the Itanium ABI).
59+
The scalar deleting destructor is now called to destroy the object
60+
and deallocate its storage. This is an ABI change that can result in
61+
memory corruption when a program built for the MSVC ABI has
62+
portions compiled with clang 21 or earlier and portions compiled
63+
with a version of clang 22 (or MSVC). Consider a class ``X`` that
64+
declares a virtual destructor and an ``operator delete`` member
65+
with the destructor defined in library ``A`` and a call to `::delete`` in
66+
library ``B``. If library ``A`` is compiled with clang 21 and library ``B``
67+
is compiled with clang 22, the ``::delete`` call might dispatch to the
68+
scalar deleting destructor emitted in library ``A`` which will erroneously
69+
call the member ``operator delete`` instead of the expected global
70+
delete operator. The old behavior is retained under ``-fclang-abi-compat=21``
71+
flag.
5572

5673
C/C++ Language Potentially Breaking Changes
5774
-------------------------------------------
@@ -233,6 +250,9 @@ Removed Compiler Flags
233250

234251
Attribute Changes in Clang
235252
--------------------------
253+
- The definition of a function declaration with ``[[clang::cfi_unchecked_callee]]`` inherits this
254+
attribute, allowing the attribute to only be attached to the declaration. Prior, this would be
255+
treated as an error where the definition and declaration would have differing types.
236256

237257
Improvements to Clang's diagnostics
238258
-----------------------------------
@@ -330,6 +350,9 @@ Bug Fixes in This Version
330350
``-Wshadow`` and show uncaptured-local warnings with ``-Wshadow-all``. (#GH68605)
331351
- Fixed a failed assertion with a negative limit parameter value inside of
332352
``__has_embed``. (#GH157842)
353+
- Fixed an assertion when an improper use of the ``malloc`` attribute targeting
354+
a function without arguments caused us to try to access a non-existent argument.
355+
(#GH159080)
333356

334357
Bug Fixes to Compiler Builtins
335358
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -379,6 +402,8 @@ Bug Fixes to C++ Support
379402
the function type.
380403
- Fix an assertion failure when a ``constexpr`` variable is only referenced through
381404
``__builtin_addressof``, and related issues with builtin arguments. (#GH154034)
405+
- Fix an assertion failure when taking the address on a non-type template parameter argument of
406+
object type. (#GH151531)
382407

383408
Bug Fixes to AST Handling
384409
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -448,6 +473,8 @@ CUDA/HIP Language Changes
448473
CUDA Support
449474
^^^^^^^^^^^^
450475

476+
Support calling `consteval` function between different target.
477+
451478
AIX Support
452479
^^^^^^^^^^^
453480

clang/include/clang/AST/ASTMutationListener.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ class ASTMutationListener {
8686
const FunctionDecl *Delete,
8787
Expr *ThisArg) {}
8888

89+
/// A virtual destructor's operator global delete has been resolved.
90+
virtual void ResolvedOperatorGlobDelete(const CXXDestructorDecl *DD,
91+
const FunctionDecl *GlobDelete) {}
92+
8993
/// An implicit member got a definition.
9094
virtual void CompletedImplicitDefinition(const FunctionDecl *D) {}
9195

clang/include/clang/AST/DeclCXX.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,6 +2873,7 @@ class CXXDestructorDecl : public CXXMethodDecl {
28732873
// FIXME: Don't allocate storage for these except in the first declaration
28742874
// of a virtual destructor.
28752875
FunctionDecl *OperatorDelete = nullptr;
2876+
FunctionDecl *OperatorGlobalDelete = nullptr;
28762877
Expr *OperatorDeleteThisArg = nullptr;
28772878

28782879
CXXDestructorDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
@@ -2898,11 +2899,16 @@ class CXXDestructorDecl : public CXXMethodDecl {
28982899
static CXXDestructorDecl *CreateDeserialized(ASTContext &C, GlobalDeclID ID);
28992900

29002901
void setOperatorDelete(FunctionDecl *OD, Expr *ThisArg);
2902+
void setOperatorGlobalDelete(FunctionDecl *OD);
29012903

29022904
const FunctionDecl *getOperatorDelete() const {
29032905
return getCanonicalDecl()->OperatorDelete;
29042906
}
29052907

2908+
const FunctionDecl *getOperatorGlobalDelete() const {
2909+
return getCanonicalDecl()->OperatorGlobalDelete;
2910+
}
2911+
29062912
Expr *getOperatorDeleteThisArg() const {
29072913
return getCanonicalDecl()->OperatorDeleteThisArg;
29082914
}

clang/include/clang/Basic/ABIVersions.def

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ ABI_VER_MAJOR(19)
127127
/// - Incorrectly return C++ records in AVX registers on x86_64.
128128
ABI_VER_MAJOR(20)
129129

130+
/// Attempt to be ABI-compatible with code generated by Clang 21.0.x.
131+
/// This causes clang to:
132+
/// - When targeting Windows emit scalar deleting destructors that are not
133+
/// compatible with scalar deleting destructors emitted by MSVC for the
134+
/// cases when the class whose destructor is being emitted defines
135+
/// operator delete.
136+
ABI_VER_MAJOR(21)
137+
130138
/// Conform to the underlying platform's C and C++ ABIs as closely as we can.
131139
ABI_VER_LATEST(Latest)
132140

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_f16_f32, "V2hV2hfUiIb", "nc", "f32-to-f16
696696
//===----------------------------------------------------------------------===//
697697
// GFX1250+ only builtins.
698698
//===----------------------------------------------------------------------===//
699+
TARGET_BUILTIN(__builtin_amdgcn_s_cluster_barrier, "v", "n", "gfx1250-insts")
699700

700701
TARGET_BUILTIN(__builtin_amdgcn_flat_prefetch, "vvC*0Ii", "nc", "vmem-pref-insts")
701702
TARGET_BUILTIN(__builtin_amdgcn_global_prefetch, "vvC*1Ii", "nc", "vmem-pref-insts")

0 commit comments

Comments
 (0)