mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190362 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -785,6 +785,29 @@ Value *DITemplateValueParameter::getValue() const {
|
||||
return getField(DbgNode, 4);
|
||||
}
|
||||
|
||||
// If the current node has a parent scope then return that,
|
||||
// else return an empty scope.
|
||||
DIScopeRef DIScope::getContext() const {
|
||||
|
||||
if (isType())
|
||||
return DIType(DbgNode).getContext();
|
||||
|
||||
if (isSubprogram())
|
||||
return DIScopeRef(DISubprogram(DbgNode).getContext());
|
||||
|
||||
if (isLexicalBlock())
|
||||
return DIScopeRef(DILexicalBlock(DbgNode).getContext());
|
||||
|
||||
if (isLexicalBlockFile())
|
||||
return DIScopeRef(DILexicalBlockFile(DbgNode).getContext());
|
||||
|
||||
if (isNameSpace())
|
||||
return DIScopeRef(DINameSpace(DbgNode).getContext());
|
||||
|
||||
assert((isFile() || isCompileUnit()) && "Unhandled type of scope.");
|
||||
return DIScopeRef(NULL);
|
||||
}
|
||||
|
||||
StringRef DIScope::getFilename() const {
|
||||
if (!DbgNode)
|
||||
return StringRef();
|
||||
|
||||
Reference in New Issue
Block a user