diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-09-20 16:51:35 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-09-20 16:51:35 +0000 |
commit | 9402cef0ae7a3835ed8701e3b13edf5659bdea1b (patch) | |
tree | d8daa3ae6f895b92e804de833611194f2572c4b6 /clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | |
parent | 707a406078a8867389b6ad1bff8c1e09b7937f82 (diff) | |
download | bcm5719-llvm-9402cef0ae7a3835ed8701e3b13edf5659bdea1b.tar.gz bcm5719-llvm-9402cef0ae7a3835ed8701e3b13edf5659bdea1b.zip |
Module debugging: Support submodules in the PCM/PCH debug info.
llvm-svn: 248127
Diffstat (limited to 'clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp')
-rw-r--r-- | clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp index 147d198d9b8..1673340a495 100644 --- a/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp +++ b/clang/lib/CodeGen/ObjectFilePCHContainerOperations.cpp @@ -19,6 +19,8 @@ #include "clang/CodeGen/BackendUtil.h" #include "clang/Frontend/CodeGenOptions.h" #include "clang/Frontend/CompilerInstance.h" +#include "clang/Lex/Preprocessor.h" +#include "clang/Lex/HeaderSearch.h" #include "clang/Serialization/ASTWriter.h" #include "llvm/ADT/StringRef.h" #include "llvm/Bitcode/BitstreamReader.h" @@ -41,6 +43,7 @@ class PCHContainerGenerator : public ASTConsumer { DiagnosticsEngine &Diags; const std::string MainFileName; ASTContext *Ctx; + ModuleMap &MMap; const HeaderSearchOptions &HeaderSearchOpts; const PreprocessorOptions &PreprocessorOpts; CodeGenOptions CodeGenOpts; @@ -121,6 +124,7 @@ public: raw_pwrite_stream *OS, std::shared_ptr<PCHBuffer> Buffer) : Diags(CI.getDiagnostics()), Ctx(nullptr), + MMap(CI.getPreprocessor().getHeaderSearchInfo().getModuleMap()), HeaderSearchOpts(CI.getHeaderSearchOpts()), PreprocessorOpts(CI.getPreprocessorOpts()), TargetOpts(CI.getTargetOpts()), LangOpts(CI.getLangOpts()), OS(OS), @@ -145,6 +149,7 @@ public: M->setDataLayout(Ctx->getTargetInfo().getDataLayoutString()); Builder.reset(new CodeGen::CodeGenModule( *Ctx, HeaderSearchOpts, PreprocessorOpts, CodeGenOpts, *M, Diags)); + Builder->getModuleDebugInfo()->setModuleMap(MMap); } bool HandleTopLevelDecl(DeclGroupRef D) override { |