Skip to content

Commit 0691d48

Browse files
authored
Update LLVM (#6022)
Notably, this updates past a major AST refactoring and tries to apply those changes across the toolchain.
1 parent ee42b2d commit 0691d48

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

MODULE.bazel

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,13 @@ 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-08-09.
107-
llvm_project_version = "fc44a4fcd3c54be927c15ddd9211aca1501633e7"
106+
# HEAD as of 2025-08-20.
107+
llvm_project_version = "a6da68ed36d7ecb9edf00262d2a2c1129689399f"
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-0iiuvlWDxpxOSP16jhSePSLuba+urpQAlGcUPTLZv8Q=",
114113
patch_args = ["-p1"],
115114
patches = [
116115
"@carbon//bazel/llvm_project:0001_Patch_for_mallinfo2_when_using_Bazel_build_system.patch",

toolchain/check/cpp_thunk.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ struct CalleeFunctionInfo {
144144
implicit_this_type = method_decl->getThisType();
145145
}
146146
effective_return_type =
147-
is_ctor ? ast_context.getRecordType(method_decl->getParent())
147+
is_ctor ? ast_context.getCanonicalTagType(method_decl->getParent())
148148
: decl->getReturnType();
149149
has_simple_return_type =
150150
IsSimpleAbiType(ast_context, effective_return_type);
@@ -451,7 +451,7 @@ static auto BuildThunkBody(clang::Sema& sema,
451451
info.Constructor) {
452452
// In C++, there are no direct calls to constructors, only initialization,
453453
// so we need to type-check and build the call ourselves.
454-
auto type = sema.Context.getRecordType(
454+
auto type = sema.Context.getCanonicalTagType(
455455
cast<clang::CXXRecordDecl>(callee_info.decl->getParent()));
456456
llvm::SmallVector<clang::Expr*> converted_args;
457457
converted_args.reserve(call_args.size());

toolchain/check/import_cpp.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -581,10 +581,8 @@ static auto IsDeclInjectedClassName(const Context& context,
581581

582582
const clang::ASTContext& ast_context =
583583
context.sem_ir().clang_ast_unit()->getASTContext();
584-
CARBON_CHECK(
585-
ast_context.getCanonicalType(
586-
ast_context.getRecordType(scope_record_decl)) ==
587-
ast_context.getCanonicalType(ast_context.getRecordType(record_decl)));
584+
CARBON_CHECK(ast_context.getCanonicalTagType(scope_record_decl) ==
585+
ast_context.getCanonicalTagType(record_decl));
588586

589587
auto class_decl =
590588
context.sem_ir().insts().GetAs<SemIR::ClassDecl>(clang_decl.inst_id);
@@ -1117,7 +1115,7 @@ auto ImportClassDefinitionForClangDecl(Context& context, SemIR::LocId loc_id,
11171115
// instantiation if necessary.
11181116
clang::DiagnosticErrorTrap trap(ast->getDiagnostics());
11191117
if (!ast->getSema().isCompleteType(
1120-
loc, context.ast_context().getTypeDeclType(clang_decl))) {
1118+
loc, context.ast_context().getCanonicalTagType(clang_decl))) {
11211119
// Type is incomplete. Nothing more to do, but tell the caller if we
11221120
// produced an error.
11231121
return !trap.hasErrorOccurred();
@@ -1267,7 +1265,7 @@ static auto LookupCustomRecordType(Context& context,
12671265
// Maps a C++ tag type (class, struct, union, enum) to a Carbon type.
12681266
static auto MapTagType(Context& context, const clang::TagType& type)
12691267
-> TypeExpr {
1270-
auto* tag_decl = type.getDecl();
1268+
auto* tag_decl = type.getOriginalDecl();
12711269
CARBON_CHECK(tag_decl);
12721270

12731271
// Check if the declaration is already mapped.
@@ -1810,7 +1808,7 @@ static auto AddDependentUnimportedTypeDecls(const Context& context,
18101808
}
18111809

18121810
if (const auto* tag_type = type->getAs<clang::TagType>()) {
1813-
AddDependentDecl(context, tag_type->getDecl(), worklist);
1811+
AddDependentDecl(context, tag_type->getOriginalDecl(), worklist);
18141812
}
18151813
}
18161814

toolchain/driver/build_runtimes_subcommand.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ auto BuildRuntimesSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
4848

4949
// Don't run Clang when fuzzing, it is known to not be reliable under fuzzing
5050
// due to many unfixed issues.
51-
if (!TestAndDiagnoseIfFuzzingExternalLibraries(driver_env, "clang")) {
51+
if (TestAndDiagnoseIfFuzzingExternalLibraries(driver_env, "clang")) {
5252
return {.success = false};
5353
}
5454

toolchain/sem_ir/inst_namer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class InstNamer {
110110
class Name {
111111
public:
112112
explicit Name() : value_(nullptr) {}
113-
explicit Name(llvm::StringMapIterator<NameResult> it,
113+
explicit Name(llvm::StringMap<NameResult>::iterator it,
114114
size_t base_name_size)
115115
: value_(&*it), base_name_size_(base_name_size) {}
116116

0 commit comments

Comments
 (0)