Make sure the extracted function has external linkage, so that it doesn't
authorChris Lattner <sabre@nondot.org>
Thu, 23 May 2002 18:36:25 +0000 (18:36 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 23 May 2002 18:36:25 +0000 (18:36 +0000)
get eliminated by globaldce!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2736 91177308-0d34-0410-b5e6-96231b3b80d8

tools/extract/extract.cpp
tools/llvm-extract/llvm-extract.cpp

index 7a6a1c101ecaa6d93d2f57f3181893a8d65cc194..a78d1fd9b994dcec878d5959f8087ad7a7a68aab 100644 (file)
@@ -39,6 +39,9 @@ struct FunctionExtractorPass : public Pass {
         // 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();
index 7a6a1c101ecaa6d93d2f57f3181893a8d65cc194..a78d1fd9b994dcec878d5959f8087ad7a7a68aab 100644 (file)
@@ -39,6 +39,9 @@ struct FunctionExtractorPass : public Pass {
         // 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();