From 554865da5b605d975884f8dbfbc723f972ebfc82 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Tue, 18 Nov 2014 00:29:08 +0000 Subject: 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 llvm-svn: 222195 --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index a8f867a16c8..4dc1224c4a4 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -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); -- cgit v1.2.3