Debug Info: In DIBuilder, the context field of a global variable is updated to

use DIScopeRef.

A paired commit at clang will follow to show cases where we will use an
identifer for the context of a global variable.

rdar://18958417


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222195 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Manman Ren
2014-11-18 00:29:08 +00:00
parent 66a2b0564e
commit b05098b884
5 changed files with 161 additions and 7 deletions

View File

@ -103,7 +103,7 @@ DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(DIGlobalVariable GV) {
assert(GV.isGlobalVariable());
DIScope GVContext = GV.getContext();
DIScope GVContext = DD->resolve(GV.getContext());
DIType GTy = DD->resolve(GV.getType());
// Construct the context before querying for the existence of the DIE in
@ -122,7 +122,7 @@ DIE *DwarfCompileUnit::getOrCreateGlobalVariableDIE(DIGlobalVariable GV) {
DIE *VariableSpecDIE = getOrCreateStaticMemberDIE(SDMDecl);
addDIEEntry(*VariableDIE, dwarf::DW_AT_specification, *VariableSpecDIE);
} else {
DeclContext = GV.getContext();
DeclContext = resolve(GV.getContext());
// Add name and type.
addString(*VariableDIE, dwarf::DW_AT_name, GV.getDisplayName());
addType(*VariableDIE, GTy);