aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-09 17:51:49 +0000
committerDevang Patel <dpatel@apple.com>2009-10-09 17:51:49 +0000
commitc525472828823b47c8aa90b901f61d5236de890a (patch)
tree508d8cd0e76c7f0c8489ceb251544787a7053598 /lib/CodeGen
parent71c8dc9b20536e89afdae1b82075806761a57c89 (diff)
downloadexternal_llvm-c525472828823b47c8aa90b901f61d5236de890a.zip
external_llvm-c525472828823b47c8aa90b901f61d5236de890a.tar.gz
external_llvm-c525472828823b47c8aa90b901f61d5236de890a.tar.bz2
Check invalid debug info for enums. This may happen when underlyng enum is optimized away. Eventually DwarfChecker will clean this up during llvm verification stage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 1ea148e..86532e8 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -950,8 +950,10 @@ void DwarfDebug::ConstructTypeDIE(CompileUnit *DW_Unit, DIE &Buffer,
for (unsigned i = 0, N = Elements.getNumElements(); i < N; ++i) {
DIE *ElemDie = NULL;
DIEnumerator Enum(Elements.getElement(i).getNode());
- ElemDie = ConstructEnumTypeDIE(DW_Unit, &Enum);
- Buffer.AddChild(ElemDie);
+ if (!Enum.isNull()) {
+ ElemDie = ConstructEnumTypeDIE(DW_Unit, &Enum);
+ Buffer.AddChild(ElemDie);
+ }
}
}
break;