diff options
| author | Devang Patel <dpatel@apple.com> | 2010-05-07 23:04:32 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2010-05-07 23:04:32 +0000 |
| commit | 54c59312b105f9f4a738382a82279853a8e257af (patch) | |
| tree | e5e16cf360de085d7d55ae7a060ed4a03cb855b5 | |
| parent | 32d8981ec02dca87584fb48a6804b089b971a84e (diff) | |
| download | bcm5719-llvm-54c59312b105f9f4a738382a82279853a8e257af.tar.gz bcm5719-llvm-54c59312b105f9f4a738382a82279853a8e257af.zip | |
Add DINameSpace::Verify().
llvm-svn: 103318
| -rw-r--r-- | llvm/include/llvm/Analysis/DebugInfo.h | 1 | ||||
| -rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/DebugInfo.h b/llvm/include/llvm/Analysis/DebugInfo.h index 0ba0c5a33ee..af4b5f7f144 100644 --- a/llvm/include/llvm/Analysis/DebugInfo.h +++ b/llvm/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/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 56c9b210222..7bbae59b87a 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/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 { |

