Skip to content

Commit 13bb660

Browse files
authored
Update LLVM and update APIs (#6147)
This also updates the patch file for compiler-rt as upstream has changed a bit. No functional change.
1 parent 4024d30 commit 13bb660

File tree

9 files changed

+26
-21
lines changed

9 files changed

+26
-21
lines changed

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ bazel_dep(name = "zstd", version = "1.5.7", repo_name = "llvm_zstd")
103103

104104
# We pin to specific upstream commits and try to track top-of-tree reasonably
105105
# closely rather than pinning to a specific release.
106-
# HEAD as of 2025-09-07.
107-
llvm_project_version = "c000c9e4bf737c1cc0e5c7b435b24ea73d21ee05"
106+
# HEAD as of 2025-11-14.
107+
llvm_project_version = "b2a81888f55735e9249ef25b6014a989e7f03969"
108108

109109
# Load a repository for the raw llvm-project, pre-overlay.
110110
http_archive(
111111
name = "llvm-raw",
112112
build_file_content = "# empty",
113-
integrity = "sha256-6URudXFgqoCuQI4hbb7AlN4Wj7WzLHFB4AWGjUV0UAI=",
113+
integrity = "sha256-PkRNmo5RZgP0RecsLW8kbg7SIS84OPX+StuNL4omIhw=",
114114
patch_args = ["-p1"],
115115
patches = [
116116
"@carbon//bazel/llvm_project:0001_Patch_for_mallinfo2_when_using_Bazel_build_system.patch",

bazel/llvm_project/0002_Added_Bazel_build_for_compiler_rt_fuzzer.patch

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ Subject: [PATCH] Add libfuzzer target to compiler-rt.
88
1 file changed, 17 insertions(+)
99

1010
diff --git a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
11-
index 9bdd454e1e36..0f30c21f63dc 100644
11+
index 90264449de76..115da4cb77f6 100644
1212
--- a/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
1313
+++ b/utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel
14-
@@ -50,3 +50,20 @@ cc_library(
15-
":config",
14+
@@ -57,6 +57,23 @@ cc_library(
1615
],
1716
)
18-
+
17+
1918
+cc_library(
2019
+ name = "FuzzerMain",
2120
+ srcs = glob(
@@ -32,5 +31,9 @@ index 9bdd454e1e36..0f30c21f63dc 100644
3231
+ ],
3332
+ includes = ["lib/fuzzer"],
3433
+)
34+
+
35+
cc_library(
36+
name = "orc_rt_common_headers",
37+
hdrs = [
3538
--
36-
2.42.0
39+
2.42.0

common/raw_hashtable_benchmark_helpers.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static_assert(llvm::isPowerOf2_64(NumFourCharStrs));
6161
static auto MakeFourCharStrs(llvm::ArrayRef<char> characters, absl::BitGen& gen)
6262
-> llvm::OwningArrayRef<std::array<char, 4>> {
6363
constexpr ssize_t NumCharsMask = NumChars - 1;
64-
constexpr ssize_t NumCharsShift = llvm::CTLog2<NumChars>();
64+
constexpr ssize_t NumCharsShift = llvm::ConstantLog2<NumChars>();
6565
llvm::OwningArrayRef<std::array<char, 4>> four_char_strs(NumFourCharStrs);
6666
for (auto [i, str] : llvm::enumerate(four_char_strs)) {
6767
str[0] = characters[i & NumCharsMask];
@@ -372,7 +372,7 @@ auto DumpHashStatistics(llvm::ArrayRef<T> keys) -> void {
372372
ssize_t expected_size =
373373
llvm::NextPowerOf2(keys.size() + (keys.size() / 7) - 1);
374374

375-
constexpr int GroupShift = llvm::CTLog2<GroupSize>();
375+
constexpr int GroupShift = llvm::ConstantLog2<GroupSize>();
376376

377377
size_t mask = ComputeProbeMaskFromSize(expected_size);
378378
uint64_t salt = ComputeSeed();

common/raw_hashtable_metadata_group.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class BitIndex
124124
return reinterpret_cast<T*>(
125125
&reinterpret_cast<std::byte*>(pointer)[index]);
126126
} else if constexpr (llvm::isPowerOf2_64(sizeof(T))) {
127-
constexpr size_t ScaleShift = llvm::CTLog2<sizeof(T)>();
127+
constexpr size_t ScaleShift = llvm::ConstantLog2<sizeof(T)>();
128128
static_assert(ScaleShift <= ByteEncodingShift,
129129
"Scaling by >=8 should be handled above!");
130130
constexpr size_t FoldedShift = ByteEncodingShift - ScaleShift;

toolchain/base/llvm_tools.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ LLVM_MAIN_TOOLS = {
2424
"nm": struct(bin_name = "llvm-nm", lib = "@llvm-project//llvm:llvm-nm-lib"),
2525
"objcopy": struct(bin_name = "llvm-objcopy", lib = "@llvm-project//llvm:llvm-objcopy-lib"),
2626
"objdump": struct(bin_name = "llvm-objdump", lib = "@llvm-project//llvm:llvm-objdump-lib"),
27-
"profdata": struct(bin_name = "llvm-profdata", lib = "@llvm-project//llvm:llvm-profdata-lib"),
2827
"rc": struct(bin_name = "llvm-rc", lib = "@llvm-project//llvm:llvm-rc-lib"),
2928
"readobj": struct(bin_name = "llvm-readobj", lib = "@llvm-project//llvm:llvm-readobj-lib"),
3029
"sancov": struct(bin_name = "sancov", lib = "@llvm-project//llvm:sancov-lib"),

toolchain/check/cpp/import.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ static auto MapBuiltinIntegerType(Context& context, SemIR::LocId loc_id,
10951095
unsigned width = ast_context.getIntWidth(qual_type);
10961096
bool is_signed = type.isSignedInteger();
10971097
auto int_n_type = ast_context.getIntTypeForBitwidth(width, is_signed);
1098-
if (ast_context.hasSameType(qual_type, int_n_type)) {
1098+
if (clang::ASTContext::hasSameType(qual_type, int_n_type)) {
10991099
TypeExpr type_expr =
11001100
MakeIntType(context, context.ints().Add(width), is_signed);
11011101
// Try to make sure integer types of 32 or 64 bits are complete so we can
@@ -1108,11 +1108,12 @@ static auto MapBuiltinIntegerType(Context& context, SemIR::LocId loc_id,
11081108
}
11091109
return type_expr;
11101110
}
1111-
if (ast_context.hasSameType(qual_type, ast_context.CharTy)) {
1111+
if (clang::ASTContext::hasSameType(qual_type, ast_context.CharTy)) {
11121112
return ExprAsType(context, Parse::NodeId::None,
11131113
MakeCharTypeLiteral(context, Parse::NodeId::None));
11141114
}
1115-
if (ast_context.hasSameType(qual_type, ast_context.LongTy) && width == 32) {
1115+
if (clang::ASTContext::hasSameType(qual_type, ast_context.LongTy) &&
1116+
width == 32) {
11161117
return ExprAsType(context, Parse::NodeId::None,
11171118
LookupNameInCore(context, Parse::NodeId::None,
11181119
{"CppCompat", "Long32"}));
@@ -1181,7 +1182,7 @@ static auto LookupCustomRecordType(Context& context,
11811182
// Maps a C++ tag type (class, struct, union, enum) to a Carbon type.
11821183
static auto MapTagType(Context& context, const clang::TagType& type)
11831184
-> TypeExpr {
1184-
auto* tag_decl = type.getOriginalDecl();
1185+
auto* tag_decl = type.getDecl();
11851186
CARBON_CHECK(tag_decl);
11861187

11871188
// Check if the declaration is already mapped.
@@ -1833,7 +1834,7 @@ static auto AddDependentUnimportedTypeDecls(Context& context,
18331834
}
18341835

18351836
if (const auto* tag_type = type->getAs<clang::TagType>()) {
1836-
AddDependentDecl(context, SemIR::ClangDeclKey(tag_type->getOriginalDecl()),
1837+
AddDependentDecl(context, SemIR::ClangDeclKey(tag_type->getDecl()),
18371838
worklist);
18381839
}
18391840
}

toolchain/check/testdata/interop/cpp/function/thunk_ast.carbon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ auto foo(short a) -> void;
6464
// CHECK:STDOUT: | |-ParmVarDecl {{0x[a-f0-9]+}} <<invalid sloc>> <invalid sloc> implicit 'std::align_val_t'
6565
// CHECK:STDOUT: | `-VisibilityAttr {{0x[a-f0-9]+}} <<invalid sloc>> Implicit Default
6666
// CHECK:STDOUT: |-FunctionDecl {{0x[a-f0-9]+}} <<carbon-internal>:8:1, line:14:1> line:8:7 operator new 'void *(unsigned long, void *) noexcept'
67-
// CHECK:STDOUT: | |-ParmVarDecl {{0x[a-f0-9]+}} <<built-in>:174:23, col:37> <carbon-internal>:8:33 'unsigned long'
67+
// CHECK:STDOUT: | |-ParmVarDecl {{0x[a-f0-9]+}} <<built-in>:176:23, col:37> <carbon-internal>:8:33 'unsigned long'
6868
// CHECK:STDOUT: | `-ParmVarDecl {{0x[a-f0-9]+}} <col:35, col:39> col:40 'void *'
6969
// CHECK:STDOUT: `-FunctionDecl {{0x[a-f0-9]+}} <./thunk_required.h:[[@LINE-51]]:6> col:6 foo__carbon_thunk 'void (short * _Nonnull)' extern
7070
// CHECK:STDOUT: |-ParmVarDecl {{0x[a-f0-9]+}} <col:6> col:6 used a 'short * _Nonnull':'short *'

toolchain/driver/clang_runner.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,11 @@ auto ClangRunner::RunCC1(llvm::SmallVectorImpl<const char*>& cc1_args) -> int {
326326
installation_->clang_resource_path();
327327
}
328328

329+
// Create the filesystem.
330+
clang_instance->createVirtualFileSystem(fs_, &diag_buffer);
331+
329332
// Create the actual diagnostics engine.
330-
clang_instance->createDiagnostics(*fs_);
333+
clang_instance->createDiagnostics();
331334
if (!clang_instance->hasDiagnostics()) {
332335
return EXIT_FAILURE;
333336
}
@@ -374,7 +377,7 @@ auto ClangRunner::RunCC1(llvm::SmallVectorImpl<const char*>& cc1_args) -> int {
374377
// options are stored in the compiler invocation and we can recreate the VFS
375378
// from the compiler invocation.
376379
if (!clang_instance->hasFileManager()) {
377-
clang_instance->createFileManager(fs_);
380+
clang_instance->createFileManager();
378381
}
379382

380383
if (auto profiler_output = clang_instance->createOutputFile(

toolchain/driver/llvm_runner_test.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ TEST(LLVMRunnerTest, Version) {
4747
case LLVMTool::InstallNameTool:
4848
case LLVMTool::Lipo:
4949
case LLVMTool::Objcopy:
50-
case LLVMTool::Profdata:
5150
case LLVMTool::Sancov:
5251
case LLVMTool::Strip:
5352
case LLVMTool::Symbolizer:

0 commit comments

Comments
 (0)