diff options
author | Eric Christopher <echristo@gmail.com> | 2013-08-08 07:40:37 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-08-08 07:40:37 +0000 |
commit | 0df08e2ff91200a1fff3a1b6be0be9e592b22b41 (patch) | |
tree | b571c73cb5920711c801a129c6c1cdaa3193f7f2 /llvm/lib/IR/DebugInfo.cpp | |
parent | afb2c4114ea92b7f50c8f5f69fe3c85a2c7d773b (diff) | |
download | bcm5719-llvm-0df08e2ff91200a1fff3a1b6be0be9e592b22b41.tar.gz bcm5719-llvm-0df08e2ff91200a1fff3a1b6be0be9e592b22b41.zip |
Make sure that if we're going to attempt to add a type to a DIE that
the type exists.
Fix up cases where we weren't checking for optional types and add
an assert to addType to make sure we catch this in the future.
Fix up a testcase that was using the tag for DW_TAG_array_type
when it meant DW_TAG_enumeration_type.
llvm-svn: 187963
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index a6f1c3413e0..fc9324949d0 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -483,6 +483,12 @@ bool DICompositeType::Verify() const { if (!fieldIsMDNode(DbgNode, 12)) return false; + // If this is an array type verify that we have a DIType in the derived type + // field as that's the type of our element. + if (getTag() == dwarf::DW_TAG_array_type) + if (!DIType(getTypeDerivedFrom())) + return false; + return DbgNode->getNumOperands() >= 10 && DbgNode->getNumOperands() <= 14; } |