aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-09-09 19:47:11 +0000
committerManman Ren <manman.ren@gmail.com>2013-09-09 19:47:11 +0000
commit2c9905a1f3bcf22cc2f93332cc8411d11798ba07 (patch)
treecd46f1895d551822957384c349a4889109610933 /lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent0b67c2127eb3b26b53ccdb925c87aad6ae19819d (diff)
downloadexternal_llvm-2c9905a1f3bcf22cc2f93332cc8411d11798ba07.tar.gz
external_llvm-2c9905a1f3bcf22cc2f93332cc8411d11798ba07.tar.bz2
external_llvm-2c9905a1f3bcf22cc2f93332cc8411d11798ba07.zip
Debug Info: Use DIScopeRef for DIType::getContext.
In DIBuilder, the context field of a TAG_member is updated to use the scope reference. Verifier is updated accordingly. DebugInfoFinder now needs to generate a type identifier map to have access to the actual scope. Same applies for BreakpointPrinter. processModule of DebugInfoFinder is called during initialization phase of the verifier to make sure the type identifier map is constructed early enough. We are now able to unique a simple class as demonstrated by the added testing case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190334 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index f9ce591833..1a527f24fc 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -800,7 +800,7 @@ DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
addAccelType(Ty.getName(), std::make_pair(TyDIE, Flags));
}
- addToContextOwner(TyDIE, Ty.getContext());
+ addToContextOwner(TyDIE, DD->resolve(Ty.getContext()));
return TyDIE;
}
@@ -832,7 +832,7 @@ void CompileUnit::addType(DIE *Entity, DIType Ty, uint16_t Attribute) {
/// addGlobalType - Add a new global type to the compile unit.
///
void CompileUnit::addGlobalType(DIType Ty) {
- DIDescriptor Context = Ty.getContext();
+ DIDescriptor Context = DD->resolve(Ty.getContext());
if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl()
&& (!Context || Context.isCompileUnit() || Context.isFile()
|| Context.isNameSpace()))
@@ -914,7 +914,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DIDerivedType DTy) {
/// Return true if the type is appropriately scoped to be contained inside
/// its own type unit.
static bool isTypeUnitScoped(DIType Ty, const DwarfDebug *DD) {
- DIScope Parent = Ty.getContext();
+ DIScope Parent = DD->resolve(Ty.getContext());
while (Parent) {
// Don't generate a hash for anything scoped inside a function.
if (Parent.isSubprogram())
@@ -1088,7 +1088,7 @@ void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
addDIEEntry(&Buffer, dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
getOrCreateTypeDIE(DIType(ContainingType)));
else
- addToContextOwner(&Buffer, CTy.getContext());
+ addToContextOwner(&Buffer, DD->resolve(CTy.getContext()));
if (CTy.isObjcClassComplete())
addFlag(&Buffer, dwarf::DW_AT_APPLE_objc_complete_type);
@@ -1373,7 +1373,7 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
// We need the declaration DIE that is in the static member's class.
// But that class might not exist in the DWARF yet.
// Creating the class will create the static member decl DIE.
- getOrCreateContextDIE(SDMDecl.getContext());
+ getOrCreateContextDIE(DD->resolve(SDMDecl.getContext()));
VariableDIE = getDIE(SDMDecl);
assert(VariableDIE && "Static member decl has no context?");
IsStaticMember = true;