aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/ExtractFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-16 20:28:45 +0000
committerChris Lattner <sabre@nondot.org>2003-04-16 20:28:45 +0000
commit4ad02e726d9b634372b037d4b352d8b63bb9e849 (patch)
tree463f4e5e0773c2c8ca3e891556fc0a36c83e3ab5 /lib/Transforms/IPO/ExtractFunction.cpp
parent2c72b184b86152d4c9e00731d9257240f39ce20b (diff)
Add new linkage types to support a real frontend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/ExtractFunction.cpp')
-rw-r--r--lib/Transforms/IPO/ExtractFunction.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/ExtractFunction.cpp b/lib/Transforms/IPO/ExtractFunction.cpp
index a2d28f58c6..f16c3f3253 100644
--- a/lib/Transforms/IPO/ExtractFunction.cpp
+++ b/lib/Transforms/IPO/ExtractFunction.cpp
@@ -16,13 +16,13 @@ namespace {
}
// Make sure our result is globally accessable...
- Named->setInternalLinkage(false);
+ Named->setLinkage(GlobalValue::ExternalLinkage);
// Mark all global variables internal
for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
if (!I->isExternal()) {
I->setInitializer(0); // Make all variables external
- I->setInternalLinkage(false); // Make sure it's not internal
+ I->setLinkage(GlobalValue::ExternalLinkage);
}
// All of the functions may be used by global variables or the named
@@ -35,7 +35,9 @@ namespace {
for (Module::iterator I = M.begin(); ; ++I) {
if (&*I != Named) {
- Function *New = new Function(I->getFunctionType(),false,I->getName());
+ Function *New = new Function(I->getFunctionType(),
+ GlobalValue::ExternalLinkage,
+ I->getName());
I->setName(""); // Remove Old name
// If it's not the named function, delete the body of the function