diff options
Diffstat (limited to 'lib')
29 files changed, 228 insertions, 228 deletions
diff --git a/lib/Analysis/ConstantRange.cpp b/lib/Analysis/ConstantRange.cpp index a1b5247595..3b74f403b3 100644 --- a/lib/Analysis/ConstantRange.cpp +++ b/lib/Analysis/ConstantRange.cpp @@ -31,7 +31,7 @@ using namespace llvm; static ConstantInt *getMaxValue(const Type *Ty, bool isSigned = false) { - if (Ty->isIntegral()) { + if (Ty->isInteger()) { if (isSigned) { // Calculate 011111111111111... unsigned TypeBits = Ty->getPrimitiveSizeInBits(); @@ -46,7 +46,7 @@ static ConstantInt *getMaxValue(const Type *Ty, bool isSigned = false) { // Static constructor to create the minimum constant for an integral type... static ConstantInt *getMinValue(const Type *Ty, bool isSigned = false) { - if (Ty->isIntegral()) { + if (Ty->isInteger()) { if (isSigned) { // Calculate 1111111111000000000000 unsigned TypeBits = Ty->getPrimitiveSizeInBits(); @@ -93,7 +93,7 @@ static ConstantInt *Max(ConstantInt *A, ConstantInt *B, /// Initialize a full (the default) or empty set for the specified type. /// ConstantRange::ConstantRange(const Type *Ty, bool Full) { - assert(Ty->isIntegral() && + assert(Ty->isInteger() && "Cannot make constant range of non-integral type!"); if (Full) Lower = Upper = getMaxValue(Ty); @@ -225,7 +225,7 @@ bool ConstantRange::contains(ConstantInt *Val, bool isSigned) const { /// subtract - Subtract the specified constant from the endpoints of this /// constant range. ConstantRange ConstantRange::subtract(ConstantInt *CI) const { - assert(CI->getType() == getType() && getType()->isIntegral() && + assert(CI->getType() == getType() && getType()->isInteger() && "Cannot subtract from different type range or non-integer!"); // If the set is empty or full, don't modify the endpoints. if (Lower == Upper) return *this; diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 8f8b8f2c94..f961b467b7 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -122,7 +122,7 @@ void SCEV::dump() const { /// known to have. This method is only valid on integer SCEV objects. ConstantRange SCEV::getValueRange() const { const Type *Ty = getType(); - assert(Ty->isIntegral() && "Can't get range for a non-integer SCEV!"); + assert(Ty->isInteger() && "Can't get range for a non-integer SCEV!"); // Default to a full range if no better information is available. return ConstantRange(getType()); } @@ -194,7 +194,7 @@ static ManagedStatic<std::map<std::pair<SCEV*, const Type*>, SCEVTruncateExpr::SCEVTruncateExpr(const SCEVHandle &op, const Type *ty) : SCEV(scTruncate), Op(op), Ty(ty) { - assert(Op->getType()->isIntegral() && Ty->isIntegral() && + assert(Op->getType()->isInteger() && Ty->isInteger() && "Cannot truncate non-integer value!"); assert(Op->getType()->getPrimitiveSizeInBits() > Ty->getPrimitiveSizeInBits() && "This is not a truncating conversion!"); @@ -220,7 +220,7 @@ static ManagedStatic<std::map<std::pair<SCEV*, const Type*>, SCEVZeroExtendExpr::SCEVZeroExtendExpr(const SCEVHandle &op, const Type *ty) : SCEV(scZeroExtend), Op(op), Ty(ty) { - assert(Op->getType()->isIntegral() && Ty->isIntegral() && + assert(Op->getType()->isInteger() && Ty->isInteger() && "Cannot zero extend non-integer value!"); assert(Op->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits() && "This is not an extending conversion!"); @@ -459,7 +459,7 @@ SCEVHandle SCEVUnknown::getIntegerSCEV(int Val, const Type *Ty) { /// extended. static SCEVHandle getTruncateOrZeroExtend(const SCEVHandle &V, const Type *Ty) { const Type *SrcTy = V->getType(); - assert(SrcTy->isIntegral() && Ty->isIntegral() && + assert(SrcTy->isInteger() && Ty->isInteger() && "Cannot truncate or zero extend with non-integer arguments!"); if (SrcTy->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) return V; // No conversion @@ -1333,7 +1333,7 @@ static uint64_t GetConstantFactor(SCEVHandle S) { if (SCEVTruncateExpr *T = dyn_cast<SCEVTruncateExpr>(S)) return GetConstantFactor(T->getOperand()) & - T->getType()->getIntegralTypeMask(); + T->getType()->getIntegerTypeMask(); if (SCEVZeroExtendExpr *E = dyn_cast<SCEVZeroExtendExpr>(S)) return GetConstantFactor(E->getOperand()); @@ -1421,8 +1421,8 @@ SCEVHandle ScalarEvolutionsImpl::createSCEV(Value *V) { case Instruction::BitCast: // BitCasts are no-op casts so we just eliminate the cast. - if (I->getType()->isIntegral() && - I->getOperand(0)->getType()->isIntegral()) + if (I->getType()->isInteger() && + I->getOperand(0)->getType()->isInteger()) return getSCEV(I->getOperand(0)); break; @@ -2186,7 +2186,7 @@ SCEVHandle ScalarEvolutionsImpl::HowFarToZero(SCEV *V, const Loop *L) { } } } - } else if (AddRec->isQuadratic() && AddRec->getType()->isIntegral()) { + } else if (AddRec->isQuadratic() && AddRec->getType()->isInteger()) { // If this is a quadratic (3-term) AddRec {L,+,M,+,N}, find the roots of // the quadratic equation to solve it. std::pair<SCEVHandle,SCEVHandle> Roots = SolveQuadraticEquation(AddRec); @@ -2314,7 +2314,7 @@ HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L) { } if (Cond == ICmpInst::ICMP_SLT) { - if (PreCondLHS->getType()->isIntegral()) { + if (PreCondLHS->getType()->isInteger()) { if (RHS != getSCEV(PreCondRHS)) return UnknownValue; // Not a comparison against 'm'. @@ -2567,14 +2567,14 @@ void ScalarEvolution::print(std::ostream &OS, const Module* ) const { OS << "Classifying expressions for: " << F.getName() << "\n"; for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) - if (I->getType()->isIntegral()) { + if (I->getType()->isInteger()) { OS << *I; OS << " --> "; SCEVHandle SV = getSCEV(&*I); SV->print(OS); OS << "\t\t"; - if ((*I).getType()->isIntegral()) { + if ((*I).getType()->isInteger()) { ConstantRange Bounds = SV->getValueRange(); if (!Bounds.isFullSet()) OS << "Bounds: " << Bounds << " "; diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp index 6bc113e0bc..e9e7e794ce 100644 --- a/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/lib/Analysis/ScalarEvolutionExpander.cpp @@ -92,7 +92,7 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) { const Type *Ty = S->getType(); const Loop *L = S->getLoop(); // We cannot yet do fp recurrences, e.g. the xform of {X,+,F} --> X+{0,+,F} - assert(Ty->isIntegral() && "Cannot expand fp recurrences yet!"); + assert(Ty->isInteger() && "Cannot expand fp recurrences yet!"); // {X,+,F} --> X + {0,+,F} if (!isa<SCEVConstant>(S->getStart()) || diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs index 39a474fe2a..1d3a05d0d7 100644 --- a/lib/AsmParser/llvmAsmParser.cpp.cvs +++ b/lib/AsmParser/llvmAsmParser.cpp.cvs @@ -2791,7 +2791,7 @@ case 118: const llvm::Type* ElemTy = yyvsp[-1].TypeVal->get(); if ((unsigned)yyvsp[-3].UInt64Val != yyvsp[-3].UInt64Val) GEN_ERROR("Unsigned result not equal to signed result"); - if (!ElemTy->isFloatingPoint() && !ElemTy->isIntegral()) + if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a PackedType must be primitive"); if (!isPowerOf2_32(yyvsp[-3].UInt64Val)) GEN_ERROR("Vector length should be a power of 2!"); @@ -3359,9 +3359,9 @@ case 156: { if (yyvsp[-3].ConstVal->getType() != yyvsp[-1].ConstVal->getType()) GEN_ERROR("Logical operator types must match!"); - if (!yyvsp[-3].ConstVal->getType()->isIntegral()) { + if (!yyvsp[-3].ConstVal->getType()->isInteger()) { if (!isa<PackedType>(yyvsp[-3].ConstVal->getType()) || - !cast<PackedType>(yyvsp[-3].ConstVal->getType())->getElementType()->isIntegral()) + !cast<PackedType>(yyvsp[-3].ConstVal->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands!"); } yyval.ConstVal = ConstantExpr::get(yyvsp[-5].BinaryOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); @@ -3389,7 +3389,7 @@ case 159: { if (yyvsp[-1].ConstVal->getType() != Type::Int8Ty) GEN_ERROR("Shift count for shift constant must be i8 type!"); - if (!yyvsp[-3].ConstVal->getType()->isIntegral()) + if (!yyvsp[-3].ConstVal->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); CHECK_FOR_ERROR; yyval.ConstVal = ConstantExpr::get(yyvsp[-5].OtherOpVal, yyvsp[-3].ConstVal, yyvsp[-1].ConstVal); @@ -4371,7 +4371,7 @@ case 261: { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - if (!(*yyvsp[-3].TypeVal)->isIntegral() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && + if (!(*yyvsp[-3].TypeVal)->isInteger() && !(*yyvsp[-3].TypeVal)->isFloatingPoint() && !isa<PackedType>((*yyvsp[-3].TypeVal).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands!"); @@ -4395,9 +4395,9 @@ case 262: { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*yyvsp[-3].TypeVal)->getDescription()); - if (!(*yyvsp[-3].TypeVal)->isIntegral()) { + if (!(*yyvsp[-3].TypeVal)->isInteger()) { if (!isa<PackedType>(yyvsp[-3].TypeVal->get()) || - !cast<PackedType>(yyvsp[-3].TypeVal->get())->getElementType()->isIntegral()) + !cast<PackedType>(yyvsp[-3].TypeVal->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands!"); } Value* tmpVal1 = getVal(*yyvsp[-3].TypeVal, yyvsp[-2].ValIDVal); @@ -4447,7 +4447,7 @@ case 265: { if (yyvsp[0].ValueVal->getType() != Type::Int8Ty) GEN_ERROR("Shift amount must be i8 type!"); - if (!yyvsp[-2].ValueVal->getType()->isIntegral()) + if (!yyvsp[-2].ValueVal->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); CHECK_FOR_ERROR; yyval.InstVal = new ShiftInst(yyvsp[-3].OtherOpVal, yyvsp[-2].ValueVal, yyvsp[0].ValueVal); diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 2aae3faf6d..59aaf25df3 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -1274,7 +1274,7 @@ Types const llvm::Type* ElemTy = $4->get(); if ((unsigned)$2 != $2) GEN_ERROR("Unsigned result not equal to signed result"); - if (!ElemTy->isFloatingPoint() && !ElemTy->isIntegral()) + if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a PackedType must be primitive"); if (!isPowerOf2_32($2)) GEN_ERROR("Vector length should be a power of 2!"); @@ -1756,9 +1756,9 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' { | LogicalOps '(' ConstVal ',' ConstVal ')' { if ($3->getType() != $5->getType()) GEN_ERROR("Logical operator types must match!"); - if (!$3->getType()->isIntegral()) { + if (!$3->getType()->isInteger()) { if (!isa<PackedType>($3->getType()) || - !cast<PackedType>($3->getType())->getElementType()->isIntegral()) + !cast<PackedType>($3->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands!"); } $$ = ConstantExpr::get($1, $3, $5); @@ -1777,7 +1777,7 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' { | ShiftOps '(' ConstVal ',' ConstVal ')' { if ($5->getType() != Type::Int8Ty) GEN_ERROR("Shift count for shift constant must be i8 type!"); - if (!$3->getType()->isIntegral()) + if (!$3->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); CHECK_FOR_ERROR; $$ = ConstantExpr::get($1, $3, $5); @@ -2573,7 +2573,7 @@ OptTailCall : TAIL CALL { InstVal : ArithmeticOps Types ValueRef ',' ValueRef { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); - if (!(*$2)->isIntegral() && !(*$2)->isFloatingPoint() && + if (!(*$2)->isInteger() && !(*$2)->isFloatingPoint() && !isa<PackedType>((*$2).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands!"); @@ -2594,9 +2594,9 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { | LogicalOps Types ValueRef ',' ValueRef { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); - if (!(*$2)->isIntegral()) { + if (!(*$2)->isInteger()) { if (!isa<PackedType>($2->get()) || - !cast<PackedType>($2->get())->getElementType()->isIntegral()) + !cast<PackedType>($2->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands!"); } Value* tmpVal1 = getVal(*$2, $3); @@ -2637,7 +2637,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { | ShiftOps ResolvedVal ',' ResolvedVal { if ($4->getType() != Type::Int8Ty) GEN_ERROR("Shift amount must be i8 type!"); - if (!$2->getType()->isIntegral()) + if (!$2->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); CHECK_FOR_ERROR; $$ = new ShiftInst($1, $2, $4); diff --git a/lib/AsmParser/llvmAsmParser.y.cvs b/lib/AsmParser/llvmAsmParser.y.cvs index 2aae3faf6d..59aaf25df3 100644 --- a/lib/AsmParser/llvmAsmParser.y.cvs +++ b/lib/AsmParser/llvmAsmParser.y.cvs @@ -1274,7 +1274,7 @@ Types const llvm::Type* ElemTy = $4->get(); if ((unsigned)$2 != $2) GEN_ERROR("Unsigned result not equal to signed result"); - if (!ElemTy->isFloatingPoint() && !ElemTy->isIntegral()) + if (!ElemTy->isFloatingPoint() && !ElemTy->isInteger()) GEN_ERROR("Element type of a PackedType must be primitive"); if (!isPowerOf2_32($2)) GEN_ERROR("Vector length should be a power of 2!"); @@ -1756,9 +1756,9 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' { | LogicalOps '(' ConstVal ',' ConstVal ')' { if ($3->getType() != $5->getType()) GEN_ERROR("Logical operator types must match!"); - if (!$3->getType()->isIntegral()) { + if (!$3->getType()->isInteger()) { if (!isa<PackedType>($3->getType()) || - !cast<PackedType>($3->getType())->getElementType()->isIntegral()) + !cast<PackedType>($3->getType())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands!"); } $$ = ConstantExpr::get($1, $3, $5); @@ -1777,7 +1777,7 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' { | ShiftOps '(' ConstVal ',' ConstVal ')' { if ($5->getType() != Type::Int8Ty) GEN_ERROR("Shift count for shift constant must be i8 type!"); - if (!$3->getType()->isIntegral()) + if (!$3->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); CHECK_FOR_ERROR; $$ = ConstantExpr::get($1, $3, $5); @@ -2573,7 +2573,7 @@ OptTailCall : TAIL CALL { InstVal : ArithmeticOps Types ValueRef ',' ValueRef { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); - if (!(*$2)->isIntegral() && !(*$2)->isFloatingPoint() && + if (!(*$2)->isInteger() && !(*$2)->isFloatingPoint() && !isa<PackedType>((*$2).get())) GEN_ERROR( "Arithmetic operator requires integer, FP, or packed operands!"); @@ -2594,9 +2594,9 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { | LogicalOps Types ValueRef ',' ValueRef { if (!UpRefs.empty()) GEN_ERROR("Invalid upreference in type: " + (*$2)->getDescription()); - if (!(*$2)->isIntegral()) { + if (!(*$2)->isInteger()) { if (!isa<PackedType>($2->get()) || - !cast<PackedType>($2->get())->getElementType()->isIntegral()) + !cast<PackedType>($2->get())->getElementType()->isInteger()) GEN_ERROR("Logical operator requires integral operands!"); } Value* tmpVal1 = getVal(*$2, $3); @@ -2637,7 +2637,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { | ShiftOps ResolvedVal ',' ResolvedVal { if ($4->getType() != Type::Int8Ty) GEN_ERROR("Shift amount must be i8 type!"); - if (!$2->getType()->isIntegral()) + if (!$2->getType()->isInteger()) GEN_ERROR("Shift constant expression requires integer operand!"); CHECK_FOR_ERROR; $$ = new ShiftInst($1, $2, $4); diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp index dab25cad99..2013524939 100644 --- a/lib/Bytecode/Writer/Writer.cpp +++ b/lib/Bytecode/Writer/Writer.cpp @@ -292,7 +292,7 @@ void BytecodeWriter::outputType(const Type *T) { } void BytecodeWriter::outputConstant(const Constant *CPV) { - assert(((CPV->getType()->isPrimitiveType() || CPV->getType()->isIntegral()) || + assert(((CPV->getType()->isPrimitiveType() || CPV->getType()->isInteger()) || !CPV->isNullValue()) && "Shouldn't output null constants!"); // We must check for a ConstantExpr before switching by type because diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 398a7b33d1..606c4b8ba5 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -455,7 +455,7 @@ void AsmPrinter::EmitConstantValueOnly(const Constant *CV) { // We can emit the pointer value into this slot if the slot is an // integer slot greater or equal to the size of the pointer. - if (Ty->isIntegral() && + if (Ty->isInteger() && TD->getTypeSize(Ty) >= TD->getTypeSize(Op->getType())) return EmitConstantValueOnly(Op); diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index beb5ea21c7..72a1d1485b 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -107,7 +107,7 @@ void IntrinsicLowering::AddPrototypes(Module &M) { /// LowerBSWAP - Emit the code to lower bswap of V before the specified /// instruction IP. static Value *LowerBSWAP(Value *V, Instruction *IP) { - assert(V->getType()->isIntegral() && "Can't bswap a non-integer type!"); + assert(V->getType()->isInteger() && "Can't bswap a non-integer type!"); unsigned BitSize = V->getType()->getPrimitiveSizeInBits(); @@ -193,7 +193,7 @@ static Value *LowerBSWAP(Value *V, Instruction *IP) { /// LowerCTPOP - Emit the code to lower ctpop of V before the specified /// instruction IP. static Value *LowerCTPOP(Value *V, Instruction *IP) { - assert(V->getType()->isIntegral() && "Can't ctpop a non-integer type!"); + assert(V->getType()->isInteger() && "Can't ctpop a non-integer type!"); static const uint64_t MaskValues[6] = { 0x5555555555555555ULL, 0x3333333333333333ULL, diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp index 3cba14b3e7..c93dc620ed 100644 --- a/lib/ExecutionEngine/Interpreter/Execution.cpp +++ b/lib/ExecutionEngine/Interpreter/Execution.cpp @@ -891,7 +891,7 @@ void Interpreter::popStackAndReturnValueToCaller (const Type *RetTy, ECStack.pop_back(); if (ECStack.empty()) { // Finished main. Put result into exit code... - if (RetTy && RetTy->isIntegral()) { // Nonvoid return type? + if (RetTy && RetTy->isInteger()) { // Nonvoid return type? ExitValue = Result; // Capture the exit value of the program } else { memset(&ExitValue, 0, sizeof(ExitValue)); @@ -1170,7 +1170,7 @@ void Interpreter::visitCallSite(CallSite CS) { // this by zero or sign extending the value as appropriate according to the // source type. const Type *Ty = V->getType(); - if (Ty->isIntegral()) { + if (Ty->isInteger()) { if (Ty->getPrimitiveSizeInBits() == 1) ArgVals.back().Int32Val = ArgVals.back().Int1Val; else if (Ty->getPrimitiveSizeInBits() <= 8) @@ -1541,14 +1541,14 @@ GenericValue Interpreter::executeBitCastInst(Value *SrcVal, const Type *DstTy, if (isa<PointerType>(DstTy)) { assert(isa<PointerType>(SrcTy) && "Invalid BitCast"); Dest.PointerVal = Src.PointerVal; - } else if (DstTy->isIntegral()) { + } else if (DstTy->isInteger()) { const IntegerType *DITy = cast<IntegerType>(DstTy); unsigned DBitWidth = DITy->getBitWidth(); if (SrcTy == Type::FloatTy) { Dest.Int32Val = FloatToBits(Src.FloatVal); } else if (SrcTy == Type::DoubleTy) { Dest.Int64Val = DoubleToBits(Src.DoubleVal); - } else if (SrcTy->isIntegral()) { + } else if (SrcTy->isInteger()) { const IntegerType *SITy = cast<IntegerType>(SrcTy); unsigned SBitWidth = SITy->getBitWidth(); assert(SBitWidth <= 64 && "Integer types > 64 bits not supported"); @@ -1566,12 +1566,12 @@ GenericValue Interpreter::executeBitCastInst(Value *SrcVal, const Type *DstTy, } else assert(0 && "Invalid BitCast"); } else if (DstTy == Type::FloatTy) { - if (SrcTy->isIntegral()) + if (SrcTy->isInteger()) Dest.FloatVal = BitsToFloat(Src.Int32Val); else Dest.FloatVal = Src.FloatVal; } else if (DstTy == Type::DoubleTy) { - if (SrcTy->isIntegral()) + if (SrcTy->isInteger()) Dest.DoubleVal = BitsToDouble(Src.Int64Val); else Dest.DoubleVal = Src.DoubleVal; diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp index a1b5247595..3b74f403b3 100644 --- a/lib/Support/ConstantRange.cpp +++ b/lib/Support/ConstantRange.cpp @@ -31,7 +31,7 @@ using namespace llvm; static ConstantInt *getMaxValue(const Type *Ty, bool isSigned = false) { - if (Ty->isIntegral()) { + if (Ty->isInteger()) { if (isSigned) { // Calculate 011111111111111... unsigned TypeBits = Ty->getPrimitiveSizeInBits(); @@ -46,7 +46,7 @@ static ConstantInt *getMaxValue(const Type *Ty, bool isSigned = false) { // Static constructor to create the minimum constant for an integral type... static ConstantInt *getMinValue(const Type *Ty, bool isSigned = false) { - if (Ty->isIntegral()) { + if (Ty->isInteger()) { if (isSigned) { // Calculate 1111111111000000000000 unsigned TypeBits = Ty->getPrimitiveSizeInBits(); @@ -93,7 +93,7 @@ static ConstantInt *Max(ConstantInt *A, ConstantInt *B, /// Initialize a full (the default) or empty set for the specified type. /// ConstantRange::ConstantRange(const Type *Ty, bool Full) { - assert(Ty->isIntegral() && + assert(Ty->isInteger() && "Cannot make constant range of non-integral type!"); if (Full) Lower = Upper = getMaxValue(Ty); @@ -225,7 +225,7 @@ bool ConstantRange::contains(ConstantInt *Val, bool isSigned) const { /// subtract - Subtract the specified constant from the endpoints of this /// constant range. ConstantRange ConstantRange::subtract(ConstantInt *CI) const { - assert(CI->getType() == getType() && getType()->isIntegral() && + assert(CI->getType() == getType() && getType()->isInteger() && "Cannot subtract from different type range or non-integer!"); // If the set is empty or full, don't modify the endpoints. if (Lower == Upper) return *this; diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index afc8c8002c..8a6a0a9df2 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -366,7 +366,7 @@ void CWriter::printStructReturnPointerFunctionType(std::ostream &Out, std::ostream & CWriter::printSimpleType(std::ostream &Out, const Type *Ty, bool isSigned, const std::string &NameSoFar) { - assert((Ty->isPrimitiveType() || Ty->isIntegral()) && + assert((Ty->isPrimitiveType() || Ty->isInteger()) && "Invalid type for printSimpleType"); switch (Ty->getTypeID()) { case Type::VoidTyID: return Out << "void " << NameSoFar; @@ -399,7 +399,7 @@ CWriter::printSimpleType(std::ostream &Out, const Type *Ty, bool isSigned, std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty, bool isSigned, const std::string &NameSoFar, bool IgnoreName) { - if (Ty->isPrimitiveType() || Ty->isIntegral()) { + if (Ty->isPrimitiveType() || Ty->isInteger()) { printSimpleType(Out, Ty, isSigned, NameSoFar); return Out; } @@ -1022,7 +1022,7 @@ bool CWriter::printConstExprCast(const ConstantExpr* CE) { } if (NeedsExplicitCast) { Out << "(("; - if (Ty->isIntegral() && Ty != Type::Int1Ty) + if (Ty->isInteger() && Ty != Type::Int1Ty) printSimpleType(Out, Ty, TypeIsSigned); else printType(Out, Ty); // not integer, sign doesn't matter @@ -1225,7 +1225,7 @@ void CWriter::writeOperandWithCast(Value* Operand, ICmpInst::Predicate predicate // operand. if (shouldCast) { Out << "(("; - if (OpTy->isIntegral() && OpTy != Type::Int1Ty) + if (OpTy->isInteger() && OpTy != Type::Int1Ty) printSimpleType(Out, OpTy, castIsSigned); else printType(Out, OpTy); // not integer, sign doesn't matter @@ -1727,7 +1727,7 @@ void CWriter::printModuleTypes(const TypeSymbolTable &TST) { void CWriter::printContainedStructs(const Type *Ty, std::set<const StructType*> &StructPrinted){ // Don't walk through pointers. - if (isa<PointerType>(Ty) || Ty->isPrimitiveType() || Ty->isIntegral()) return; + if (isa<PointerType>(Ty) || Ty->isPrimitiveType() || Ty->isInteger()) return; // Print all contained types first. for (Type::subtype_iterator I = Ty->subtype_begin(), @@ -1848,8 +1848,8 @@ static inline bool isFPIntBitCast(const Instruction &I) { return false; const Type *SrcTy = I.getOperand(0)->getType(); const Type *DstTy = I.getType(); - return (SrcTy->isFloatingPoint() && DstTy->isIntegral()) || - (DstTy->isFloatingPoint() && SrcTy->isIntegral()); + return (SrcTy->isFloatingPoint() && DstTy->isInteger()) || + (DstTy->isFloatingPoint() && SrcTy->isInteger()); } void CWriter::printFunction(Function &F) { diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp index 9a8ea0fef9..5f15645181 100644 --- a/lib/Target/X86/X86TargetAsmInfo.cpp +++ b/lib/Target/X86/X86TargetAsmInfo.cpp @@ -174,7 +174,7 @@ bool X86TargetAsmInfo::LowerToBSwap(CallInst *CI) const { // Verify this is a simple bswap. if (CI->getNumOperands() != 2 || CI->getType() != CI->getOperand(1)->getType() || - !CI->getType()->isIntegral()) + !CI->getType()->isInteger()) return false; const Type *Ty = CI->getType(); diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp index 63f3209401..1ed804e23d 100644 --- a/lib/Transforms/ExprTypeConvert.cpp +++ b/lib/Transforms/ExprTypeConvert.cpp @@ -69,19 +69,19 @@ bool llvm::ExpressionConvertibleToType(Value *V, const Type *Ty, case Instruction::Add: case Instruction::Sub: - if (!Ty->isIntegral() && !Ty->isFloatingPoint()) return false; + if (!Ty->isInteger() && !Ty->isFloatingPoint()) return false; if (!ExpressionConvertibleToType(I->getOperand(0), Ty, CTMap, TD) || !ExpressionConvertibleToType(I->getOperand(1), Ty, CTMap, TD)) return false; break; case Instruction::LShr: case Instruction::AShr: - if (!Ty->isIntegral()) return false; + if (!Ty->isInteger()) return false; if (!ExpressionConvertibleToType(I->getOperand(0), Ty, CTMap, TD)) return false; break; case Instruction::Shl: - if (!Ty->isIntegral()) return false; + if (!Ty->isInteger()) return false; if (!ExpressionConvertibleToType(I->getOperand(0), Ty, CTMap, TD)) return false; break; @@ -458,7 +458,7 @@ static bool OperandConvertibleToType(User *U, Value *V, const Type *Ty, case Instruction::Add: case Instruction::Sub: { - if (!Ty->isIntegral() && !Ty->isFloatingPoint()) return false; + if (!Ty->isInteger() && !Ty->isFloatingPoint()) return false; Value *OtherOp = I->getOperand((V == I->getOperand(0)) ? 1 : 0); return ValueConvertibleToType(I, Ty, CTMap, TD) && |