[llvm] r186972 - DebugInfo Verifier: verify the actual type.

Manman Ren manman.ren at gmail.com
Tue Jul 23 11:14:25 PDT 2013


Author: mren
Date: Tue Jul 23 13:14:25 2013
New Revision: 186972

URL: http://llvm.org/viewvc/llvm-project?rev=186972&view=rev
Log:
DebugInfo Verifier: verify the actual type.

Modified:
    llvm/trunk/lib/IR/DebugInfo.cpp

Modified: llvm/trunk/lib/IR/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=186972&r1=186971&r2=186972&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfo.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfo.cpp Tue Jul 23 13:14:25 2013
@@ -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;
 }
 





More information about the llvm-commits mailing list