X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FVMCore%2FModule.cpp;h=429cf1a4c69508066e17a9f8569a22ce7a21871e;hb=051a950000e21935165db56695e35bade668193b;hp=864ec04654583e181fa635d64e8ca2e4535a49e7;hpb=d963ab1f58adb6daa028533ff3285841d7e45f80;p=oota-llvm.git diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 864ec046545..429cf1a4c69 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -32,7 +32,7 @@ using namespace llvm; Function *ilist_traits::createSentinel() { FunctionType *FTy = FunctionType::get(Type::VoidTy, std::vector(), false); - Function *Ret = new Function(FTy, GlobalValue::ExternalLinkage); + Function *Ret = Function::Create(FTy, GlobalValue::ExternalLinkage); // This should not be garbage monitored. LeakDetector::removeGarbageObject(Ret); return Ret; @@ -149,7 +149,7 @@ Constant *Module::getOrInsertFunction(const std::string &Name, GlobalValue *F = dyn_cast_or_null(SymTab.lookup(Name)); if (F == 0) { // Nope, add it - Function *New = new Function(Ty, GlobalVariable::ExternalLinkage, Name); + Function *New = Function::Create(Ty, GlobalVariable::ExternalLinkage, Name); FunctionList.push_back(New); return New; // Return the new prototype. }