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
This commit is contained in:
Chris Lattner 2002-05-23 18:36:25 +00:00
parent 1ab854aa1e
commit 6a1359229d
2 changed files with 6 additions and 0 deletions

View 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();

View 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();