diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-10-09 17:08:42 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-10-09 17:08:42 +0000 |
commit | 0fbf8bdb08b837061e16f70c1f8884b2535f6153 (patch) | |
tree | e04d40bf70c5911e92dfadb57edcbbedb6e132e8 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | a09bd0a15aea8eeb17bd9a83002da9ba75292d3c (diff) | |
download | bcm5719-llvm-0fbf8bdb08b837061e16f70c1f8884b2535f6153.tar.gz bcm5719-llvm-0fbf8bdb08b837061e16f70c1f8884b2535f6153.zip |
Sink DwarfDebug::constructLexicalScopeDIE into DwarfCompileUnit
llvm-svn: 219414
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 6a2561387d9..225c2bf2847 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -376,7 +376,7 @@ void DwarfCompileUnit::constructScopeDIE( std::make_move_iterator(Children.end())); return; } - ScopeDIE = DD->constructLexicalScopeDIE(*this, Scope); + ScopeDIE = constructLexicalScopeDIE(Scope); assert(ScopeDIE && "Scope DIE should not be null."); } @@ -461,4 +461,20 @@ DwarfCompileUnit::constructInlinedScopeDIE(LexicalScope *Scope) { return ScopeDIE; } +// Construct new DW_TAG_lexical_block for this scope and attach +// DW_AT_low_pc/DW_AT_high_pc labels. +std::unique_ptr<DIE> +DwarfCompileUnit::constructLexicalScopeDIE(LexicalScope *Scope) { + if (DD->isLexicalScopeDIENull(Scope)) + return nullptr; + + auto ScopeDIE = make_unique<DIE>(dwarf::DW_TAG_lexical_block); + if (Scope->isAbstractScope()) + return ScopeDIE; + + attachRangesOrLowHighPC(*ScopeDIE, Scope->getRanges()); + + return ScopeDIE; +} + } // end llvm namespace |