diff options
author | Manman Ren <manman.ren@gmail.com> | 2013-09-09 22:35:23 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2013-09-09 22:35:23 +0000 |
commit | de897a369a8f4f2626c39db4b7f8dc3736a3bf09 (patch) | |
tree | 3dd5010b3972d6120fbc30e6ebe8258d82460064 /llvm/lib/CodeGen | |
parent | fff258976de026b9b6b98340ca0950fc9d9c23bb (diff) | |
download | bcm5719-llvm-de897a369a8f4f2626c39db4b7f8dc3736a3bf09.tar.gz bcm5719-llvm-de897a369a8f4f2626c39db4b7f8dc3736a3bf09.zip |
Debug Info: move DIScope::getContext back from DwarfDebug.
This partially reverts r190330. DIScope::getContext now returns DIScopeRef
instead of DIScope. We construct a DIScopeRef from DIScope when we are
dealing with subprogram, lexical block or name space.
llvm-svn: 190362
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 23 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 3 |
3 files changed, 1 insertions, 27 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 1a527f24fc6..4893c25c098 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -919,7 +919,7 @@ static bool isTypeUnitScoped(DIType Ty, const DwarfDebug *DD) { // Don't generate a hash for anything scoped inside a function. if (Parent.isSubprogram()) return false; - Parent = DD->getScopeContext(Parent); + Parent = DD->resolve(Parent.getContext()); } return true; } diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 79bb8849e23..7db6df0e19a 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2649,26 +2649,3 @@ void DwarfDebug::emitDebugStrDWO() { DIScope DwarfDebug::resolve(DIScopeRef SRef) const { return SRef.resolve(TypeIdentifierMap); } - -// If the current node has a parent scope then return that, -// else return an empty scope. -DIScope DwarfDebug::getScopeContext(DIScope S) const { - - if (S.isType()) - return resolve(DIType(S).getContext()); - - if (S.isSubprogram()) - return DISubprogram(S).getContext(); - - if (S.isLexicalBlock()) - return DILexicalBlock(S).getContext(); - - if (S.isLexicalBlockFile()) - return DILexicalBlockFile(S).getContext(); - - if (S.isNameSpace()) - return DINameSpace(S).getContext(); - - assert((S.isFile() || S.isCompileUnit()) && "Unhandled type of scope."); - return DIScope(); -} diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index c18fe37ccb5..e026c668135 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -690,9 +690,6 @@ public: /// or another context nested inside a subprogram. bool isSubprogramContext(const MDNode *Context); - /// Gets the parent scope for this scope node or returns a - /// default constructed scope. - DIScope getScopeContext(DIScope S) const; }; } // End of namespace llvm |