summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-06-01 00:23:24 +0000
committerDevang Patel <dpatel@apple.com>2011-06-01 00:23:24 +0000
commit562c74284fc498763991da32cff510cfd13a6240 (patch)
tree3dbbd7cda86f45d8c7d8396a57ca80acd92f7e38 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent6fad7119b928c179e3112e31c64fea2eef5fecd2 (diff)
downloadbcm5719-llvm-562c74284fc498763991da32cff510cfd13a6240.tar.gz
bcm5719-llvm-562c74284fc498763991da32cff510cfd13a6240.zip
Incomplete type may not have corresponding DIE, so do not check DIEEntry eagerly.
llvm-svn: 132377
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index f128308fb6d..bff1a352998 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/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);
}
}
OpenPOWER on IntegriCloud