Add DINameSpace::Verify().
authorDevang Patel <dpatel@apple.com>
Fri, 7 May 2010 23:04:32 +0000 (23:04 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 7 May 2010 23:04:32 +0000 (23:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103318 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DebugInfo.h
lib/Analysis/DebugInfo.cpp

index 0ba0c5a33eee92d08e734b53fdfa8d85f5dcc893..af4b5f7f144f447ebbdbfe4e2809ae86cb114787 100644 (file)
@@ -541,6 +541,7 @@ namespace llvm {
       return F.getCompileUnit();
     }
     unsigned getLineNumber() const { return getUnsignedField(4);         }
+    bool Verify() const;
   };
 
   /// DILocation - This object holds location information. This object
index 56c9b2102221fbfe15ae849b518d8060dfb434f6..7bbae59b87a81e07b2e1e4bcc32a7d9b820f4b44 100644 (file)
@@ -350,6 +350,17 @@ bool DILocation::Verify() const {
   return DbgNode->getNumOperands() == 4;
 }
 
+/// Verify - Verify that a namespace descriptor is well formed.
+bool DINameSpace::Verify() const {
+  if (!DbgNode)
+    return false;
+  if (getName().empty())
+    return false;
+  if (!getCompileUnit().Verify())
+    return false;
+  return true;
+}
+
 /// getOriginalTypeSize - If this type is derived from a base type then
 /// return base type size.
 uint64_t DIDerivedType::getOriginalTypeSize() const {