aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-23 18:36:25 +0000
committerChris Lattner <sabre@nondot.org>2002-05-23 18:36:25 +0000
commit6a1359229df442842e9015dc6387a9114df83b4a (patch)
treeb83b9870469101ed4c4777da877ca360e176872c /tools
parent1ab854aa1e21c308c05597ead78bb4dce84a7462 (diff)
downloadexternal_llvm-6a1359229df442842e9015dc6387a9114df83b4a.zip
external_llvm-6a1359229df442842e9015dc6387a9114df83b4a.tar.gz
external_llvm-6a1359229df442842e9015dc6387a9114df83b4a.tar.bz2
Make sure the extracted function has external linkage, so that it doesn't
get eliminated by globaldce! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2736 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/extract/extract.cpp3
-rw-r--r--tools/llvm-extract/llvm-extract.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/tools/extract/extract.cpp b/tools/extract/extract.cpp
index 7a6a1c1..a78d1fd 100644
--- a/tools/extract/extract.cpp
+++ b/tools/extract/extract.cpp
@@ -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();
diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp
index 7a6a1c1..a78d1fd 100644
--- a/tools/llvm-extract/llvm-extract.cpp
+++ b/tools/llvm-extract/llvm-extract.cpp
@@ -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();