[llvm-commits] CVS: llvm/lib/Transforms/IPO/Parallelize.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Sep 1 11:54:01 PDT 2003


Changes in directory llvm/lib/Transforms/IPO:

Parallelize.cpp updated: 1.6 -> 1.7

---
Log message:

Not only is this a lot smaller, it actually works if there is already a 
function with the right name in the module.


---
Diffs of the changes:

Index: llvm/lib/Transforms/IPO/Parallelize.cpp
diff -u llvm/lib/Transforms/IPO/Parallelize.cpp:1.6 llvm/lib/Transforms/IPO/Parallelize.cpp:1.7
--- llvm/lib/Transforms/IPO/Parallelize.cpp:1.6	Mon Sep  1 11:49:38 2003
+++ llvm/lib/Transforms/IPO/Parallelize.cpp	Mon Sep  1 11:53:46 2003
@@ -158,11 +158,7 @@
 Cilkifier::Cilkifier(Module& M)
 {
   // create the dummy Sync function and add it to the Module
-  DummySyncFunc = new Function(FunctionType::get( Type::VoidTy,
-                                                 std::vector<const Type*>(),
-                                                 /*isVararg*/ false),
-                               GlobalValue::ExternalLinkage, DummySyncFuncName,
-                               &M);
+  DummySyncFunc = M.getOrInsertFunction(DummySyncFuncName, Type::VoidTy, 0);
 }
 
 void Cilkifier::TransformFunc(Function* F,





More information about the llvm-commits mailing list