diff options
author | Adrian Prantl <aprantl@apple.com> | 2016-01-22 21:14:41 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2016-01-22 21:14:41 +0000 |
commit | aa5d08d04bcb05a6fb34e22aa47d73d0f2641b8f (patch) | |
tree | 3dae8b8ef548be7e37b4ed73d0c7968bbea42de1 /clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | |
parent | 351164504a563b896f68a61e41cf154964939d85 (diff) | |
download | llvm-aa5d08d04bcb05a6fb34e22aa47d73d0f2641b8f.zip llvm-aa5d08d04bcb05a6fb34e22aa47d73d0f2641b8f.tar.gz llvm-aa5d08d04bcb05a6fb34e22aa47d73d0f2641b8f.tar.bz2 |
Module debugging: Create a parent DIModule with the PCH name for types
emitted into a precompiled header to mirror the debug info emitted for
object files importing the PCH.
rdar://problem/24290667
llvm-svn: 258555
Diffstat (limited to 'clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
-rw-r--r-- | clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 0e3aa61..406b433 100644 --- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -42,6 +42,7 @@ namespace { class PCHContainerGenerator : public ASTConsumer { DiagnosticsEngine &Diags; const std::string MainFileName; + const std::string OutputFileName; ASTContext *Ctx; ModuleMap &MMap; const HeaderSearchOptions &HeaderSearchOpts; @@ -137,7 +138,8 @@ public: const std::string &OutputFileName, raw_pwrite_stream *OS, std::shared_ptr<PCHBuffer> Buffer) - : Diags(CI.getDiagnostics()), Ctx(nullptr), + : Diags(CI.getDiagnostics()), MainFileName(MainFileName), + OutputFileName(OutputFileName), Ctx(nullptr), MMap(CI.getPreprocessor().getHeaderSearchInfo().getModuleMap()), HeaderSearchOpts(CI.getHeaderSearchOpts()), PreprocessorOpts(CI.getPreprocessorOpts()), @@ -163,6 +165,8 @@ public: Builder.reset(new CodeGen::CodeGenModule( *Ctx, HeaderSearchOpts, PreprocessorOpts, CodeGenOpts, *M, Diags)); Builder->getModuleDebugInfo()->setModuleMap(MMap); + Builder->getModuleDebugInfo()->setPCHDescriptor( + {MainFileName, "", OutputFileName, ~1ULL}); } bool HandleTopLevelDecl(DeclGroupRef D) override { |