diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-09-24 16:10:10 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-09-24 16:10:10 +0000 |
commit | 835e6633abda36f51ce9ee47696649bc0f0cf99e (patch) | |
tree | 1c4f181727ba47a9cfbce8e3d7fef52be0854186 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | eb66a263c24059d8884683638a058441ef1b836d (diff) | |
download | bcm5719-llvm-835e6633abda36f51ce9ee47696649bc0f0cf99e.tar.gz bcm5719-llvm-835e6633abda36f51ce9ee47696649bc0f0cf99e.zip |
Module Debugging: Emit submodules as nested DW_TAG_modules.
llvm-svn: 248511
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index d8879cc6f10..c2cc49a0c5e 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1707,18 +1707,23 @@ CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod, } } - std::string FullModuleName = Mod.getFullModuleName(); - if (CreateSkeletonCU) { + bool IsRootModule = M ? !M->Parent : true; + if (CreateSkeletonCU && IsRootModule) { llvm::DIBuilder DIB(CGM.getModule()); - DIB.createCompileUnit(TheCU->getSourceLanguage(), FullModuleName, + DIB.createCompileUnit(TheCU->getSourceLanguage(), Mod.getModuleName(), Mod.getPath(), TheCU->getProducer(), true, StringRef(), 0, Mod.getASTFile(), llvm::DIBuilder::FullDebug, Mod.getSignature()); DIB.finalize(); } + llvm::DIModule *Parent = + IsRootModule ? nullptr + : getOrCreateModuleRef( + ExternalASTSource::ASTSourceDescriptor(*M->Parent), + CreateSkeletonCU); llvm::DIModule *DIMod = - DBuilder.createModule(TheCU, FullModuleName, ConfigMacros, Mod.getPath(), - CGM.getHeaderSearchOpts().Sysroot); + DBuilder.createModule(Parent, Mod.getModuleName(), ConfigMacros, + Mod.getPath(), CGM.getHeaderSearchOpts().Sysroot); ModRef.reset(DIMod); return DIMod; } |