فهرست منبع

Update LLVM (#6022)

Notably, this updates past a major AST refactoring and tries to apply
those changes across the toolchain.
Chandler Carruth 7 ماه پیش
والد
کامیت
0691d4827c

+ 2 - 3
MODULE.bazel

@@ -103,14 +103,13 @@ bazel_dep(name = "zstd", version = "1.5.7", repo_name = "llvm_zstd")
 
 # We pin to specific upstream commits and try to track top-of-tree reasonably
 # closely rather than pinning to a specific release.
-# HEAD as of 2025-08-09.
-llvm_project_version = "fc44a4fcd3c54be927c15ddd9211aca1501633e7"
+# HEAD as of 2025-08-20.
+llvm_project_version = "a6da68ed36d7ecb9edf00262d2a2c1129689399f"
 
 # Load a repository for the raw llvm-project, pre-overlay.
 http_archive(
     name = "llvm-raw",
     build_file_content = "# empty",
-    integrity = "sha256-0iiuvlWDxpxOSP16jhSePSLuba+urpQAlGcUPTLZv8Q=",
     patch_args = ["-p1"],
     patches = [
         "@carbon//bazel/llvm_project:0001_Patch_for_mallinfo2_when_using_Bazel_build_system.patch",

+ 2 - 2
toolchain/check/cpp_thunk.cpp

@@ -144,7 +144,7 @@ struct CalleeFunctionInfo {
       implicit_this_type = method_decl->getThisType();
     }
     effective_return_type =
-        is_ctor ? ast_context.getRecordType(method_decl->getParent())
+        is_ctor ? ast_context.getCanonicalTagType(method_decl->getParent())
                 : decl->getReturnType();
     has_simple_return_type =
         IsSimpleAbiType(ast_context, effective_return_type);
@@ -451,7 +451,7 @@ static auto BuildThunkBody(clang::Sema& sema,
       info.Constructor) {
     // In C++, there are no direct calls to constructors, only initialization,
     // so we need to type-check and build the call ourselves.
-    auto type = sema.Context.getRecordType(
+    auto type = sema.Context.getCanonicalTagType(
         cast<clang::CXXRecordDecl>(callee_info.decl->getParent()));
     llvm::SmallVector<clang::Expr*> converted_args;
     converted_args.reserve(call_args.size());

+ 5 - 7
toolchain/check/import_cpp.cpp

@@ -581,10 +581,8 @@ static auto IsDeclInjectedClassName(const Context& context,
 
   const clang::ASTContext& ast_context =
       context.sem_ir().clang_ast_unit()->getASTContext();
-  CARBON_CHECK(
-      ast_context.getCanonicalType(
-          ast_context.getRecordType(scope_record_decl)) ==
-      ast_context.getCanonicalType(ast_context.getRecordType(record_decl)));
+  CARBON_CHECK(ast_context.getCanonicalTagType(scope_record_decl) ==
+               ast_context.getCanonicalTagType(record_decl));
 
   auto class_decl =
       context.sem_ir().insts().GetAs<SemIR::ClassDecl>(clang_decl.inst_id);
@@ -1117,7 +1115,7 @@ auto ImportClassDefinitionForClangDecl(Context& context, SemIR::LocId loc_id,
   // instantiation if necessary.
   clang::DiagnosticErrorTrap trap(ast->getDiagnostics());
   if (!ast->getSema().isCompleteType(
-          loc, context.ast_context().getTypeDeclType(clang_decl))) {
+          loc, context.ast_context().getCanonicalTagType(clang_decl))) {
     // Type is incomplete. Nothing more to do, but tell the caller if we
     // produced an error.
     return !trap.hasErrorOccurred();
@@ -1267,7 +1265,7 @@ static auto LookupCustomRecordType(Context& context,
 // Maps a C++ tag type (class, struct, union, enum) to a Carbon type.
 static auto MapTagType(Context& context, const clang::TagType& type)
     -> TypeExpr {
-  auto* tag_decl = type.getDecl();
+  auto* tag_decl = type.getOriginalDecl();
   CARBON_CHECK(tag_decl);
 
   // Check if the declaration is already mapped.
@@ -1810,7 +1808,7 @@ static auto AddDependentUnimportedTypeDecls(const Context& context,
   }
 
   if (const auto* tag_type = type->getAs<clang::TagType>()) {
-    AddDependentDecl(context, tag_type->getDecl(), worklist);
+    AddDependentDecl(context, tag_type->getOriginalDecl(), worklist);
   }
 }
 

+ 1 - 1
toolchain/driver/build_runtimes_subcommand.cpp

@@ -48,7 +48,7 @@ auto BuildRuntimesSubcommand::Run(DriverEnv& driver_env) -> DriverResult {
 
   // Don't run Clang when fuzzing, it is known to not be reliable under fuzzing
   // due to many unfixed issues.
-  if (!TestAndDiagnoseIfFuzzingExternalLibraries(driver_env, "clang")) {
+  if (TestAndDiagnoseIfFuzzingExternalLibraries(driver_env, "clang")) {
     return {.success = false};
   }
 

+ 1 - 1
toolchain/sem_ir/inst_namer.h

@@ -110,7 +110,7 @@ class InstNamer {
     class Name {
      public:
       explicit Name() : value_(nullptr) {}
-      explicit Name(llvm::StringMapIterator<NameResult> it,
+      explicit Name(llvm::StringMap<NameResult>::iterator it,
                     size_t base_name_size)
           : value_(&*it), base_name_size_(base_name_size) {}