diff options
| author | Adrian Prantl <aprantl@apple.com> | 2015-09-23 20:44:37 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2015-09-23 20:44:37 +0000 |
| commit | ea8a724474c0e7e9bad7eab1ddb54fc75045bc66 (patch) | |
| tree | c3b79e475dccaf102e8e44e40585127c682c6d72 /llvm/tools | |
| parent | 15a67f49aa57f0d36a42a02eb63fe57836664b81 (diff) | |
| download | bcm5719-llvm-ea8a724474c0e7e9bad7eab1ddb54fc75045bc66.tar.gz bcm5719-llvm-ea8a724474c0e7e9bad7eab1ddb54fc75045bc66.zip | |
dsymutil: Don't prune forward declarations inside a module definition.
llvm-svn: 248428
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/dsymutil/DwarfLinker.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp index 818746dabeb..1aa15c5fb67 100644 --- a/llvm/tools/dsymutil/DwarfLinker.cpp +++ b/llvm/tools/dsymutil/DwarfLinker.cpp @@ -1764,7 +1764,7 @@ static bool analyzeContextInfo(const DWARFDebugInfoEntryMinimal *DIE, DeclContext *CurrentDeclContext, NonRelocatableStringpool &StringPool, DeclContextTree &Contexts, - bool InTagModule = false) { + bool InImportedModule = false) { unsigned MyIdx = CU.getOrigUnit().getDIEIndex(DIE); CompileUnit::DIEInfo &Info = CU.getInfo(MyIdx); @@ -1780,11 +1780,14 @@ static bool analyzeContextInfo(const DWARFDebugInfoEntryMinimal *DIE, // definitions match)." // // We treat non-C++ modules like namespaces for this reason. - if (DIE->getTag() == dwarf::DW_TAG_module) - InTagModule = true; + if (DIE->getTag() == dwarf::DW_TAG_module && + DIE->getAttributeValueAsString(&CU.getOrigUnit(), dwarf::DW_AT_name, + "") != CU.getClangModuleName()) { + InImportedModule = true; + } Info.ParentIdx = ParentIdx; - if (CU.hasODR() || CU.isClangModule() || InTagModule) { + if (CU.hasODR() || CU.isClangModule() || InImportedModule) { if (CurrentDeclContext) { auto PtrInvalidPair = Contexts.getChildDeclContext(*CurrentDeclContext, DIE, CU, StringPool); @@ -1795,12 +1798,12 @@ static bool analyzeContextInfo(const DWARFDebugInfoEntryMinimal *DIE, Info.Ctxt = CurrentDeclContext = nullptr; } - Info.Prune = InTagModule; + Info.Prune = InImportedModule; if (DIE->hasChildren()) for (auto *Child = DIE->getFirstChild(); Child && !Child->isNULL(); Child = Child->getSibling()) Info.Prune &= analyzeContextInfo(Child, MyIdx, CU, CurrentDeclContext, - StringPool, Contexts, InTagModule); + StringPool, Contexts, InImportedModule); // Prune this DIE if it is either a forward declaration inside a // DW_TAG_module or a DW_TAG_module that contains nothing but |

