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/VMCore | |
parent | 446efddfcd655131bd0ceeacce9c1166e30ed479 (diff) | |
download | external_llvm-7cbd8a3e92221437048b484d5ef9c0a22d0f8c58.zip external_llvm-7cbd8a3e92221437048b484d5ef9c0a22d0f8c58.tar.gz external_llvm-7cbd8a3e92221437048b484d5ef9c0a22d0f8c58.tar.bz2 |
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/VMCore')
-rw-r--r-- | lib/VMCore/AutoUpgrade.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/Instructions.cpp | 88 |
2 files changed, 45 insertions, 45 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp index 7faff56..bed8fee 100644 --- a/lib/VMCore/AutoUpgrade.cpp +++ b/lib/VMCore/AutoUpgrade.cpp @@ -272,7 +272,7 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { bool DestSExt = F->getParamAttrs().paramHasAttr(0, ParamAttr::SExt); // Construct an appropriate cast from the new return type to the old. - CastInst *RetCast = CastInst::create( + CastInst *RetCast = CastInst::Create( CastInst::getCastOpcode(NewCI, SrcSExt, F->getReturnType(), DestSExt), diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 9fc70ce..ff3b8b5 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -1450,7 +1450,7 @@ void BinaryOperator::init(BinaryOps iType) { #endif } -BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2, +BinaryOperator *BinaryOperator::Create(BinaryOps Op, Value *S1, Value *S2, const std::string &Name, Instruction *InsertBefore) { assert(S1->getType() == S2->getType() && @@ -1458,15 +1458,15 @@ BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2, return new BinaryOperator(Op, S1, S2, S1->getType(), Name, InsertBefore); } -BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2, +BinaryOperator *BinaryOperator::Create(BinaryOps Op, Value *S1, Value *S2, const std::string &Name, BasicBlock *InsertAtEnd) { - BinaryOperator *Res = create(Op, S1, S2, Name); + BinaryOperator *Res = Create(Op, S1, S2, Name); InsertAtEnd->getInstList().push_back(Res); return Res; } -BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name, +BinaryOperator *BinaryOperator::CreateNeg(Value *Op, const std::string &Name, Instruction *InsertBefore) { Value *zero = ConstantExpr::getZeroValueForNegationExpr(Op->getType()); return new BinaryOperator(Instruction::Sub, @@ -1474,7 +1474,7 @@ BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name, Op->getType(), Name, InsertBefore); } -BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name, +BinaryOperator *BinaryOperator::CreateNeg(Value *Op, const std::string &Name, BasicBlock *InsertAtEnd) { Value *zero = ConstantExpr::getZeroValueForNegationExpr(Op->getType()); return new BinaryOperator(Instruction::Sub, @@ -1482,7 +1482,7 @@ BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name, Op->getType(), Name, InsertAtEnd); } -BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name, +BinaryOperator *BinaryOperator::CreateNot(Value *Op, const std::string &Name, Instruction *InsertBefore) { Constant *C; if (const VectorType *PTy = dyn_cast<VectorType>(Op->getType())) { @@ -1496,7 +1496,7 @@ BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name, Op->getType(), Name, InsertBefore); } -BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name, +BinaryOperator *BinaryOperator::CreateNot(Value *Op, const std::string &Name, BasicBlock *InsertAtEnd) { Constant *AllOnes; if (const VectorType *PTy = dyn_cast<VectorType>(Op->getType())) { @@ -1801,7 +1801,7 @@ unsigned CastInst::isEliminableCastPair( return 0; } -CastInst *CastInst::create(Instruction::CastOps op, Value *S, const Type *Ty, +CastInst *CastInst::Create(Instruction::CastOps op, Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore) { // Construct and return the appropriate CastInst subclass switch (op) { @@ -1823,7 +1823,7 @@ CastInst *CastInst::create(Instruction::CastOps op, Value *S, const Type *Ty, return 0; } -CastInst *CastInst::create(Instruction::CastOps op, Value *S, const Type *Ty, +CastInst *CastInst::Create(Instruction::CastOps op, Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd) { // Construct and return the appropriate CastInst subclass switch (op) { @@ -1845,55 +1845,55 @@ CastInst *CastInst::create(Instruction::CastOps op, Value *S, const Type *Ty, return 0; } -CastInst *CastInst::createZExtOrBitCast(Value *S, const Type *Ty, +CastInst *CastInst::CreateZExtOrBitCast(Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore) { if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) - return create(Instruction::BitCast, S, Ty, Name, InsertBefore); - return create(Instruction::ZExt, S, Ty, Name, InsertBefore); + return Create(Instruction::BitCast, S, Ty, Name, InsertBefore); + return Create(Instruction::ZExt, S, Ty, Name, InsertBefore); } -CastInst *CastInst::createZExtOrBitCast(Value *S, const Type *Ty, +CastInst *CastInst::CreateZExtOrBitCast(Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd) { if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) - return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); - return create(Instruction::ZExt, S, Ty, Name, InsertAtEnd); + return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); + return Create(Instruction::ZExt, S, Ty, Name, InsertAtEnd); } -CastInst *CastInst::createSExtOrBitCast(Value *S, const Type *Ty, +CastInst *CastInst::CreateSExtOrBitCast(Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore) { if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) - return create(Instruction::BitCast, S, Ty, Name, InsertBefore); - return create(Instruction::SExt, S, Ty, Name, InsertBefore); + return Create(Instruction::BitCast, S, Ty, Name, InsertBefore); + return Create(Instruction::SExt, S, Ty, Name, InsertBefore); } -CastInst *CastInst::createSExtOrBitCast(Value *S, const Type *Ty, +CastInst *CastInst::CreateSExtOrBitCast(Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd) { if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) - return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); - return create(Instruction::SExt, S, Ty, Name, InsertAtEnd); + return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); + return Create(Instruction::SExt, S, Ty, Name, InsertAtEnd); } -CastInst *CastInst::createTruncOrBitCast(Value *S, const Type *Ty, +CastInst *CastInst::CreateTruncOrBitCast(Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore) { if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) - return create(Instruction::BitCast, S, Ty, Name, InsertBefore); - return create(Instruction::Trunc, S, Ty, Name, InsertBefore); + return Create(Instruction::BitCast, S, Ty, Name, InsertBefore); + return Create(Instruction::Trunc, S, Ty, Name, InsertBefore); } -CastInst *CastInst::createTruncOrBitCast(Value *S, const Type *Ty, +CastInst *CastInst::CreateTruncOrBitCast(Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd) { if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) - return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); - return create(Instruction::Trunc, S, Ty, Name, InsertAtEnd); + return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); + return Create(Instruction::Trunc, S, Ty, Name, InsertAtEnd); } -CastInst *CastInst::createPointerCast(Value *S, const Type *Ty, +CastInst *CastInst::CreatePointerCast(Value *S, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd) { assert(isa<PointerType>(S->getType()) && "Invalid cast"); @@ -1901,12 +1901,12 @@ CastInst *CastInst::createPointerCast(Value *S, const Type *Ty, "Invalid cast"); if (Ty->isInteger()) - return create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd); - return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); + return Create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd); + return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); } /// @brief Create a BitCast or a PtrToInt cast instruction -CastInst *CastInst::createPointerCast(Value *S, const Type *Ty, +CastInst *CastInst::CreatePointerCast(Value *S, const Type *Ty, const std::string &Name, Instruction *InsertBefore) { assert(isa<PointerType>(S->getType()) && "Invalid cast"); @@ -1914,11 +1914,11 @@ CastInst *CastInst::createPointerCast(Value *S, const Type *Ty, "Invalid cast"); if (Ty->isInteger()) - return create(Instruction::PtrToInt, S, Ty, Name, InsertBefore); - return create(Instruction::BitCast, S, Ty, Name, InsertBefore); + return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore); + return Create(Instruction::BitCast, S, Ty, Name, InsertBefore); } -CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty, +CastInst *CastInst::CreateIntegerCast(Value *C, const Type *Ty, bool isSigned, const std::string &Name, Instruction *InsertBefore) { assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast"); @@ -1928,10 +1928,10 @@ CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty, (SrcBits == DstBits ? Instruction::BitCast : (SrcBits > DstBits ? Instruction::Trunc : (isSigned ? Instruction::SExt : Instruction::ZExt))); - return create(opcode, C, Ty, Name, InsertBefore); + return Create(opcode, C, Ty, Name, InsertBefore); } -CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty, +CastInst *CastInst::CreateIntegerCast(Value *C, const Type *Ty, bool isSigned, const std::string &Name, BasicBlock *InsertAtEnd) { assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast"); @@ -1941,10 +1941,10 @@ CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty, (SrcBits == DstBits ? Instruction::BitCast : (SrcBits > DstBits ? Instruction::Trunc : (isSigned ? Instruction::SExt : Instruction::ZExt))); - return create(opcode, C, Ty, Name, InsertAtEnd); + return Create(opcode, C, Ty, Name, InsertAtEnd); } -CastInst *CastInst::createFPCast(Value *C, const Type *Ty, +CastInst *CastInst::CreateFPCast(Value *C, const Type *Ty, const std::string &Name, Instruction *InsertBefore) { assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() && @@ -1954,10 +1954,10 @@ CastInst *CastInst::createFPCast(Value *C, const Type *Ty, Instruction::CastOps opcode = (SrcBits == DstBits ? Instruction::BitCast : (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt)); - return create(opcode, C, Ty, Name, InsertBefore); + return Create(opcode, C, Ty, Name, InsertBefore); } -CastInst *CastInst::createFPCast(Value *C, const Type *Ty, +CastInst *CastInst::CreateFPCast(Value *C, const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd) { assert(C->getType()->isFloatingPoint() && Ty->isFloatingPoint() && @@ -1967,7 +1967,7 @@ CastInst *CastInst::createFPCast(Value *C, const Type *Ty, Instruction::CastOps opcode = (SrcBits == DstBits ? Instruction::BitCast : (SrcBits > DstBits ? Instruction::FPTrunc : Instruction::FPExt)); - return create(opcode, C, Ty, Name, InsertAtEnd); + return Create(opcode, C, Ty, Name, InsertAtEnd); } // Check whether it is valid to call getCastOpcode for these types. @@ -2367,7 +2367,7 @@ CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate, } CmpInst * -CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, +CmpInst::Create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, const std::string &Name, Instruction *InsertBefore) { if (Op == Instruction::ICmp) { return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name, @@ -2386,7 +2386,7 @@ CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, } CmpInst * -CmpInst::create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, +CmpInst::Create(OtherOps Op, unsigned short predicate, Value *S1, Value *S2, const std::string &Name, BasicBlock *InsertAtEnd) { if (Op == Instruction::ICmp) { return new ICmpInst(CmpInst::Predicate(predicate), S1, S2, Name, @@ -2780,7 +2780,7 @@ GetElementPtrInst *GetElementPtrInst::clone() const { } BinaryOperator *BinaryOperator::clone() const { - return create(getOpcode(), Op<0>(), Op<1>()); + return Create(getOpcode(), Op<0>(), Op<1>()); } FCmpInst* FCmpInst::clone() const { |