mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51200 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -66,18 +66,18 @@ static Function *CreateFibFunction(Module *M) {
|
||||
ReturnInst::Create(One, RetBB);
|
||||
|
||||
// create fib(x-1)
|
||||
Value *Sub = BinaryOperator::createSub(ArgX, One, "arg", RecurseBB);
|
||||
Value *Sub = BinaryOperator::CreateSub(ArgX, One, "arg", RecurseBB);
|
||||
CallInst *CallFibX1 = CallInst::Create(FibF, Sub, "fibx1", RecurseBB);
|
||||
CallFibX1->setTailCall();
|
||||
|
||||
// create fib(x-2)
|
||||
Sub = BinaryOperator::createSub(ArgX, Two, "arg", RecurseBB);
|
||||
Sub = BinaryOperator::CreateSub(ArgX, Two, "arg", RecurseBB);
|
||||
CallInst *CallFibX2 = CallInst::Create(FibF, Sub, "fibx2", RecurseBB);
|
||||
CallFibX2->setTailCall();
|
||||
|
||||
|
||||
// fib(x-1)+fib(x-2)
|
||||
Value *Sum = BinaryOperator::createAdd(CallFibX1, CallFibX2,
|
||||
Value *Sum = BinaryOperator::CreateAdd(CallFibX1, CallFibX2,
|
||||
"addresult", RecurseBB);
|
||||
|
||||
// Create the return instruction and add it to the basic block
|
||||
|
@@ -69,7 +69,7 @@ int main() {
|
||||
ArgX->setName("AnArg"); // Give it a nice symbolic name for fun.
|
||||
|
||||
// Create the add instruction, inserting it into the end of BB.
|
||||
Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);
|
||||
Instruction *Add = BinaryOperator::CreateAdd(One, ArgX, "addresult", BB);
|
||||
|
||||
// Create the return instruction and add it to the basic block
|
||||
ReturnInst::Create(Add, BB);
|
||||
|
@@ -43,7 +43,7 @@ int main() {
|
||||
Value *Three = ConstantInt::get(Type::Int32Ty, 3);
|
||||
|
||||
// Create the add instruction... does not insert...
|
||||
Instruction *Add = BinaryOperator::create(Instruction::Add, Two, Three,
|
||||
Instruction *Add = BinaryOperator::Create(Instruction::Add, Two, Three,
|
||||
"addresult");
|
||||
|
||||
// explicitly insert it into the basic block...
|
||||
|
@@ -50,7 +50,7 @@ static Function* createAdd1(Module *M) {
|
||||
ArgX->setName("AnArg"); // Give it a nice symbolic name for fun.
|
||||
|
||||
// Create the add instruction, inserting it into the end of BB.
|
||||
Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);
|
||||
Instruction *Add = BinaryOperator::CreateAdd(One, ArgX, "addresult", BB);
|
||||
|
||||
// Create the return instruction and add it to the basic block
|
||||
ReturnInst::Create(Add, BB);
|
||||
@@ -90,16 +90,16 @@ static Function *CreateFibFunction(Module *M) {
|
||||
ReturnInst::Create(One, RetBB);
|
||||
|
||||
// create fib(x-1)
|
||||
Value *Sub = BinaryOperator::createSub(ArgX, One, "arg", RecurseBB);
|
||||
Value *Sub = BinaryOperator::CreateSub(ArgX, One, "arg", RecurseBB);
|
||||
Value *CallFibX1 = CallInst::Create(FibF, Sub, "fibx1", RecurseBB);
|
||||
|
||||
// create fib(x-2)
|
||||
Sub = BinaryOperator::createSub(ArgX, Two, "arg", RecurseBB);
|
||||
Sub = BinaryOperator::CreateSub(ArgX, Two, "arg", RecurseBB);
|
||||
Value *CallFibX2 = CallInst::Create(FibF, Sub, "fibx2", RecurseBB);
|
||||
|
||||
// fib(x-1)+fib(x-2)
|
||||
Value *Sum =
|
||||
BinaryOperator::createAdd(CallFibX1, CallFibX2, "addresult", RecurseBB);
|
||||
BinaryOperator::CreateAdd(CallFibX1, CallFibX2, "addresult", RecurseBB);
|
||||
|
||||
// Create the return instruction and add it to the basic block
|
||||
ReturnInst::Create(Sum, RecurseBB);
|
||||
|
Reference in New Issue
Block a user