aboutsummaryrefslogtreecommitdiffstats
path: root/examples/ParallelJIT
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2008-04-06 20:25:17 +0000
committerGabor Greif <ggreif@gmail.com>2008-04-06 20:25:17 +0000
commit051a950000e21935165db56695e35bade668193b (patch)
tree76db4bc690c153a1cfbd2989849c3b1d95500390 /examples/ParallelJIT
parentd963ab1f58adb6daa028533ff3285841d7e45f80 (diff)
downloadexternal_llvm-051a950000e21935165db56695e35bade668193b.zip
external_llvm-051a950000e21935165db56695e35bade668193b.tar.gz
external_llvm-051a950000e21935165db56695e35bade668193b.tar.bz2
API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples/ParallelJIT')
-rw-r--r--examples/ParallelJIT/ParallelJIT.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/ParallelJIT/ParallelJIT.cpp b/examples/ParallelJIT/ParallelJIT.cpp
index 92d8f27..300c432 100644
--- a/examples/ParallelJIT/ParallelJIT.cpp
+++ b/examples/ParallelJIT/ParallelJIT.cpp
@@ -39,7 +39,7 @@ static Function* createAdd1(Module *M) {
// Add a basic block to the function. As before, it automatically inserts
// because of the last argument.
- BasicBlock *BB = new BasicBlock("EntryBlock", Add1F);
+ BasicBlock *BB = BasicBlock::Create("EntryBlock", Add1F);
// Get pointers to the constant `1'.
Value *One = ConstantInt::get(Type::Int32Ty, 1);
@@ -53,7 +53,7 @@ static Function* createAdd1(Module *M) {
Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);
// Create the return instruction and add it to the basic block
- new ReturnInst(Add, BB);
+ ReturnInst::Create(Add, BB);
// Now, function add1 is ready.
return Add1F;
@@ -67,7 +67,7 @@ static Function *CreateFibFunction(Module *M) {
(Type *)0));
// Add a basic block to the function.
- BasicBlock *BB = new BasicBlock("EntryBlock", FibF);
+ BasicBlock *BB = BasicBlock::Create("EntryBlock", FibF);
// Get pointers to the constants.
Value *One = ConstantInt::get(Type::Int32Ty, 1);
@@ -78,31 +78,31 @@ static Function *CreateFibFunction(Module *M) {
ArgX->setName("AnArg"); // Give it a nice symbolic name for fun.
// Create the true_block.
- BasicBlock *RetBB = new BasicBlock("return", FibF);
+ BasicBlock *RetBB = BasicBlock::Create("return", FibF);
// Create an exit block.
- BasicBlock* RecurseBB = new BasicBlock("recurse", FibF);
+ BasicBlock* RecurseBB = BasicBlock::Create("recurse", FibF);
// Create the "if (arg < 2) goto exitbb"
Value *CondInst = new ICmpInst(ICmpInst::ICMP_SLE, ArgX, Two, "cond", BB);
- new BranchInst(RetBB, RecurseBB, CondInst, BB);
+ BranchInst::Create(RetBB, RecurseBB, CondInst, BB);
// Create: ret int 1
- new ReturnInst(One, RetBB);
+ ReturnInst::Create(One, RetBB);
// create fib(x-1)
Value *Sub = BinaryOperator::createSub(ArgX, One, "arg", RecurseBB);
- Value *CallFibX1 = new CallInst(FibF, Sub, "fibx1", RecurseBB);
+ Value *CallFibX1 = CallInst::Create(FibF, Sub, "fibx1", RecurseBB);
// create fib(x-2)
Sub = BinaryOperator::createSub(ArgX, Two, "arg", RecurseBB);
- Value *CallFibX2 = new CallInst(FibF, Sub, "fibx2", RecurseBB);
+ Value *CallFibX2 = CallInst::Create(FibF, Sub, "fibx2", RecurseBB);
// fib(x-1)+fib(x-2)
Value *Sum =
BinaryOperator::createAdd(CallFibX1, CallFibX2, "addresult", RecurseBB);
// Create the return instruction and add it to the basic block
- new ReturnInst(Sum, RecurseBB);
+ ReturnInst::Create(Sum, RecurseBB);
return FibF;
}