[PATCH] D60231: Include invoke'd functions for recursive extract

David Callahan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 4 16:29:14 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL357735: Include invoke'd functions for recursive extract (authored by david2050, committed by ).

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60231/new/

https://reviews.llvm.org/D60231

Files:
  llvm/trunk/test/tools/llvm-extract/recursive.ll
  llvm/trunk/tools/llvm-extract/llvm-extract.cpp


Index: llvm/trunk/tools/llvm-extract/llvm-extract.cpp
===================================================================
--- llvm/trunk/tools/llvm-extract/llvm-extract.cpp
+++ llvm/trunk/tools/llvm-extract/llvm-extract.cpp
@@ -270,10 +270,10 @@
       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))
Index: llvm/trunk/test/tools/llvm-extract/recursive.ll
===================================================================
--- llvm/trunk/test/tools/llvm-extract/recursive.ll
+++ llvm/trunk/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 @@
   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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60231.193806.patch
Type: text/x-patch
Size: 1524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190404/3ee36f34/attachment.bin>


More information about the llvm-commits mailing list