[llvm-commits] [llvm-gcc-4.2] r49278 - in /llvm-gcc-4.2/trunk/gcc: llvm-backend.cpp llvm-convert.cpp llvm-debug.cpp
Gabor Greif
ggreif at gmail.com
Sun Apr 6 13:40:34 PDT 2008
Author: ggreif
Date: Sun Apr 6 15:40:34 2008
New Revision: 49278
URL: http://llvm.org/viewvc/llvm-project?rev=49278&view=rev
Log:
tracking API changes arising from r49277
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp?rev=49278&r1=49277&r2=49278&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-backend.cpp Sun Apr 6 15:40:34 2008
@@ -716,7 +716,7 @@
AliaseeName,
TheModule);
else if (Function *F = dyn_cast<Function>(V))
- Aliasee = new Function(F->getFunctionType(),
+ Aliasee = Function::Create(F->getFunctionType(),
Function::ExternalWeakLinkage,
AliaseeName,
TheModule);
@@ -1170,7 +1170,7 @@
const FunctionType *Ty =
TheTypeConverter->ConvertFunctionType(TREE_TYPE(decl), decl, NULL,
CC, PAL);
- FnEntry = new Function(Ty, Function::ExternalLinkage, Name, TheModule);
+ FnEntry = Function::Create(Ty, Function::ExternalLinkage, Name, TheModule);
FnEntry->setCallingConv(CC);
FnEntry->setParamAttrs(PAL);
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=49278&r1=49277&r2=49278&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sun Apr 6 15:40:34 2008
@@ -393,7 +393,7 @@
if (DECL_NAME(LabelDecl))
Name = IDENTIFIER_POINTER(DECL_NAME(LabelDecl));
- BasicBlock *NewBB = new BasicBlock(Name);
+ BasicBlock *NewBB = BasicBlock::Create(Name);
SET_DECL_LLVM(LabelDecl, NewBB);
return NewBB;
}
@@ -584,7 +584,7 @@
// Otherwise, either it exists with the wrong type or it doesn't exist. In
// either case create a new function.
- Fn = new Function(FTy, Function::ExternalLinkage, Name, TheModule);
+ Fn = Function::Create(FTy, Function::ExternalLinkage, Name, TheModule);
assert(Fn->getName() == Name && "Preexisting fn with the same name!");
Fn->setCallingConv(CallingConv);
Fn->setParamAttrs(PAL);
@@ -643,7 +643,7 @@
AddAnnotateAttrsToGlobal(Fn, FnDecl);
// Create a new basic block for the function.
- Builder.SetInsertPoint(new BasicBlock("entry", Fn));
+ Builder.SetInsertPoint(BasicBlock::Create("entry", Fn));
if (TheDebugInfo)
TheDebugInfo->EmitFunctionStart(FnDecl, Fn, Builder.GetInsertBlock());
@@ -732,7 +732,7 @@
}
// Create a new block for the return node, but don't insert it yet.
- ReturnBB = new BasicBlock("return");
+ ReturnBB = BasicBlock::Create("return");
}
Function *TreeToLLVM::FinishFunctionBody() {
@@ -816,7 +816,7 @@
break;
if (e && e->dest != bb->next_bb) {
Builder.CreateBr(getLabelDeclBlock(tree_block_label (e->dest)));
- EmitBlock(new BasicBlock(""));
+ EmitBlock(BasicBlock::Create(""));
}
}
@@ -1657,9 +1657,9 @@
IndirectGotoValue = CreateTemporary(TD.getIntPtrType());
// Create the block, emit a load, and emit the switch in the block.
- IndirectGotoBlock = new BasicBlock("indirectgoto");
+ IndirectGotoBlock = BasicBlock::Create("indirectgoto");
Value *Ld = new LoadInst(IndirectGotoValue, "gotodest", IndirectGotoBlock);
- new SwitchInst(Ld, IndirectGotoBlock, 0, IndirectGotoBlock);
+ SwitchInst::Create(Ld, IndirectGotoBlock, 0, IndirectGotoBlock);
// Finally, return it.
return IndirectGotoBlock;
@@ -1697,7 +1697,7 @@
//
Builder.CreateBr(DestBB);
}
- EmitBlock(new BasicBlock(""));
+ EmitBlock(BasicBlock::Create(""));
return 0;
}
@@ -1717,7 +1717,7 @@
// Emit a branch to the exit label.
Builder.CreateBr(ReturnBB);
- EmitBlock(new BasicBlock(""));
+ EmitBlock(BasicBlock::Create(""));
return 0;
}
@@ -1737,7 +1737,7 @@
BasicBlock *ThenDest = getLabelDeclBlock(TREE_OPERAND(Then, 0));
BasicBlock *ElseDest = getLabelDeclBlock(TREE_OPERAND(Else, 0));
Builder.CreateCondBr(Cond, ThenDest, ElseDest);
- EmitBlock(new BasicBlock(""));
+ EmitBlock(BasicBlock::Create(""));
return 0;
}
@@ -1751,7 +1751,7 @@
// Emit the switch instruction.
SwitchInst *SI = Builder.CreateSwitch(SwitchExp, Builder.GetInsertBlock(),
TREE_VEC_LENGTH(Cases));
- EmitBlock(new BasicBlock(""));
+ EmitBlock(BasicBlock::Create(""));
// Default location starts out as fall-through
SI->setSuccessor(0, Builder.GetInsertBlock());
@@ -1800,7 +1800,7 @@
// The range is too big to add to the switch - emit an "if".
Value *Diff = Builder.CreateSub(SwitchExp, LowC, "tmp");
Value *Cond = Builder.CreateICmpULE(Diff, ConstantInt::get(Range), "tmp");
- BasicBlock *False_Block = new BasicBlock("case_false");
+ BasicBlock *False_Block = BasicBlock::Create("case_false");
Builder.CreateCondBr(Cond, Dest, False_Block);
EmitBlock(False_Block);
}
@@ -1812,7 +1812,7 @@
else {
Builder.CreateBr(DefaultDest);
// Emit a "fallthrough" block, which is almost certainly dead.
- EmitBlock(new BasicBlock(""));
+ EmitBlock(BasicBlock::Create(""));
}
return 0;
@@ -1851,7 +1851,7 @@
BasicBlock *&PostPad = PostPads[RegionNo];
if (!PostPad)
- PostPad = new BasicBlock("ppad");
+ PostPad = BasicBlock::Create("ppad");
return PostPad;
}
@@ -2000,7 +2000,7 @@
Value *Compare = Builder.CreateICmpSLT(Select, Zero, "tmp");
// Branch on the compare.
- BasicBlock *NoFilterBB = new BasicBlock("nofilter");
+ BasicBlock *NoFilterBB = BasicBlock::Create("nofilter");
Builder.CreateCondBr(Compare, Dest, NoFilterBB);
EmitBlock(NoFilterBB);
} else if (RegionKind > 0) {
@@ -2044,7 +2044,7 @@
}
// If there is no such catch, execute a RESX if the comparison fails.
- NoCatchBB = new BasicBlock("nocatch");
+ NoCatchBB = BasicBlock::Create("nocatch");
// Branch on the compare.
Builder.CreateCondBr(Cond, Dest, NoCatchBB);
EmitBlock(NoCatchBB);
@@ -2073,7 +2073,7 @@
"Must-not-throw region handled by runtime?");
// Unwinding continues in the caller.
if (!UnwindBB)
- UnwindBB = new BasicBlock("Unwind");
+ UnwindBB = BasicBlock::Create("Unwind");
Builder.CreateBr(UnwindBB);
}
@@ -2270,7 +2270,7 @@
//
if (fndecl && TREE_THIS_VOLATILE(fndecl)) {
Builder.CreateUnreachable();
- EmitBlock(new BasicBlock(""));
+ EmitBlock(BasicBlock::Create(""));
}
return Result;
}
@@ -2513,7 +2513,7 @@
// Create a landing pad if one didn't exist already.
if (!ThisPad)
- ThisPad = new BasicBlock("lpad");
+ ThisPad = BasicBlock::Create("lpad");
LandingPad = ThisPad;
} else {
@@ -2602,7 +2602,7 @@
cast<CallInst>(Call)->setCallingConv(CallingConvention);
cast<CallInst>(Call)->setParamAttrs(PAL);
} else {
- BasicBlock *NextBlock = new BasicBlock("invcont");
+ BasicBlock *NextBlock = BasicBlock::Create("invcont");
Call = Builder.CreateInvoke(Callee, NextBlock, LandingPad,
CallOperands.begin(), CallOperands.end());
cast<InvokeInst>(Call)->setCallingConv(CallingConvention);
@@ -3494,11 +3494,11 @@
"Must-not-throw region handled by runtime?");
// Unwinding continues in the caller.
if (!UnwindBB)
- UnwindBB = new BasicBlock("Unwind");
+ UnwindBB = BasicBlock::Create("Unwind");
Builder.CreateBr(UnwindBB);
}
- EmitBlock(new BasicBlock(""));
+ EmitBlock(BasicBlock::Create(""));
return 0;
}
@@ -4279,7 +4279,7 @@
Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::trap));
// Emit an explicit unreachable instruction.
Builder.CreateUnreachable();
- EmitBlock(new BasicBlock(""));
+ EmitBlock(BasicBlock::Create(""));
return true;
// Convert annotation built-in to llvm.annotation intrinsic.
@@ -4808,7 +4808,7 @@
Intrinsic::eh_return),
Args.begin(), Args.end());
Result = Builder.CreateUnreachable();
- EmitBlock(new BasicBlock(""));
+ EmitBlock(BasicBlock::Create(""));
return true;
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=49278&r1=49277&r2=49278&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Sun Apr 6 15:40:34 2008
@@ -275,7 +275,7 @@
FuncStartFn = Intrinsic::getDeclaration(M, Intrinsic::dbg_func_start);
// Call llvm.dbg.func.start which also implicitly calls llvm.dbg.stoppoint.
- new CallInst(FuncStartFn, getCastValueFor(Subprogram), "", CurBB);
+ CallInst::Create(FuncStartFn, getCastValueFor(Subprogram), "", CurBB);
// Push function on region stack.
RegionStack.push_back(Subprogram);
@@ -293,7 +293,7 @@
RegionStartFn = Intrinsic::getDeclaration(M, Intrinsic::dbg_region_start);
// Call llvm.dbg.func.start.
- new CallInst(RegionStartFn, getCastValueFor(Block), "", CurBB);
+ CallInst::Create(RegionStartFn, getCastValueFor(Block), "", CurBB);
}
/// EmitRegionEnd - Constructs the debug code for exiting a declarative
@@ -307,7 +307,7 @@
EmitStopPoint(Fn, CurBB);
// Call llvm.dbg.func.end.
- new CallInst(RegionEndFn, getCastValueFor(RegionStack.back()), "", CurBB);
+ CallInst::Create(RegionEndFn, getCastValueFor(RegionStack.back()), "", CurBB);
RegionStack.pop_back();
}
@@ -347,7 +347,7 @@
SmallVector<Value *, 2> Args;
Args.push_back(AllocACast);
Args.push_back(getCastValueFor(Variable));
- new CallInst(DeclareFn, Args.begin(), Args.end(), "", CurBB);
+ CallInst::Create(DeclareFn, Args.begin(), Args.end(), "", CurBB);
}
/// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
@@ -378,7 +378,7 @@
ConstantInt::get(Type::Int32Ty, 0),
getCastValueFor(Unit)
};
- new CallInst(StopPointFn, Args, Args+3, "", CurBB);
+ CallInst::Create(StopPointFn, Args, Args+3, "", CurBB);
}
/// EmitGlobalVariable - Emit information about a global variable.
More information about the llvm-commits
mailing list