API changes for class Use size reduction, wave 1.
[oota-llvm.git] / lib / Transforms / Utils / CloneModule.cpp
index f0ee1e2ae0d17f32084dcdc443f3aace209263b8..e75f915cb9ef5cf1d20e324c6d705d5c023a57c8 100644 (file)
@@ -63,8 +63,8 @@ Module *llvm::CloneModule(const Module *M,
   // Loop over the functions in the module, making external functions as before
   for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) {
     Function *NF =
-      new Function(cast<FunctionType>(I->getType()->getElementType()),
-                   GlobalValue::ExternalLinkage, I->getName(), New);
+      Function::Create(cast<FunctionType>(I->getType()->getElementType()),
+                       GlobalValue::ExternalLinkage, I->getName(), New);
     NF->setCallingConv(I->getCallingConv());
     NF->setParamAttrs(I->getParamAttrs());
     if (I->hasCollector())