From 8233050895f781befc1d4165435d0fff605b6b70 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 21 Mar 2013 23:01:03 +0000 Subject: Add a query to tell if a landing pad has a catch-all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177675 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Instructions.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/IR/Instructions.cpp') diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp index d58877ef77..841cc5926a 100644 --- a/lib/IR/Instructions.cpp +++ b/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(getClause(I))) + return true; + return false; +} + //===----------------------------------------------------------------------===// // CallInst Implementation //===----------------------------------------------------------------------===// -- cgit v1.2.3