diff options
-rw-r--r-- | llvm/test/tools/llvm-extract/recursive.ll | 8 | ||||
-rw-r--r-- | llvm/tools/llvm-extract/llvm-extract.cpp | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/llvm/test/tools/llvm-extract/recursive.ll b/llvm/test/tools/llvm-extract/recursive.ll index 54813dba796..7fa9eceba91 100644 --- a/llvm/test/tools/llvm-extract/recursive.ll +++ b/llvm/test/tools/llvm-extract/recursive.ll @@ -1,6 +1,7 @@ ; RUN: llvm-extract -func=a --recursive %s -S | FileCheck --check-prefix=CHECK-AB %s ; RUN: llvm-extract -func=a --recursive --delete %s -S | FileCheck --check-prefix=CHECK-CD %s ; RUN: llvm-extract -func=d --recursive %s -S | FileCheck --check-prefix=CHECK-CD %s +; RUN: llvm-extract -func=e --recursive %s -S | FileCheck --check-prefix=CHECK-CD %s ; CHECK-AB: define void @a ; CHECK-AB: define void @b @@ -30,3 +31,10 @@ define void @d() { call void @c() ret void } + +define void @e() { + invoke void @c() + to label %L unwind label %L +L: + ret void +}
\ No newline at end of file diff --git a/llvm/tools/llvm-extract/llvm-extract.cpp b/llvm/tools/llvm-extract/llvm-extract.cpp index 30c89a87439..64674729bf4 100644 --- a/llvm/tools/llvm-extract/llvm-extract.cpp +++ b/llvm/tools/llvm-extract/llvm-extract.cpp @@ -270,10 +270,10 @@ int main(int argc, char **argv) { ExitOnErr(F->materialize()); for (auto &BB : *F) { for (auto &I : BB) { - auto *CI = dyn_cast<CallInst>(&I); - if (!CI) + CallBase *CB = dyn_cast<CallBase>(&I); + if (!CB) continue; - Function *CF = CI->getCalledFunction(); + Function *CF = CB->getCalledFunction(); if (!CF) continue; if (CF->isDeclaration() || GVs.count(CF)) |