diff options
author | Amjad Aboud <amjad.aboud@intel.com> | 2016-04-30 01:44:07 +0000 |
---|---|---|
committer | Amjad Aboud <amjad.aboud@intel.com> | 2016-04-30 01:44:07 +0000 |
commit | 72da9391f0322c3868ade631066186b5233f75c3 (patch) | |
tree | d5eb72ff934f67831f63217252118ddd01eea5d8 /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | |
parent | a85efd985c74716429b69cebbac1a5f438fd45d1 (diff) | |
download | bcm5719-llvm-72da9391f0322c3868ade631066186b5233f75c3.tar.gz bcm5719-llvm-72da9391f0322c3868ade631066186b5233f75c3.zip |
Reverting 268054 & 268063 as they caused PR27579.
llvm-svn: 268150
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index e5d71f3cea8..51f25ec0fe6 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -298,15 +298,10 @@ void DwarfUnit::addDIEEntry(DIE &Die, dwarf::Attribute Attribute, Entry); } -DIE *DwarfUnit::createDIE(unsigned Tag, const DINode *N) { - DIE *Die = DIE::get(DIEValueAllocator, (dwarf::Tag)Tag); - if (N) - insertDIE(N, Die); - return Die; -} - DIE &DwarfUnit::createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N) { - DIE &Die = Parent.addChild(createDIE(Tag, N)); + DIE &Die = Parent.addChild(DIE::get(DIEValueAllocator, (dwarf::Tag)Tag)); + if (N) + insertDIE(N, &Die); return Die; } @@ -730,18 +725,15 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) { // Construct the context before querying for the existence of the DIE in case // such construction creates the DIE. - // For Local Scope, do not construct context DIE. auto *Context = resolve(Ty->getScope()); - bool IsLocalScope = Context && isa<DILocalScope>(Context); - DIE *ContextDIE = IsLocalScope ? nullptr : getOrCreateContextDIE(Context); - assert(ContextDIE || IsLocalScope); + DIE *ContextDIE = getOrCreateContextDIE(Context); + assert(ContextDIE); if (DIE *TyDIE = getDIE(Ty)) return TyDIE; - // Create new type and add to map. - DIE &TyDIE = IsLocalScope ? *createDIE(Ty->getTag(), Ty) - : createAndAddDIE(Ty->getTag(), *ContextDIE, Ty); + // Create new type. + DIE &TyDIE = createAndAddDIE(Ty->getTag(), *ContextDIE, Ty); updateAcceleratorTables(Context, Ty, TyDIE); |