summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-01 16:53:46 +0000
committerChris Lattner <sabre@nondot.org>2003-09-01 16:53:46 +0000
commit267f20475bcf26af7da88c2e1cf82dc4cb69f054 (patch)
tree43a7a4a22f8a51e87c7e963aa58bc1effdb43c61 /llvm/lib
parent5b8addab9bf8d22e1734df67d39670ca6ea5c80b (diff)
downloadbcm5719-llvm-267f20475bcf26af7da88c2e1cf82dc4cb69f054.tar.gz
bcm5719-llvm-267f20475bcf26af7da88c2e1cf82dc4cb69f054.zip
Not only is this a lot smaller, it actually works if there is already a
function with the right name in the module. llvm-svn: 8290
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/Parallelize.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/Parallelize.cpp b/llvm/lib/Transforms/IPO/Parallelize.cpp
index 562a263e29a..e7838674029 100644
--- a/llvm/lib/Transforms/IPO/Parallelize.cpp
+++ b/llvm/lib/Transforms/IPO/Parallelize.cpp
@@ -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,
OpenPOWER on IntegriCloud