diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-03-21 23:01:03 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-03-21 23:01:03 +0000 |
commit | d254ab229820f1e6a98b44329974acb968a761b7 (patch) | |
tree | dd5a0028b42ead45d24e92582d2f8e2ab673ab5a /llvm/lib/IR | |
parent | 0d7d62e4b244d185cb84c9a3a6c8cab06c0973b4 (diff) | |
download | bcm5719-llvm-d254ab229820f1e6a98b44329974acb968a761b7.tar.gz bcm5719-llvm-d254ab229820f1e6a98b44329974acb968a761b7.zip |
Add a query to tell if a landing pad has a catch-all.
llvm-svn: 177675
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index d58877ef773..841cc5926a9 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -256,6 +256,13 @@ void LandingPadInst::addClause(Value *Val) { OperandList[OpNo] = Val; } +bool LandingPadInst::hasCatchAll() const { + for (unsigned I = 0, E = getNumClauses(); I != E; ++I) + if (isCatch(I) && isa<ConstantPointerNull>(getClause(I))) + return true; + return false; +} + //===----------------------------------------------------------------------===// // CallInst Implementation //===----------------------------------------------------------------------===// |