diff options
author | Manman Ren <mren@apple.com> | 2013-06-28 05:43:10 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2013-06-28 05:43:10 +0000 |
commit | cbafae6d33031a72ba8219c28cb0e852511f79a3 (patch) | |
tree | 3b8b95912dc89368c64583771df01b53557e4a09 /tools/opt/opt.cpp | |
parent | c084c0945b0530180e8969f5e2017d02d06db130 (diff) | |
download | llvm-cbafae6d33031a72ba8219c28cb0e852511f79a3.tar.gz llvm-cbafae6d33031a72ba8219c28cb0e852511f79a3.tar.bz2 llvm-cbafae6d33031a72ba8219c28cb0e852511f79a3.tar.xz |
Debug Info: clean up usage of Verify.
No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify. For cases where we know the type of a DI metadata, use
assert.
Also update testing cases to make them conform to the format of DI classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185135 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r-- | tools/opt/opt.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index f642a78fc0..6fc8d6759b 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -389,8 +389,11 @@ struct BreakpointPrinter : public ModulePass { for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) { std::string Name; DISubprogram SP(NMD->getOperand(i)); - if (SP.Verify()) - getContextName(SP.getContext(), Name); + assert((!SP || SP.isSubprogram()) && + "A MDNode in llvm.dbg.sp should be null or a DISubprogram."); + if (!SP) + continue; + getContextName(SP.getContext(), Name); Name = Name + SP.getDisplayName().str(); if (!Name.empty() && Processed.insert(Name)) { Out << Name << "\n"; |