summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
diff options
context:
space:
mode:
authorAmjad Aboud <amjad.aboud@intel.com>2016-04-21 16:58:49 +0000
committerAmjad Aboud <amjad.aboud@intel.com>2016-04-21 16:58:49 +0000
commita5ba99140c7865793a0e1154f9a7bb9a2f791851 (patch)
tree91ffc04d6e5cb6d06c3aa93c57c24da1c06980c4 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
parent9d26599078d956e5c4fbb9db51b54c4752106133 (diff)
downloadbcm5719-llvm-a5ba99140c7865793a0e1154f9a7bb9a2f791851.tar.gz
bcm5719-llvm-a5ba99140c7865793a0e1154f9a7bb9a2f791851.zip
Fixed Dwarf debug info emission to skip DILexicalBlockFile entries.
Before this fix, DILexicalBlockFile entries were skipped only in some cases and were not in other cases. Differential Revision: http://reviews.llvm.org/D18724 llvm-svn: 267004
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index 332e058f303..90f74a3686e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -118,7 +118,14 @@ public:
unsigned getOrCreateSourceID(StringRef FileName, StringRef DirName) override;
void addImportedEntity(const DIImportedEntity* IE) {
- ImportedEntities[IE->getScope()].push_back(IE);
+ DIScope *Scope = IE->getScope();
+ assert(Scope && "Invalid Scope encoding!");
+ if (!isa<DILocalScope>(Scope))
+ // No need to add imported enities that are not local declaration.
+ return;
+
+ auto *LocalScope = cast<DILocalScope>(Scope)->getNonLexicalBlockFileScope();
+ ImportedEntities[LocalScope].push_back(IE);
}
/// addRange - Add an address range to the list of ranges for this unit.
OpenPOWER on IntegriCloud