DebugInfo Verifier: verify the actual type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186972 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Manman Ren 2013-07-23 18:14:25 +00:00
parent 71dc2e6f45
commit 9fd6178dec

View File

@ -458,6 +458,16 @@ bool DIType::Verify() const {
Tag != dwarf::DW_TAG_friend &&
getFilename().empty())
return false;
// DIType is abstract, it should be a BasicType, a DerivedType or
// a CompositeType.
if (isBasicType())
DIBasicType(DbgNode).Verify();
else if (isCompositeType())
DICompositeType(DbgNode).Verify();
else if (isDerivedType())
DIDerivedType(DbgNode).Verify();
else
return false;
return true;
}