diff options
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r-- | lib/Transforms/IPO/ExtractFunction.cpp | 8 | ||||
-rw-r--r-- | lib/Transforms/IPO/Internalize.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/IPO/MutateStructTypes.cpp | 3 | ||||
-rw-r--r-- | lib/Transforms/IPO/Parallelize.cpp | 3 | ||||
-rw-r--r-- | lib/Transforms/IPO/PoolAllocate.cpp | 3 |
5 files changed, 12 insertions, 9 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 diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp index 910e1d4322..f09fd141c7 100644 --- a/lib/Transforms/IPO/Internalize.cpp +++ b/lib/Transforms/IPO/Internalize.cpp @@ -29,7 +29,7 @@ namespace { if (&*I != MainFunc && // Leave the main function external !I->isExternal() && // Function must be defined here !I->hasInternalLinkage()) { // Can't already have internal linkage - I->setInternalLinkage(true); + I->setLinkage(GlobalValue::InternalLinkage); Changed = true; ++NumFunctions; DEBUG(std::cerr << "Internalizing func " << I->getName() << "\n"); @@ -38,7 +38,7 @@ namespace { // Mark all global variables with initializers as internal as well... for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I) if (!I->isExternal() && I->hasExternalLinkage()) { - I->setInternalLinkage(true); + I->setLinkage(GlobalValue::InternalLinkage); Changed = true; ++NumGlobals; DEBUG(std::cerr << "Internalizing gvar " << I->getName() << "\n"); diff --git a/lib/Transforms/IPO/MutateStructTypes.cpp b/lib/Transforms/IPO/MutateStructTypes.cpp index b7418ec6e3..8e58d4dbb2 100644 --- a/lib/Transforms/IPO/MutateStructTypes.cpp +++ b/lib/Transforms/IPO/MutateStructTypes.cpp @@ -250,8 +250,7 @@ void MutateStructTypes::processGlobals(Module &M) { cast<FunctionType>(ConvertType(I->getFunctionType())); // Create a new function to put stuff into... - Function *NewMeth = new Function(NewMTy, I->hasInternalLinkage(), - I->getName()); + Function *NewMeth = new Function(NewMTy, I->getLinkage(), I->getName()); if (I->hasName()) I->setName("OLD."+I->getName()); diff --git a/lib/Transforms/IPO/Parallelize.cpp b/lib/Transforms/IPO/Parallelize.cpp index 08c800eb1c..46fbcc7d85 100644 --- a/lib/Transforms/IPO/Parallelize.cpp +++ b/lib/Transforms/IPO/Parallelize.cpp @@ -137,7 +137,8 @@ Cilkifier::Cilkifier(Module& M) DummySyncFunc = new Function(FunctionType::get( Type::VoidTy, std::vector<const Type*>(), /*isVararg*/ false), - /*isInternal*/ false, DummySyncFuncName, &M); + GlobalValue::ExternalLinkage, DummySyncFuncName, + &M); } void Cilkifier::TransformFunc(Function* F, diff --git a/lib/Transforms/IPO/PoolAllocate.cpp b/lib/Transforms/IPO/PoolAllocate.cpp index b2efc12de2..844d0c15ff 100644 --- a/lib/Transforms/IPO/PoolAllocate.cpp +++ b/lib/Transforms/IPO/PoolAllocate.cpp @@ -161,7 +161,8 @@ Function *PoolAllocate::MakeFunctionClone(Function &F) { FunctionType *FuncTy = FunctionType::get(OldFuncTy->getReturnType(), ArgTys, OldFuncTy->isVarArg()); // Create the new function... - Function *New = new Function(FuncTy, true, F.getName(), F.getParent()); + Function *New = new Function(FuncTy, GlobalValue::InternalLinkage, + F.getName(), F.getParent()); // Set the rest of the new arguments names to be PDa<n> and add entries to the // pool descriptors map |