aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpander.h6
-rw-r--r--include/llvm/CodeGen/MachOWriter.h2
-rw-r--r--include/llvm/Type.h18
-rw-r--r--lib/Analysis/ConstantRange.cpp8
-rw-r--r--lib/Analysis/ScalarEvolution.cpp22
-rw-r--r--lib/Analysis/ScalarEvolutionExpander.cpp2
-rw-r--r--lib/AsmParser/llvmAsmParser.cpp.cvs16
-rw-r--r--lib/AsmParser/llvmAsmParser.y16
-rw-r--r--lib/AsmParser/llvmAsmParser.y.cvs16
-rw-r--r--lib/Bytecode/Writer/Writer.cpp2
-rw-r--r--lib/CodeGen/AsmPrinter.cpp2
-rw-r--r--lib/CodeGen/IntrinsicLowering.cpp4
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp12
-rw-r--r--lib/Support/ConstantRange.cpp8
-rw-r--r--lib/Target/CBackend/CBackend.cpp14
-rw-r--r--lib/Target/X86/X86TargetAsmInfo.cpp2
-rw-r--r--lib/Transforms/ExprTypeConvert.cpp12
-rw-r--r--lib/Transforms/IPO/DeadTypeElimination.cpp4
-rw-r--r--lib/Transforms/IPO/SimplifyLibCalls.cpp10
-rw-r--r--lib/Transforms/Scalar/CorrelatedExprs.cpp2
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp6
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp108
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp2
-rw-r--r--lib/Transforms/Scalar/Reassociate.cpp2
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp14
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp2
-rw-r--r--lib/VMCore/AsmWriter.cpp6
-rw-r--r--lib/VMCore/ConstantFold.cpp14
-rw-r--r--lib/VMCore/Constants.cpp48
-rw-r--r--lib/VMCore/Instructions.cpp66
-rw-r--r--lib/VMCore/Type.cpp2
-rw-r--r--lib/VMCore/Verifier.cpp34
-rw-r--r--tools/llvm2cpp/CppWriter.cpp6
33 files changed, 241 insertions, 247 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h
index 8a994b322a..80e0a9d8cf 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpander.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpander.h
@@ -60,7 +60,7 @@ namespace llvm {
/// loop (inserting one if there is none). A canonical induction variable
/// starts at zero and steps by one on each iteration.
Value *getOrInsertCanonicalInductionVariable(const Loop *L, const Type *Ty){
- assert((Ty->isIntegral() || Ty->isFloatingPoint()) &&
+ assert((Ty->isInteger() || Ty->isFloatingPoint()) &&
"Can only insert integer or floating point induction variables!");
SCEVHandle H = SCEVAddRecExpr::get(SCEVUnknown::getIntegerSCEV(0, Ty),
SCEVUnknown::getIntegerSCEV(1, Ty), L);
@@ -106,9 +106,9 @@ namespace llvm {
Value *expandInTy(SCEV *S, const Type *Ty) {
Value *V = expand(S);
if (Ty && V->getType() != Ty) {
- if (isa<PointerType>(Ty) && V->getType()->isIntegral())
+ if (isa<PointerType>(Ty) && V->getType()->isInteger())
return InsertCastOfTo(Instruction::IntToPtr, V, Ty);
- else if (Ty->isIntegral() && isa<PointerType>(V->getType()))
+ else if (Ty->isInteger() && isa<PointerType>(V->getType()))
return InsertCastOfTo(Instruction::PtrToInt, V, Ty);
else if (Ty->getPrimitiveSizeInBits() ==
V->getType()->getPrimitiveSizeInBits())
diff --git a/include/llvm/CodeGen/MachOWriter.h b/include/llvm/CodeGen/MachOWriter.h
index e83fb3039d..cf5390717c 100644
--- a/include/llvm/CodeGen/MachOWriter.h
+++ b/include/llvm/CodeGen/MachOWriter.h
@@ -534,7 +534,7 @@ namespace llvm {
}
MachOSection *getConstSection(const Type *Ty) {
// FIXME: support cstring literals and pointer literal
- if (Ty->isPrimitiveType() || Ty->isIntegral()) {
+ if (Ty->isPrimitiveType() || Ty->isInteger()) {
unsigned Size = TM.getTargetData()->getTypeSize(Ty);
switch(Size) {
default: break; // Fall through to __TEXT,__const
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index b95f146deb..2f83328a2d 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -160,14 +160,9 @@ public:
/// getDescription - Return the string representation of the type...
const std::string &getDescription() const;
- /// isInteger - Equivalent to isSigned() || isUnsigned()
+ /// isInteger - True if this is an instance of IntegerType.
///
- bool isInteger() const { return ID == IntegerTyID && this != Int1Ty; }
-
- /// isIntegral - Returns true if this is an integral type, which is either
- /// Int1Ty or one of the Integer types.
- ///
- bool isIntegral() const { return ID == IntegerTyID; }
+ bool isInteger() const { return ID == IntegerTyID; }
/// isFloatingPoint - Return true if this is one of the two floating point
/// types
@@ -209,8 +204,7 @@ public:
///
bool isSized() const {
// If it's a primitive, it is always sized.
- if (ID == IntegerTyID || (ID >= FloatTyID && ID <= DoubleTyID) ||
- ID == PointerTyID)
+ if (ID == IntegerTyID || isFloatingPoint() || ID == PointerTyID)
return true;
// If it is not something that can have a size (e.g. a function or label),
// it doesn't have a size.
@@ -228,11 +222,11 @@ public:
///
unsigned getPrimitiveSizeInBits() const;
- /// getIntegralTypeMask - Return a bitmask with ones set for all of the bits
+ /// getIntegerTypeMask - Return a bitmask with ones set for all of the bits
/// that can be set by an unsigned version of this type. This is 0xFF for
/// sbyte/ubyte, 0xFFFF for shorts, etc.
- uint64_t getIntegralTypeMask() const {
- assert(isIntegral() && "This only works for integral types!");
+ uint64_t getIntegerTypeMask() const {
+ assert(isInteger() && "This only works for integer types!");
return ~uint64_t(0UL) >> (64-getPrimitiveSizeInBits());
}
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 << "((";