diff options
-rw-r--r-- | include/llvm/Analysis/DebugInfo.h | 1 | ||||
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index 0ba0c5a33e..af4b5f7f14 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/include/llvm/Analysis/DebugInfo.h @@ -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 diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 56c9b21022..7bbae59b87 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -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 { |