summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp9
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index f128308fb6..bff1a35299 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -609,16 +609,17 @@ void CompileUnit::addType(DIE *Entity, DIType Ty) {
// If this is a complete composite type then include it in the
// list of global types.
- addGlobalType(Ty, Entry->getEntry());
+ addGlobalType(Ty);
}
/// addGlobalType - Add a new global type to the compile unit.
///
-void CompileUnit::addGlobalType(DIType Ty, DIE *Die) {
+void CompileUnit::addGlobalType(DIType Ty) {
DIDescriptor Context = Ty.getContext();
if (Ty.isCompositeType() && !Ty.getName().empty() && !Ty.isForwardDecl()
&& (Context.isCompileUnit() || Context.isFile() || Context.isNameSpace()))
- GlobalTypes[Ty.getName()] = Die;
+ if (DIEEntry *Entry = getDIEEntry(Ty))
+ GlobalTypes[Ty.getName()] = Entry->getEntry();
}
/// addPubTypes - Add type for pubtypes section.
@@ -633,7 +634,7 @@ void CompileUnit::addPubTypes(DISubprogram SP) {
DIType ATy(Args.getElement(i));
if (!ATy.Verify())
continue;
- addGlobalType(ATy, getDIEEntry(ATy)->getEntry());
+ addGlobalType(ATy);
}
}
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index 3cfbd73ef8..60a9b2872b 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -87,7 +87,7 @@ public:
/// addGlobalType - Add a new global type to the compile unit.
///
- void addGlobalType(DIType Ty, DIE *Die);
+ void addGlobalType(DIType Ty);
/// getDIE - Returns the debug information entry map slot for the
/// specified debug variable.