diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 6 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 3 | ||||
-rw-r--r-- | clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Serialization/GeneratePCH.cpp | 3 |
4 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index ae1f5e7ecfa..72ddf4efc7c 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -3453,6 +3453,12 @@ CGDebugInfo::getOrCreateNameSpace(const NamespaceDecl *NSDecl) { return NS; } +void CGDebugInfo::setDwoId(uint64_t Signature) { + assert(TheCU && "no main compile unit"); + TheCU->setDWOId(Signature); +} + + void CGDebugInfo::finalize() { // Creating types might create further types - invalidating the current // element and the size(), so don't cache/reference them. diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index 8cad0c16b76..ddc90bfa67d 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -276,6 +276,9 @@ public: void finalize(); + /// Set the main CU's DwoId field to \p Signature. + void setDwoId(uint64_t Signature); + /// When generating debug information for a clang module or /// precompiled header, this module map will be used to determine /// the module of origin of each Decl. diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 310e374e348..8ceaf7cb3a0 100644 --- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -142,7 +142,6 @@ public: CodeGenOpts.ThreadModel = "single"; CodeGenOpts.DebugTypeExtRefs = true; CodeGenOpts.setDebugInfo(CodeGenOptions::FullDebugInfo); - CodeGenOpts.SplitDwarfFile = OutputFileName; } ~PCHContainerGenerator() override = default; @@ -201,6 +200,7 @@ public: M->setTargetTriple(Ctx.getTargetInfo().getTriple().getTriple()); M->setDataLayout(Ctx.getTargetInfo().getDataLayoutString()); + Builder->getModuleDebugInfo()->setDwoId(Buffer->Signature); // Finalize the Builder. if (Builder) diff --git a/clang/lib/Serialization/GeneratePCH.cpp b/clang/lib/Serialization/GeneratePCH.cpp index 08660bc9675..9de2fdb75a0 100644 --- a/clang/lib/Serialization/GeneratePCH.cpp +++ b/clang/lib/Serialization/GeneratePCH.cpp @@ -48,7 +48,8 @@ void PCHGenerator::HandleTranslationUnit(ASTContext &Ctx) { // Emit the PCH file to the Buffer. assert(SemaPtr && "No Sema?"); - Writer.WriteAST(*SemaPtr, OutputFile, Module, isysroot, hasErrors); + Buffer->Signature = + Writer.WriteAST(*SemaPtr, OutputFile, Module, isysroot, hasErrors); Buffer->IsComplete = true; } |