diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-31 01:28:22 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-31 01:28:22 +0000 |
commit | 94d58f88801833c1d8d1bbc3d3f4244be9e2348d (patch) | |
tree | 7814a3433ac2be78578fca9689edb08a470a9906 /llvm/lib/IR/DebugInfo.cpp | |
parent | 3744fd09d8f453d7442f61f872e333918b3069a1 (diff) | |
download | bcm5719-llvm-94d58f88801833c1d8d1bbc3d3f4244be9e2348d.tar.gz bcm5719-llvm-94d58f88801833c1d8d1bbc3d3f4244be9e2348d.zip |
Verifier: Move more debug info checks away from Verify()
Most of these checks were already in the `Verifier` so this is more of a
cleanup. Now almost everything is over there.
Now that require a `name:` for `MDGlobalVariable`, add a check in
`LLParser` for it.
llvm-svn: 233657
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 4e5b5f1f975..91823773212 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -275,16 +275,6 @@ bool DISubprogram::Verify() const { if (!N) return false; - if (!isScopeRef(N->getScope())) - return false; - - if (auto *Op = N->getType()) - if (!isa<MDNode>(Op)) - return false; - - if (!isTypeRef(getContainingType())) - return false; - if (isLValueReference() && isRValueReference()) return false; @@ -315,38 +305,8 @@ bool DISubprogram::Verify() const { return true; } -bool DIGlobalVariable::Verify() const { - auto *N = dyn_cast_or_null<MDGlobalVariable>(DbgNode); - - if (!N) - return false; - - if (N->getDisplayName().empty()) - return false; - - if (auto *Op = N->getScope()) - if (!isa<MDNode>(Op)) - return false; - - if (auto *Op = N->getStaticDataMemberDeclaration()) - if (!isa<MDNode>(Op)) - return false; - - return isTypeRef(N->getType()); -} - -bool DIVariable::Verify() const { - auto *N = dyn_cast_or_null<MDLocalVariable>(DbgNode); - - if (!N) - return false; - - if (auto *Op = N->getScope()) - if (!isa<MDNode>(Op)) - return false; - - return isTypeRef(N->getType()); -} +bool DIGlobalVariable::Verify() const { return isGlobalVariable(); } +bool DIVariable::Verify() const { return isVariable(); } bool DILocation::Verify() const { return dyn_cast_or_null<MDLocation>(DbgNode); |