summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-07-23 18:14:25 +0000
committerManman Ren <manman.ren@gmail.com>2013-07-23 18:14:25 +0000
commitfc8b32455d5879202d5ce2e6f6a9014f0be7b2e7 (patch)
treec5a339c53ae3c1177e6017cc389bade865888f35 /llvm
parent79b45389c3cd2f1ab0904b636f8451849038cddf (diff)
downloadbcm5719-llvm-fc8b32455d5879202d5ce2e6f6a9014f0be7b2e7.tar.gz
bcm5719-llvm-fc8b32455d5879202d5ce2e6f6a9014f0be7b2e7.zip
DebugInfo Verifier: verify the actual type.
llvm-svn: 186972
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 9d88ce0e50b..28b703f6473 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -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;
}
OpenPOWER on IntegriCloud