diff options
author | Gabor Greif <ggreif@gmail.com> | 2008-05-16 19:29:10 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2008-05-16 19:29:10 +0000 |
commit | 7cbd8a3e92221437048b484d5ef9c0a22d0f8c58 (patch) | |
tree | 9c9985d8a294246ec942188ae322e6ce4b5d4efe /lib | |
parent | 446efddfcd655131bd0ceeacce9c1166e30ed479 (diff) |
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
Diffstat (limited to 'lib')
24 files changed, 453 insertions, 453 deletions
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp index 7ef1948b6a..e249421a1f 100644 --- a/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/lib/Analysis/ScalarEvolutionExpander.cpp @@ -40,7 +40,7 @@ Value *SCEVExpander::InsertCastOfTo(Instruction::CastOps opcode, Value *V, return CI; } } - return CastInst::create(opcode, V, Ty, V->getName(), + return CastInst::Create(opcode, V, Ty, V->getName(), A->getParent()->getEntryBlock().begin()); } @@ -67,7 +67,7 @@ Value *SCEVExpander::InsertCastOfTo(Instruction::CastOps opcode, Value *V, if (InvokeInst *II = dyn_cast<InvokeInst>(I)) IP = II->getNormalDest()->begin(); while (isa<PHINode>(IP)) ++IP; - return CastInst::create(opcode, V, Ty, V->getName(), IP); + return CastInst::Create(opcode, V, Ty, V->getName(), IP); } /// InsertBinop - Insert the specified binary operator, doing a small amount @@ -96,7 +96,7 @@ Value *SCEVExpander::InsertBinop(Instruction::BinaryOps Opcode, Value *LHS, } // If we don't have - return BinaryOperator::create(Opcode, LHS, RHS, "tmp", InsertPt); + return BinaryOperator::Create(Opcode, LHS, RHS, "tmp", InsertPt); } Value *SCEVExpander::visitMulExpr(SCEVMulExpr *S) { @@ -155,7 +155,7 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) { // Insert a unit add instruction right before the terminator corresponding // to the back-edge. Constant *One = ConstantInt::get(Ty, 1); - Instruction *Add = BinaryOperator::createAdd(PN, One, "indvar.next", + Instruction *Add = BinaryOperator::CreateAdd(PN, One, "indvar.next", (*HPI)->getTerminator()); pred_iterator PI = pred_begin(Header); diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 90fe540b8d..8c8a3c64ac 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -2852,7 +2852,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { CHECK_FOR_ERROR Value* val2 = getVal(*$2, $5); CHECK_FOR_ERROR - $$ = BinaryOperator::create($1, val1, val2); + $$ = BinaryOperator::Create($1, val1, val2); if ($$ == 0) GEN_ERROR("binary operator returned null"); delete $2; @@ -2869,7 +2869,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { CHECK_FOR_ERROR Value* tmpVal2 = getVal(*$2, $5); CHECK_FOR_ERROR - $$ = BinaryOperator::create($1, tmpVal1, tmpVal2); + $$ = BinaryOperator::Create($1, tmpVal1, tmpVal2); if ($$ == 0) GEN_ERROR("binary operator returned null"); delete $2; @@ -2883,7 +2883,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { CHECK_FOR_ERROR Value* tmpVal2 = getVal(*$3, $6); CHECK_FOR_ERROR - $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); + $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2); if ($$ == 0) GEN_ERROR("icmp operator returned null"); delete $3; @@ -2897,7 +2897,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { CHECK_FOR_ERROR Value* tmpVal2 = getVal(*$3, $6); CHECK_FOR_ERROR - $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); + $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2); if ($$ == 0) GEN_ERROR("fcmp operator returned null"); delete $3; @@ -2911,7 +2911,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { CHECK_FOR_ERROR Value* tmpVal2 = getVal(*$3, $6); CHECK_FOR_ERROR - $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); + $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2); if ($$ == 0) GEN_ERROR("icmp operator returned null"); delete $3; @@ -2925,7 +2925,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { CHECK_FOR_ERROR Value* tmpVal2 = getVal(*$3, $6); CHECK_FOR_ERROR - $$ = CmpInst::create($1, $2, tmpVal1, tmpVal2); + $$ = CmpInst::Create($1, $2, tmpVal1, tmpVal2); if ($$ == 0) GEN_ERROR("fcmp operator returned null"); delete $3; @@ -2939,7 +2939,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { GEN_ERROR("invalid cast opcode for cast from '" + Val->getType()->getDescription() + "' to '" + DestTy->getDescription() + "'"); - $$ = CastInst::create($1, Val, DestTy); + $$ = CastInst::Create($1, Val, DestTy); delete $4; } | SELECT ResolvedVal ',' ResolvedVal ',' ResolvedVal { diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 1fba6a48f6..c4f2247edc 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1266,7 +1266,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { int Opc = GetDecodedBinaryOpcode(Record[OpNum], LHS->getType()); if (Opc == -1) return Error("Invalid BINOP record"); - I = BinaryOperator::create((Instruction::BinaryOps)Opc, LHS, RHS); + I = BinaryOperator::Create((Instruction::BinaryOps)Opc, LHS, RHS); break; } case bitc::FUNC_CODE_INST_CAST: { // CAST: [opval, opty, destty, castopc] @@ -1280,7 +1280,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { int Opc = GetDecodedCastOpcode(Record[OpNum+1]); if (Opc == -1 || ResTy == 0) return Error("Invalid CAST record"); - I = CastInst::create((Instruction::CastOps)Opc, Op, ResTy); + I = CastInst::Create((Instruction::CastOps)Opc, Op, ResTy); break; } case bitc::FUNC_CODE_INST_GEP: { // GEP: [n x operands] diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 0500bfb496..bd3c8c71f5 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -173,76 +173,76 @@ static Value *LowerBSWAP(Value *V, Instruction *IP) { switch(BitSize) { default: assert(0 && "Unhandled type size of value to byteswap!"); case 16: { - Value *Tmp1 = BinaryOperator::createShl(V, + Value *Tmp1 = BinaryOperator::CreateShl(V, ConstantInt::get(V->getType(),8),"bswap.2",IP); - Value *Tmp2 = BinaryOperator::createLShr(V, + Value *Tmp2 = BinaryOperator::CreateLShr(V, ConstantInt::get(V->getType(),8),"bswap.1",IP); - V = BinaryOperator::createOr(Tmp1, Tmp2, "bswap.i16", IP); + V = BinaryOperator::CreateOr(Tmp1, Tmp2, "bswap.i16", IP); break; } case 32: { - Value *Tmp4 = BinaryOperator::createShl(V, + Value *Tmp4 = BinaryOperator::CreateShl(V, ConstantInt::get(V->getType(),24),"bswap.4", IP); - Value *Tmp3 = BinaryOperator::createShl(V, + Value *Tmp3 = BinaryOperator::CreateShl(V, ConstantInt::get(V->getType(),8),"bswap.3",IP); - Value *Tmp2 = BinaryOperator::createLShr(V, + Value *Tmp2 = BinaryOperator::CreateLShr(V, ConstantInt::get(V->getType(),8),"bswap.2",IP); - Value *Tmp1 = BinaryOperator::createLShr(V, + Value *Tmp1 = BinaryOperator::CreateLShr(V, ConstantInt::get(V->getType(),24),"bswap.1", IP); - Tmp3 = BinaryOperator::createAnd(Tmp3, + Tmp3 = BinaryOperator::CreateAnd(Tmp3, ConstantInt::get(Type::Int32Ty, 0xFF0000), "bswap.and3", IP); - Tmp2 = BinaryOperator::createAnd(Tmp2, + Tmp2 = BinaryOperator::CreateAnd(Tmp2, ConstantInt::get(Type::Int32Ty, 0xFF00), "bswap.and2", IP); - Tmp4 = BinaryOperator::createOr(Tmp4, Tmp3, "bswap.or1", IP); - Tmp2 = BinaryOperator::createOr(Tmp2, Tmp1, "bswap.or2", IP); - V = BinaryOperator::createOr(Tmp4, Tmp2, "bswap.i32", IP); + Tmp4 = BinaryOperator::CreateOr(Tmp4, Tmp3, "bswap.or1", IP); + Tmp2 = BinaryOperator::CreateOr(Tmp2, Tmp1, "bswap.or2", IP); + V = BinaryOperator::CreateOr(Tmp4, Tmp2, "bswap.i32", IP); break; } case 64: { - Value *Tmp8 = BinaryOperator::createShl(V, + Value *Tmp8 = BinaryOperator::CreateShl(V, ConstantInt::get(V->getType(),56),"bswap.8", IP); - Value *Tmp7 = BinaryOperator::createShl(V, + Value *Tmp7 = BinaryOperator::CreateShl(V, ConstantInt::get(V->getType(),40),"bswap.7", IP); - Value *Tmp6 = BinaryOperator::createShl(V, + Value *Tmp6 = BinaryOperator::CreateShl(V, ConstantInt::get(V->getType(),24),"bswap.6", IP); - Value *Tmp5 = BinaryOperator::createShl(V, + Value *Tmp5 = BinaryOperator::CreateShl(V, ConstantInt::get(V->getType(),8),"bswap.5", IP); - Value* Tmp4 = BinaryOperator::createLShr(V, + Value* Tmp4 = BinaryOperator::CreateLShr(V, ConstantInt::get(V->getType(),8),"bswap.4", IP); - Value* Tmp3 = BinaryOperator::createLShr(V, + Value* Tmp3 = BinaryOperator::CreateLShr(V, ConstantInt::get(V->getType(),24),"bswap.3", IP); - Value* Tmp2 = BinaryOperator::createLShr(V, + Value* Tmp2 = BinaryOperator::CreateLShr(V, ConstantInt::get(V->getType(),40),"bswap.2", IP); - Value* Tmp1 = BinaryOperator::createLShr(V, + Value* Tmp1 = BinaryOperator::CreateLShr(V, ConstantInt::get(V->getType(),56),"bswap.1", IP); - Tmp7 = BinaryOperator::createAnd(Tmp7, + Tmp7 = BinaryOperator::CreateAnd(Tmp7, ConstantInt::get(Type::Int64Ty, 0xFF000000000000ULL), "bswap.and7", IP); - Tmp6 = BinaryOperator::createAnd(Tmp6, + Tmp6 = BinaryOperator::CreateAnd(Tmp6, ConstantInt::get(Type::Int64Ty, 0xFF0000000000ULL), "bswap.and6", IP); - Tmp5 = BinaryOperator::createAnd(Tmp5, + Tmp5 = BinaryOperator::CreateAnd(Tmp5, ConstantInt::get(Type::Int64Ty, 0xFF00000000ULL), "bswap.and5", IP); - Tmp4 = BinaryOperator::createAnd(Tmp4, + Tmp4 = BinaryOperator::CreateAnd(Tmp4, ConstantInt::get(Type::Int64Ty, 0xFF000000ULL), "bswap.and4", IP); - Tmp3 = BinaryOperator::createAnd(Tmp3, + Tmp3 = BinaryOperator::CreateAnd(Tmp3, ConstantInt::get(Type::Int64Ty, 0xFF0000ULL), "bswap.and3", IP); - Tmp2 = BinaryOperator::createAnd(Tmp2, + Tmp2 = BinaryOperator::CreateAnd(Tmp2, ConstantInt::get(Type::Int64Ty, 0xFF00ULL), "bswap.and2", IP); - Tmp8 = BinaryOperator::createOr(Tmp8, Tmp7, "bswap.or1", IP); - Tmp6 = BinaryOperator::createOr(Tmp6, Tmp5, "bswap.or2", IP); - Tmp4 = BinaryOperator::createOr(Tmp4, Tmp3, "bswap.or3", IP); - Tmp2 = BinaryOperator::createOr(Tmp2, Tmp1, "bswap.or4", IP); - Tmp8 = BinaryOperator::createOr(Tmp8, Tmp6, "bswap.or5", IP); - Tmp4 = BinaryOperator::createOr(Tmp4, Tmp2, "bswap.or6", IP); - V = BinaryOperator::createOr(Tmp8, Tmp4, "bswap.i64", IP); + Tmp8 = BinaryOperator::CreateOr(Tmp8, Tmp7, "bswap.or1", IP); + Tmp6 = BinaryOperator::CreateOr(Tmp6, Tmp5, "bswap.or2", IP); + Tmp4 = BinaryOperator::CreateOr(Tmp4, Tmp3, "bswap.or3", IP); + Tmp2 = BinaryOperator::CreateOr(Tmp2, Tmp1, "bswap.or4", IP); + Tmp8 = BinaryOperator::CreateOr(Tmp8, Tmp6, "bswap.or5", IP); + Tmp4 = BinaryOperator::CreateOr(Tmp4, Tmp2, "bswap.or6", IP); + V = BinaryOperator::CreateOr(Tmp8, Tmp4, "bswap.i64", IP); break; } } @@ -269,16 +269,16 @@ static Value *LowerCTPOP(Value *V, Instruction *IP) { for (unsigned i = 1, ct = 0; i < (BitSize>64 ? 64 : BitSize); i <<= 1, ++ct) { Value *MaskCst = ConstantInt::get(V->getType(), MaskValues[ct]); - Value *LHS = BinaryOperator::createAnd( + Value *LHS = BinaryOperator::CreateAnd( PartValue, MaskCst, "cppop.and1", IP); - Value *VShift = BinaryOperator::createLShr(PartValue, + Value *VShift = BinaryOperator::CreateLShr(PartValue, ConstantInt::get(V->getType(), i), "ctpop.sh", IP); - Value *RHS = BinaryOperator::createAnd(VShift, MaskCst, "cppop.and2", IP); - PartValue = BinaryOperator::createAdd(LHS, RHS, "ctpop.step", IP); + Value *RHS = BinaryOperator::CreateAnd(VShift, MaskCst, "cppop.and2", IP); + PartValue = BinaryOperator::CreateAdd(LHS, RHS, "ctpop.step", IP); } - Count = BinaryOperator::createAdd(PartValue, Count, "ctpop.part", IP); + Count = BinaryOperator::CreateAdd(PartValue, Count, "ctpop.part", IP); if (BitSize > 64) { - V = BinaryOperator::createLShr(V, ConstantInt::get(V->getType(), 64), + V = BinaryOperator::CreateLShr(V, ConstantInt::get(V->getType(), 64), "ctpop.part.sh", IP); BitSize -= 64; } @@ -294,11 +294,11 @@ static Value *LowerCTLZ(Value *V, Instruction *IP) { unsigned BitSize = V->getType()->getPrimitiveSizeInBits(); for (unsigned i = 1; i < BitSize; i <<= 1) { Value *ShVal = ConstantInt::get(V->getType(), i); - ShVal = BinaryOperator::createLShr(V, ShVal, "ctlz.sh", IP); - V = BinaryOperator::createOr(V, ShVal, "ctlz.step", IP); + ShVal = BinaryOperator::CreateLShr(V, ShVal, "ctlz.sh", IP); + V = BinaryOperator::CreateOr(V, ShVal, "ctlz.step", IP); } - V = BinaryOperator::createNot(V, "", IP); + V = BinaryOperator::CreateNot(V, "", IP); return LowerCTPOP(V, IP); } @@ -355,10 +355,10 @@ static Instruction *LowerPartSelect(CallInst *CI) { // Cast Hi and Lo to the size of Val so the widths are all the same if (Hi->getType() != Val->getType()) - Hi = CastInst::createIntegerCast(Hi, Val->getType(), false, + Hi = CastInst::CreateIntegerCast(Hi, Val->getType(), false, "tmp", CurBB); if (Lo->getType() != Val->getType()) - Lo = CastInst::createIntegerCast(Lo, Val->getType(), false, + Lo = CastInst::CreateIntegerCast(Lo, Val->getType(), false, "tmp", CurBB); // Compute a few things that both cases will need, up front. @@ -373,12 +373,12 @@ static Instruction *LowerPartSelect(CallInst *CI) { // First, copmute the number of bits in the forward case. Instruction* FBitSize = - BinaryOperator::createSub(Hi, Lo,"fbits", FwdSize); + BinaryOperator::CreateSub(Hi, Lo,"fbits", FwdSize); BranchInst::Create(Compute, FwdSize); // Second, compute the number of bits in the reverse case. Instruction* RBitSize = - BinaryOperator::createSub(Lo, Hi, "rbits", RevSize); + BinaryOperator::CreateSub(Lo, Hi, "rbits", RevSize); BranchInst::Create(Compute, RevSize); // Now, compute the bit range. Start by getting the bitsize and the shift @@ -402,17 +402,17 @@ static Instruction *LowerPartSelect(CallInst *CI) { // Increment the bit size Instruction *BitSizePlusOne = - BinaryOperator::createAdd(BitSize, One, "bits", Compute); + BinaryOperator::CreateAdd(BitSize, One, "bits", Compute); // Create a Mask to zero out the high order bits. Instruction* Mask = - BinaryOperator::createShl(AllOnes, BitSizePlusOne, "mask", Compute); - Mask = BinaryOperator::createNot(Mask, "mask", Compute); + BinaryOperator::CreateShl(AllOnes, BitSizePlusOne, "mask", Compute); + Mask = BinaryOperator::CreateNot(Mask, "mask", Compute); // Shift the bits down and apply the mask Instruction* FRes = - BinaryOperator::createLShr(Val, ShiftAmt, "fres", Compute); - FRes = BinaryOperator::createAnd(FRes, Mask, "fres", Compute); + BinaryOperator::CreateLShr(Val, ShiftAmt, "fres", Compute); + FRes = BinaryOperator::CreateAnd(FRes, Mask, "fres", Compute); BranchInst::Create(Reverse, RsltBlk, Cmp, Compute); // In the Reverse block we have the mask already in FRes but we must reverse @@ -435,22 +435,22 @@ static Instruction *LowerPartSelect(CallInst *CI) { RRes->addIncoming(Zero, Compute); // Decrement the counter - Instruction *Decr = BinaryOperator::createSub(Count, One, "decr", Reverse); + Instruction *Decr = BinaryOperator::CreateSub(Count, One, "decr", Reverse); Count->addIncoming(Decr, Reverse); // Compute the Bit that we want to move Instruction *Bit = - BinaryOperator::createAnd(BitsToShift, One, "bit", Reverse); + BinaryOperator::CreateAnd(BitsToShift, One, "bit", Reverse); // Compute the new value for next iteration. Instruction *NewVal = - BinaryOperator::createLShr(BitsToShift, One, "rshift", Reverse); + BinaryOperator::CreateLShr(BitsToShift, One, "rshift", Reverse); BitsToShift->addIncoming(NewVal, Reverse); // Shift the bit into the low bits of the result. Instruction *NewRes = - BinaryOperator::createShl(RRes, One, "lshift", Reverse); - NewRes = BinaryOperator::createOr(NewRes, Bit, "addbit", Reverse); + BinaryOperator::CreateShl(RRes, One, "lshift", Reverse); + NewRes = BinaryOperator::CreateOr(NewRes, Bit, "addbit", Reverse); RRes->addIncoming(NewRes, Reverse); // Terminate loop if we've moved all the bits. @@ -543,8 +543,8 @@ static Instruction *LowerPartSet(CallInst *CI) { new ICmpInst(ICmpInst::ICMP_ULT, Lo, Hi, "", entry); SelectInst* Hi_pn = SelectInst::Create(is_forward, Hi, Lo, "", entry); SelectInst* Lo_pn = SelectInst::Create(is_forward, Lo, Hi, "", entry); - BinaryOperator* NumBits = BinaryOperator::createSub(Hi_pn, Lo_pn, "",entry); - NumBits = BinaryOperator::createAdd(NumBits, One, "", entry); + BinaryOperator* NumBits = BinaryOperator::CreateSub(Hi_pn, Lo_pn, "",entry); + NumBits = BinaryOperator::CreateAdd(NumBits, One, "", entry); // Now, convert Lo and Hi to ValTy bit width if (ValBits > 32) { Lo = new ZExtInst(Lo_pn, ValTy, "", entry); @@ -559,12 +559,12 @@ static Instruction *LowerPartSet(CallInst *CI) { // BASIC BLOCK: large Instruction* MaskBits = - BinaryOperator::createSub(RepBitWidth, NumBits, "", large); - MaskBits = CastInst::createIntegerCast(MaskBits, RepMask->getType(), + BinaryOperator::CreateSub(RepBitWidth, NumBits, "", large); + MaskBits = CastInst::CreateIntegerCast(MaskBits, RepMask->getType(), false, "", large); BinaryOperator* Mask1 = - BinaryOperator::createLShr(RepMask, MaskBits, "", large); - BinaryOperator* Rep2 = BinaryOperator::createAnd(Mask1, Rep, "", large); + BinaryOperator::CreateLShr(RepMask, MaskBits, "", large); + BinaryOperator* Rep2 = BinaryOperator::CreateAnd(Mask1, Rep, "", large); BranchInst::Create(small, large); // BASIC BLOCK: small @@ -598,19 +598,19 @@ static Instruction *LowerPartSet(CallInst *CI) { RRes->addIncoming(ValZero, small); // Decrement the loop counter by one - Instruction *Decr = BinaryOperator::createSub(Count, One, "", reverse); + Instruction *Decr = BinaryOperator::CreateSub(Count, One, "", reverse); Count->addIncoming(Decr, reverse); // Get the bit that we want to move into the result - Value *Bit = BinaryOperator::createAnd(BitsToShift, ValOne, "", reverse); + Value *Bit = BinaryOperator::CreateAnd(BitsToShift, ValOne, "", reverse); // Compute the new value of the bits to shift for the next iteration. - Value *NewVal = BinaryOperator::createLShr(BitsToShift, ValOne,"", reverse); + Value *NewVal = BinaryOperator::CreateLShr(BitsToShift, ValOne,"", reverse); BitsToShift->addIncoming(NewVal, reverse); // Shift the bit we extracted into the low bit of the result. - Instruction *NewRes = BinaryOperator::createShl(RRes, ValOne, "", reverse); - NewRes = BinaryOperator::createOr(NewRes, Bit, "", reverse); + Instruction *NewRes = BinaryOperator::CreateShl(RRes, ValOne, "", reverse); + NewRes = BinaryOperator::CreateOr(NewRes, Bit, "", reverse); RRes->addIncoming(NewRes, reverse); // Terminate loop if we've moved all the bits. @@ -622,14 +622,14 @@ static Instruction *LowerPartSet(CallInst *CI) { Rplcmnt->reserveOperandSpace(2); Rplcmnt->addIncoming(NewRes, reverse); Rplcmnt->addIncoming(Rep4, small); - Value* t0 = CastInst::createIntegerCast(NumBits,ValTy,false,"",result); - Value* t1 = BinaryOperator::createShl(ValMask, Lo, "", result); - Value* t2 = BinaryOperator::createNot(t1, "", result); - Value* t3 = BinaryOperator::createShl(t1, t0, "", result); - Value* t4 = BinaryOperator::createOr(t2, t3, "", result); - Value* t5 = BinaryOperator::createAnd(t4, Val, "", result); - Value* t6 = BinaryOperator::createShl(Rplcmnt, Lo, "", result); - Value* Rslt = BinaryOperator::createOr(t5, t6, "part_set", result); + Value* t0 = CastInst::CreateIntegerCast(NumBits,ValTy,false,"",result); + Value* t1 = BinaryOperator::CreateShl(ValMask, Lo, "", result); + Value* t2 = BinaryOperator::CreateNot(t1, "", result); + Value* t3 = BinaryOperator::CreateShl(t1, t0, "", result); + Value* t4 = BinaryOperator::CreateOr(t2, t3, "", result); + Value* t5 = BinaryOperator::CreateAnd(t4, Val, "", result); + Value* t6 = BinaryOperator::CreateShl(Rplcmnt, Lo, "", result); + Value* Rslt = BinaryOperator::CreateOr(t5, t6, "part_set", result); ReturnInst::Create(Rslt, result); } @@ -704,10 +704,10 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { case Intrinsic::cttz: { // cttz(x) -> ctpop(~X & (X-1)) Value *Src = CI->getOperand(1); - Value *NotSrc = BinaryOperator::createNot(Src, Src->getName()+".not", CI); + Value *NotSrc = BinaryOperator::CreateNot(Src, Src->getName()+".not", CI); Value *SrcM1 = ConstantInt::get(Src->getType(), 1); - SrcM1 = BinaryOperator::createSub(Src, SrcM1, "", CI); - Src = LowerCTPOP(BinaryOperator::createAnd(NotSrc, SrcM1, "", CI), CI); + SrcM1 = BinaryOperator::CreateSub(Src, SrcM1, "", CI); + Src = LowerCTPOP(BinaryOperator::CreateAnd(NotSrc, SrcM1, "", CI), CI); CI->replaceAllUsesWith(Src); break; } diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp index dc9a11e457..a16b720c50 100644 --- a/lib/Target/CppBackend/CPPBackend.cpp +++ b/lib/Target/CppBackend/CPPBackend.cpp @@ -1155,7 +1155,7 @@ namespace { case Instruction::Shl: case Instruction::LShr: case Instruction::AShr:{ - Out << "BinaryOperator* " << iName << " = BinaryOperator::create("; + Out << "BinaryOperator* " << iName << " = BinaryOperator::Create("; switch (I->getOpcode()) { case Instruction::Add: Out << "Instruction::Add"; break; case Instruction::Sub: Out << "Instruction::Sub"; break; diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp index 29a98cbb4c..5d3dbcd401 100644 --- a/lib/Transforms/IPO/GlobalOpt.cpp +++ b/lib/Transforms/IPO/GlobalOpt.cpp @@ -872,7 +872,7 @@ static GlobalVariable *OptimizeGlobalAddressOfMalloc(GlobalVariable *GV, case ICmpInst::ICMP_ULE: case ICmpInst::ICMP_SLE: case ICmpInst::ICMP_EQ: - LV = BinaryOperator::createNot(LV, "notinit", CI); + LV = BinaryOperator::CreateNot(LV, "notinit", CI); break; case ICmpInst::ICMP_NE: case ICmpInst::ICMP_UGE: @@ -1193,7 +1193,7 @@ static GlobalVariable *PerformHeapAllocSRoA(GlobalVariable *GV, MallocInst *MI){ if (!RunningOr) RunningOr = Cond; // First seteq else - RunningOr = BinaryOperator::createOr(RunningOr, Cond, "tmp", MI); + RunningOr = BinaryOperator::CreateOr(RunningOr, Cond, "tmp", MI); } // Split the basic block at the old malloc. diff --git a/lib/Transforms/IPO/IndMemRemoval.cpp b/lib/Transforms/IPO/IndMemRemoval.cpp index a623135bc1..8448374859 100644 --- a/lib/Transforms/IPO/IndMemRemoval.cpp +++ b/lib/Transforms/IPO/IndMemRemoval.cpp @@ -72,7 +72,7 @@ bool IndMemRemPass::runOnModule(Module &M) { GlobalValue::LinkOnceLinkage, "malloc_llvm_bounce", &M); BasicBlock* bb = BasicBlock::Create("entry",FN); - Instruction* c = CastInst::createIntegerCast( + Instruction* c = CastInst::CreateIntegerCast( FN->arg_begin(), Type::Int32Ty, false, "c", bb); Instruction* a = new MallocInst(Type::Int8Ty, c, "m", bb); ReturnInst::Create(a, bb); diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp index 0931dec010..58fd682eb7 100644 --- a/lib/Transforms/IPO/RaiseAllocations.cpp +++ b/lib/Transforms/IPO/RaiseAllocations.cpp @@ -164,7 +164,7 @@ bool RaiseAllocations::runOnModule(Module &M) { // source size. if (Source->getType() != Type::Int32Ty) Source = - CastInst::createIntegerCast(Source, Type::Int32Ty, false/*ZExt*/, + CastInst::CreateIntegerCast(Source, Type::Int32Ty, false/*ZExt*/, "MallocAmtCast", I); MallocInst *MI = new MallocInst(Type::Int8Ty, Source, "", I); diff --git a/lib/Transforms/Instrumentation/ProfilingUtils.cpp b/lib/Transforms/Instrumentation/ProfilingUtils.cpp index 4617fbbd80..d94522f6c7 100644 --- a/lib/Transforms/Instrumentation/ProfilingUtils.cpp +++ b/lib/Transforms/Instrumentation/ProfilingUtils.cpp @@ -68,7 +68,7 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName, Instruction::CastOps opcode = CastInst::getCastOpcode(AI, false, ArgVTy, false); InitCall->setOperand(2, - CastInst::create(opcode, AI, ArgVTy, "argv.cast", InitCall)); + CastInst::Create(opcode, AI, ArgVTy, "argv.cast", InitCall)); } else { InitCall->setOperand(2, AI); } @@ -83,11 +83,11 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName, if (!AI->use_empty()) { opcode = CastInst::getCastOpcode(InitCall, true, AI->getType(), true); AI->replaceAllUsesWith( - CastInst::create(opcode, InitCall, AI->getType(), "", InsertPos)); + CastInst::Create(opcode, InitCall, AI->getType(), "", InsertPos)); } opcode = CastInst::getCastOpcode(AI, true, Type::Int32Ty, true); InitCall->setOperand(1, - CastInst::create(opcode, AI, Type::Int32Ty, "argc.cast", InitCall)); + CastInst::Create(opcode, AI, Type::Int32Ty, "argc.cast", InitCall)); } else { AI->replaceAllUsesWith(InitCall); InitCall->setOperand(1, AI); @@ -113,7 +113,7 @@ void llvm::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum, // Load, increment and store the value back. Value *OldVal = new LoadInst(ElementPtr, "OldFuncCounter", InsertPos); - Value *NewVal = BinaryOperator::create(Instruction::Add, OldVal, + Value *NewVal = BinaryOperator::Create(Instruction::Add, OldVal, ConstantInt::get(Type::Int32Ty, 1), "NewFuncCounter", InsertPos); new StoreInst(NewVal, ElementPtr, InsertPos); diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp index 7d16692507..a9406c89d4 100644 --- a/lib/Transforms/Instrumentation/RSProfiling.cpp +++ b/lib/Transforms/Instrumentation/RSProfiling.cpp @@ -215,7 +215,7 @@ void GlobalRandomCounter::ProcessChoicePoint(BasicBlock* bb) { ICmpInst* s = new ICmpInst(ICmpInst::ICMP_EQ, l, ConstantInt::get(T, 0), "countercc", t); - Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1), + Value* nv = BinaryOperator::CreateSub(l, ConstantInt::get(T, 1), "counternew", t); new StoreInst(nv, Counter, t); t->setCondition(s); @@ -290,7 +290,7 @@ void GlobalRandomCounterOpt::ProcessChoicePoint(BasicBlock* bb) { ICmpInst* s = new ICmpInst(ICmpInst::ICMP_EQ, l, ConstantInt::get(T, 0), "countercc", t); - Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1), + Value* nv = BinaryOperator::CreateSub(l, ConstantInt::get(T, 1), "counternew", t); new StoreInst(nv, AI, t); t->setCondition(s); @@ -319,7 +319,7 @@ void CycleCounter::ProcessChoicePoint(BasicBlock* bb) { CallInst* c = CallInst::Create(F, "rdcc", t); BinaryOperator* b = - BinaryOperator::createAnd(c, ConstantInt::get(Type::Int64Ty, rm), + BinaryOperator::CreateAnd(c, ConstantInt::get(Type::Int64Ty, rm), "mrdcc", t); ICmpInst *s = new ICmpInst(ICmpInst::ICMP_EQ, b, @@ -357,7 +357,7 @@ void RSProfilers_std::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNu // Load, increment and store the value back. Value *OldVal = new LoadInst(ElementPtr, "OldCounter", InsertPos); profcode.insert(OldVal); - Value *NewVal = BinaryOperator::createAdd(OldVal, + Value *NewVal = BinaryOperator::CreateAdd(OldVal, ConstantInt::get(Type::Int32Ty, 1), "NewCounter", InsertPos); profcode.insert(NewVal); diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 2dfd4d7a3d..959a832004 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -389,7 +389,7 @@ static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI){ while (isa<PHINode>(InsertPt)) ++InsertPt; InsertedCast = - CastInst::create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "", + CastInst::Create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "", InsertPt); MadeChange = true; } @@ -447,7 +447,7 @@ static bool OptimizeCmpExpression(CmpInst *CI){ while (isa<PHINode>(InsertPt)) ++InsertPt; InsertedCmp = - CmpInst::create(CI->getOpcode(), CI->getPredicate(), CI->getOperand(0), + CmpInst::Create(CI->getOpcode(), CI->getPredicate(), CI->getOperand(0), CI->getOperand(1), "", InsertPt); MadeChange = true; } @@ -880,7 +880,7 @@ bool CodeGenPrepare::OptimizeLoadStoreInst(Instruction *LdStInst, Value *Addr, V = new SExtInst(V, IntPtrTy, "sunkaddr", InsertPt); } if (AddrMode.Scale != 1) - V = BinaryOperator::createMul(V, ConstantInt::get(IntPtrTy, + V = BinaryOperator::CreateMul(V, ConstantInt::get(IntPtrTy, AddrMode.Scale), "sunkaddr", InsertPt); Result = V; @@ -892,7 +892,7 @@ bool CodeGenPrepare::OptimizeLoadStoreInst(Instruction *LdStInst, Value *Addr, if (V->getType() != IntPtrTy) V = new PtrToIntInst(V, IntPtrTy, "sunkaddr", InsertPt); if (Result) - Result = BinaryOperator::createAdd(Result, V, "sunkaddr", InsertPt); + Result = BinaryOperator::CreateAdd(Result, V, "sunkaddr", InsertPt); else Result = V; } @@ -902,7 +902,7 @@ bool CodeGenPrepare::OptimizeLoadStoreInst(Instruction *LdStInst, Value *Addr, |