Make sure the extracted function has external linkage, so that it doesn't
get eliminated by globaldce!
llvm-svn: 2736
diff --git a/llvm/tools/extract/extract.cpp b/llvm/tools/extract/extract.cpp
index 7a6a1c1..a78d1fd 100644
--- a/llvm/tools/extract/extract.cpp
+++ b/llvm/tools/extract/extract.cpp
@@ -39,6 +39,9 @@
// Yes, it is. Keep track of it...
Named = *I;
+ // Make sure it's globally accessable...
+ Named->setInternalLinkage(false);
+
// Remove the named function from the module.
M->getFunctionList().remove(I);
E = M->end();