Not only is this a lot smaller, it actually works if there is already a
[oota-llvm.git] / lib / Transforms / IPO / Parallelize.cpp
index 562a263e29aee3ad254df9987c978aaf5594a102..e78386740290ca97e5e9e025f0fc20609be9b071 100644 (file)
@@ -158,11 +158,7 @@ public:
 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,