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.

llvm-svn: 83655
This commit is contained in:
Devang Patel 2009-10-09 17:51:49 +00:00
parent 26070c5cff
commit fafa1fe2ad
1 changed files with 4 additions and 2 deletions

View File

@ -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;