diff options
author | Manman Ren <manman.ren@gmail.com> | 2013-07-23 18:14:25 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2013-07-23 18:14:25 +0000 |
commit | 9fd6178dec9531fd44420e2bd121a36a1b9781fc (patch) | |
tree | 8dee75b00cc80f24ccb8eb8f8944399adafecd74 /lib/IR/DebugInfo.cpp | |
parent | 71dc2e6f45a5b00dec24a26ab2864690cbba5ea4 (diff) | |
download | llvm-9fd6178dec9531fd44420e2bd121a36a1b9781fc.tar.gz llvm-9fd6178dec9531fd44420e2bd121a36a1b9781fc.tar.bz2 llvm-9fd6178dec9531fd44420e2bd121a36a1b9781fc.tar.xz |
DebugInfo Verifier: verify the actual type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186972 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/DebugInfo.cpp')
-rw-r--r-- | lib/IR/DebugInfo.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 9d88ce0e50..28b703f647 100644 --- a/lib/IR/DebugInfo.cpp +++ b/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; } |