[llvm-commits] CVS: llvm/lib/Transforms/IPO/ExtractFunction.cpp Internalize.cpp MutateStructTypes.cpp Parallelize.cpp PoolAllocate.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Apr 16 15:29:01 PDT 2003


Changes in directory llvm/lib/Transforms/IPO:

ExtractFunction.cpp updated: 1.1 -> 1.2
Internalize.cpp updated: 1.12 -> 1.13
MutateStructTypes.cpp updated: 1.34 -> 1.35
Parallelize.cpp updated: 1.1 -> 1.2
PoolAllocate.cpp updated: 1.4 -> 1.5

---
Log message:

Add new linkage types to support a real frontend



---
Diffs of the changes:

Index: llvm/lib/Transforms/IPO/ExtractFunction.cpp
diff -u llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.1 llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.2
--- llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.1	Tue Nov 19 12:42:55 2002
+++ llvm/lib/Transforms/IPO/ExtractFunction.cpp	Wed Apr 16 15:28:39 2003
@@ -16,13 +16,13 @@
       }
 
       // 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 @@
       
       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


Index: llvm/lib/Transforms/IPO/Internalize.cpp
diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.12 llvm/lib/Transforms/IPO/Internalize.cpp:1.13
--- llvm/lib/Transforms/IPO/Internalize.cpp:1.12	Fri Nov  8 14:34:21 2002
+++ llvm/lib/Transforms/IPO/Internalize.cpp	Wed Apr 16 15:28:39 2003
@@ -29,7 +29,7 @@
         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 @@
       // 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");


Index: llvm/lib/Transforms/IPO/MutateStructTypes.cpp
diff -u llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.34 llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.35
--- llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.34	Wed Nov 20 13:32:43 2002
+++ llvm/lib/Transforms/IPO/MutateStructTypes.cpp	Wed Apr 16 15:28:39 2003
@@ -250,8 +250,7 @@
         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());
 


Index: llvm/lib/Transforms/IPO/Parallelize.cpp
diff -u llvm/lib/Transforms/IPO/Parallelize.cpp:1.1 llvm/lib/Transforms/IPO/Parallelize.cpp:1.2
--- llvm/lib/Transforms/IPO/Parallelize.cpp:1.1	Mon Dec  9 18:43:34 2002
+++ llvm/lib/Transforms/IPO/Parallelize.cpp	Wed Apr 16 15:28:39 2003
@@ -137,7 +137,8 @@
   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,


Index: llvm/lib/Transforms/IPO/PoolAllocate.cpp
diff -u llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.4 llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.5
--- llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.4	Thu Feb  6 16:03:46 2003
+++ llvm/lib/Transforms/IPO/PoolAllocate.cpp	Wed Apr 16 15:28:39 2003
@@ -161,7 +161,8 @@
   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





More information about the llvm-commits mailing list