Debug info: Add dwarf backend support for DIModule.

rdar://problem/20965932

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241034 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl
2015-06-30 02:13:04 +00:00
parent 7ede9649c1
commit 85cd16c88e
6 changed files with 60 additions and 0 deletions

View File

@ -1069,6 +1069,30 @@ DIE *DwarfUnit::getOrCreateNameSpace(const DINamespace *NS) {
return &NDie;
}
DIE *DwarfUnit::getOrCreateModule(const DIModule *M) {
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE.
DIE *ContextDIE = getOrCreateContextDIE(M->getScope());
if (DIE *MDie = getDIE(M))
return MDie;
DIE &MDie = createAndAddDIE(dwarf::DW_TAG_module, *ContextDIE, M);
if (!M->getName().empty()) {
addString(MDie, dwarf::DW_AT_name, M->getName());
addGlobalName(M->getName(), MDie, M->getScope());
}
if (!M->getConfigurationMacros().empty())
addString(MDie, dwarf::DW_AT_LLVM_config_macros,
M->getConfigurationMacros());
if (!M->getIncludePath().empty())
addString(MDie, dwarf::DW_AT_LLVM_include_path, M->getIncludePath());
if (!M->getISysRoot().empty())
addString(MDie, dwarf::DW_AT_LLVM_isysroot, M->getISysRoot());
return &MDie;
}
DIE *DwarfUnit::getOrCreateSubprogramDIE(const DISubprogram *SP, bool Minimal) {
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE (as is the case for member function