Changes in directory llvm/lib/VMCore:
AsmWriter.cpp updated: 1.252 -> 1.253 ConstantFolding.cpp updated: 1.131 -> 1.132 Constants.cpp updated: 1.200 -> 1.201 Instructions.cpp updated: 1.62 -> 1.63 Type.cpp updated: 1.160 -> 1.161 Verifier.cpp updated: 1.185 -> 1.186 --- Log message: rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger. rename Type::getIntegralTypeMask to Type::getIntegerTypeMask. This makes naming much more consistent. For example, there are now no longer any instances of IntegerType that are not considered isInteger! :) --- Diffs of the changes: (+85 -85) AsmWriter.cpp | 6 ++-- ConstantFolding.cpp | 14 +++++------ Constants.cpp | 48 ++++++++++++++++++------------------- Instructions.cpp | 66 ++++++++++++++++++++++++++-------------------------- Type.cpp | 2 - Verifier.cpp | 34 +++++++++++++------------- 6 files changed, 85 insertions(+), 85 deletions(-) Index: llvm/lib/VMCore/AsmWriter.cpp diff -u llvm/lib/VMCore/AsmWriter.cpp:1.252 llvm/lib/VMCore/AsmWriter.cpp:1.253 --- llvm/lib/VMCore/AsmWriter.cpp:1.252 Fri Jan 12 13:20:47 2007 +++ llvm/lib/VMCore/AsmWriter.cpp Sun Jan 14 20:27:26 2007 @@ -222,7 +222,7 @@ const Type *Ty = cast<Type>(TI->second); if (!isa<PointerType>(Ty) || !cast<PointerType>(Ty)->getElementType()->isPrimitiveType() || - !cast<PointerType>(Ty)->getElementType()->isIntegral() || + !cast<PointerType>(Ty)->getElementType()->isInteger() || isa<OpaqueType>(cast<PointerType>(Ty)->getElementType())) TypeNames.insert(std::make_pair(Ty, getLLVMName(TI->first))); } @@ -234,7 +234,7 @@ std::vector<const Type *> &TypeStack, std::map<const Type *, std::string> &TypeNames, std::string & Result){ - if (Ty->isIntegral() || (Ty->isPrimitiveType() && !isa<OpaqueType>(Ty))) { + if (Ty->isInteger() || (Ty->isPrimitiveType() && !isa<OpaqueType>(Ty))) { Result += Ty->getDescription(); // Base case return; } @@ -353,7 +353,7 @@ // Primitive types always print out their description, regardless of whether // they have been named or not. // - if (Ty->isIntegral() || (Ty->isPrimitiveType() && !isa<OpaqueType>(Ty))) + if (Ty->isInteger() || (Ty->isPrimitiveType() && !isa<OpaqueType>(Ty))) return Out << Ty->getDescription(); // Check to see if the type is named. Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.131 llvm/lib/VMCore/ConstantFolding.cpp:1.132 --- llvm/lib/VMCore/ConstantFolding.cpp:1.131 Fri Jan 12 12:42:52 2007 +++ llvm/lib/VMCore/ConstantFolding.cpp Sun Jan 14 20:27:26 2007 @@ -51,7 +51,7 @@ // If the src and dest elements are both integers, or both floats, we can // just BitCast each element because the elements are the same size. - if ((SrcEltTy->isIntegral() && DstEltTy->isIntegral()) || + if ((SrcEltTy->isInteger() && DstEltTy->isInteger()) || (SrcEltTy->isFloatingPoint() && DstEltTy->isFloatingPoint())) { for (unsigned i = 0; i != SrcNumElts; ++i) Result.push_back( @@ -60,7 +60,7 @@ } // If this is an int-to-fp cast .. - if (SrcEltTy->isIntegral()) { + if (SrcEltTy->isInteger()) { // Ensure that it is int-to-fp cast assert(DstEltTy->isFloatingPoint()); if (DstEltTy->getTypeID() == Type::DoubleTyID) { @@ -81,7 +81,7 @@ } // Otherwise, this is an fp-to-int cast. - assert(SrcEltTy->isFloatingPoint() && DstEltTy->isIntegral()); + assert(SrcEltTy->isFloatingPoint() && DstEltTy->isInteger()); if (SrcEltTy->getTypeID() == Type::DoubleTyID) { for (unsigned i = 0; i != SrcNumElts; ++i) { @@ -279,7 +279,7 @@ // Handle integral constant input. if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) { // Integral -> Integral, must be changing sign. - if (DestTy->isIntegral()) + if (DestTy->isInteger()) return ConstantInt::get(DestTy, CI->getZExtValue()); if (DestTy->isFloatingPoint()) { @@ -295,7 +295,7 @@ // Handle ConstantFP input. if (const ConstantFP *FP = dyn_cast<ConstantFP>(V)) { // FP -> Integral. - if (DestTy->isIntegral()) { + if (DestTy->isInteger()) { if (DestTy == Type::Int32Ty) return ConstantInt::get(DestTy, FloatToBits(FP->getValue())); assert(DestTy == Type::Int64Ty && @@ -884,7 +884,7 @@ // If the cast is not actually changing bits, and the second operand is a // null pointer, do the comparison with the pre-casted value. if (V2->isNullValue() && - (isa<PointerType>(CE1->getType()) || CE1->getType()->isIntegral())) { + (isa<PointerType>(CE1->getType()) || CE1->getType()->isInteger())) { bool sgnd = CE1->getOpcode() == Instruction::ZExt ? false : (CE1->getOpcode() == Instruction::SExt ? true : (CE1->getOpcode() == Instruction::PtrToInt ? false : isSigned)); @@ -899,7 +899,7 @@ if (const ConstantExpr *CE2 = dyn_cast<ConstantExpr>(V2)) if (CE2->isCast() && isa<PointerType>(CE1->getType()) && CE1->getOperand(0)->getType() == CE2->getOperand(0)->getType() && - CE1->getOperand(0)->getType()->isIntegral()) { + CE1->getOperand(0)->getType()->isInteger()) { bool sgnd = CE1->getOpcode() == Instruction::ZExt ? false : (CE1->getOpcode() == Instruction::SExt ? true : (CE1->getOpcode() == Instruction::PtrToInt ? false : isSigned)); Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.200 llvm/lib/VMCore/Constants.cpp:1.201 --- llvm/lib/VMCore/Constants.cpp:1.200 Sun Jan 14 18:45:50 2007 +++ llvm/lib/VMCore/Constants.cpp Sun Jan 14 20:27:26 2007 @@ -849,7 +849,7 @@ return getTrue(); else return getFalse(); - return IntConstants->getOrCreate(Ty, V & Ty->getIntegralTypeMask()); + return IntConstants->getOrCreate(Ty, V & Ty->getIntegerTypeMask()); } //---- ConstantFP::get() implementation... @@ -1463,16 +1463,16 @@ Constant *ConstantExpr::getPointerCast(Constant *S, const Type *Ty) { assert(isa<PointerType>(S->getType()) && "Invalid cast"); - assert((Ty->isIntegral() || isa<PointerType>(Ty)) && "Invalid cast"); + assert((Ty->isInteger() || isa<PointerType>(Ty)) && "Invalid cast"); - if (Ty->isIntegral()) + if (Ty->isInteger()) return getCast(Instruction::PtrToInt, S, Ty); return getCast(Instruction::BitCast, S, Ty); } Constant *ConstantExpr::getIntegerCast(Constant *C, const Type *Ty, bool isSigned) { - assert(C->getType()->isIntegral() && Ty->isIntegral() && "Invalid cast"); + assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast"); unsigned SrcBits = C->getType()->getPrimitiveSizeInBits(); unsigned DstBits = Ty->getPrimitiveSizeInBits(); Instruction::CastOps opcode = @@ -1495,8 +1495,8 @@ } Constant *ConstantExpr::getTrunc(Constant *C, const Type *Ty) { - assert(C->getType()->isIntegral() && "Trunc operand must be integer"); - assert(Ty->isIntegral() && "Trunc produces only integral"); + assert(C->getType()->isInteger() && "Trunc operand must be integer"); + assert(Ty->isInteger() && "Trunc produces only integral"); assert(C->getType()->getPrimitiveSizeInBits() > Ty->getPrimitiveSizeInBits()&& "SrcTy must be larger than DestTy for Trunc!"); @@ -1504,8 +1504,8 @@ } Constant *ConstantExpr::getSExt(Constant *C, const Type *Ty) { - assert(C->getType()->isIntegral() && "SEXt operand must be integral"); - assert(Ty->isIntegral() && "SExt produces only integer"); + assert(C->getType()->isInteger() && "SEXt operand must be integral"); + assert(Ty->isInteger() && "SExt produces only integer"); assert(C->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()&& "SrcTy must be smaller than DestTy for SExt!"); @@ -1513,8 +1513,8 @@ } Constant *ConstantExpr::getZExt(Constant *C, const Type *Ty) { - assert(C->getType()->isIntegral() && "ZEXt operand must be integral"); - assert(Ty->isIntegral() && "ZExt produces only integer"); + assert(C->getType()->isInteger() && "ZEXt operand must be integral"); + assert(Ty->isInteger() && "ZExt produces only integer"); assert(C->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()&& "SrcTy must be smaller than DestTy for ZExt!"); @@ -1536,37 +1536,37 @@ } Constant *ConstantExpr::getUIToFP(Constant *C, const Type *Ty) { - assert(C->getType()->isIntegral() && Ty->isFloatingPoint() && + assert(C->getType()->isInteger() && Ty->isFloatingPoint() && "This is an illegal uint to floating point cast!"); return getFoldedCast(Instruction::UIToFP, C, Ty); } Constant *ConstantExpr::getSIToFP(Constant *C, const Type *Ty) { - assert(C->getType()->isIntegral() && Ty->isFloatingPoint() && + assert(C->getType()->isInteger() && Ty->isFloatingPoint() && "This is an illegal sint to floating point cast!"); return getFoldedCast(Instruction::SIToFP, C, Ty); } Constant *ConstantExpr::getFPToUI(Constant *C, const Type *Ty) { - assert(C->getType()->isFloatingPoint() && Ty->isIntegral() && + assert(C->getType()->isFloatingPoint() && Ty->isInteger() && "This is an illegal floating point to uint cast!"); return getFoldedCast(Instruction::FPToUI, C, Ty); } Constant *ConstantExpr::getFPToSI(Constant *C, const Type *Ty) { - assert(C->getType()->isFloatingPoint() && Ty->isIntegral() && + assert(C->getType()->isFloatingPoint() && Ty->isInteger() && "This is an illegal floating point to sint cast!"); return getFoldedCast(Instruction::FPToSI, C, Ty); } Constant *ConstantExpr::getPtrToInt(Constant *C, const Type *DstTy) { assert(isa<PointerType>(C->getType()) && "PtrToInt source must be pointer"); - assert(DstTy->isIntegral() && "PtrToInt destination must be integral"); + assert(DstTy->isInteger() && "PtrToInt destination must be integral"); return getFoldedCast(Instruction::PtrToInt, C, DstTy); } Constant *ConstantExpr::getIntToPtr(Constant *C, const Type *DstTy) { - assert(C->getType()->isIntegral() && "IntToPtr source must be integral"); + assert(C->getType()->isInteger() && "IntToPtr source must be integral"); assert(isa<PointerType>(DstTy) && "IntToPtr destination must be a pointer"); return getFoldedCast(Instruction::IntToPtr, C, DstTy); } @@ -1649,15 +1649,15 @@ case Instruction::Sub: case Instruction::Mul: assert(C1->getType() == C2->getType() && "Op types should be identical!"); - assert((C1->getType()->isIntegral() || C1->getType()->isFloatingPoint() || + assert((C1->getType()->isInteger() || C1->getType()->isFloatingPoint() || isa<PackedType>(C1->getType())) && "Tried to create an arithmetic operation on a non-arithmetic type!"); break; case Instruction::UDiv: case Instruction::SDiv: assert(C1->getType() == C2->getType() && "Op types should be identical!"); - assert((C1->getType()->isIntegral() || (isa<PackedType>(C1->getType()) && - cast<PackedType>(C1->getType())->getElementType()->isIntegral())) && + assert((C1->getType()->isInteger() || (isa<PackedType>(C1->getType()) && + cast<PackedType>(C1->getType())->getElementType()->isInteger())) && "Tried to create an arithmetic operation on a non-arithmetic type!"); break; case Instruction::FDiv: @@ -1669,8 +1669,8 @@ case Instruction::URem: case Instruction::SRem: assert(C1->getType() == C2->getType() && "Op types should be identical!"); - assert((C1->getType()->isIntegral() || (isa<PackedType>(C1->getType()) && - cast<PackedType>(C1->getType())->getElementType()->isIntegral())) && + assert((C1->getType()->isInteger() || (isa<PackedType>(C1->getType()) && + cast<PackedType>(C1->getType())->getElementType()->isInteger())) && "Tried to create an arithmetic operation on a non-arithmetic type!"); break; case Instruction::FRem: @@ -1683,14 +1683,14 @@ case Instruction::Or: case Instruction::Xor: assert(C1->getType() == C2->getType() && "Op types should be identical!"); - assert((C1->getType()->isIntegral() || isa<PackedType>(C1->getType())) && + assert((C1->getType()->isInteger() || isa<PackedType>(C1->getType())) && "Tried to create a logical operation on a non-integral type!"); break; case Instruction::Shl: case Instruction::LShr: case Instruction::AShr: assert(C2->getType() == Type::Int8Ty && "Shift should be by ubyte!"); - assert(C1->getType()->isIntegral() && + assert(C1->getType()->isInteger() && "Tried to create a shift operation on a non-integer type!"); break; default: @@ -1732,7 +1732,7 @@ Opcode == Instruction::LShr || Opcode == Instruction::AShr) && "Invalid opcode in binary constant expression"); - assert(C1->getType()->isIntegral() && C2->getType() == Type::Int8Ty && + assert(C1->getType()->isInteger() && C2->getType() == Type::Int8Ty && "Invalid operand types for Shift constant expr!"); if (Constant *FC = ConstantFoldBinaryInstruction(Opcode, C1, C2)) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.62 llvm/lib/VMCore/Instructions.cpp:1.63 --- llvm/lib/VMCore/Instructions.cpp:1.62 Sun Jan 14 20:05:34 2007 +++ llvm/lib/VMCore/Instructions.cpp Sun Jan 14 20:27:26 2007 @@ -1025,7 +1025,7 @@ case Mul: assert(getType() == LHS->getType() && "Arithmetic operation should return same type as operands!"); - assert((getType()->isIntegral() || getType()->isFloatingPoint() || + assert((getType()->isInteger() || getType()->isFloatingPoint() || isa<PackedType>(getType())) && "Tried to create an arithmetic operation on a non-arithmetic type!"); break; @@ -1033,8 +1033,8 @@ case SDiv: assert(getType() == LHS->getType() && "Arithmetic operation should return same type as operands!"); - assert((getType()->isIntegral() || (isa<PackedType>(getType()) && - cast<PackedType>(getType())->getElementType()->isIntegral())) && + assert((getType()->isInteger() || (isa<PackedType>(getType()) && + cast<PackedType>(getType())->getElementType()->isInteger())) && "Incorrect operand type (not integer) for S/UDIV"); break; case FDiv: @@ -1048,8 +1048,8 @@ case SRem: assert(getType() == LHS->getType() && "Arithmetic operation should return same type as operands!"); - assert((getType()->isIntegral() || (isa<PackedType>(getType()) && - cast<PackedType>(getType())->getElementType()->isIntegral())) && + assert((getType()->isInteger() || (isa<PackedType>(getType()) && + cast<PackedType>(getType())->getElementType()->isInteger())) && "Incorrect operand type (not integer) for S/UREM"); break; case FRem: @@ -1063,9 +1063,9 @@ case Xor: assert(getType() == LHS->getType() && "Logical operation should return same type as operands!"); - assert((getType()->isIntegral() || + assert((getType()->isInteger() || (isa<PackedType>(getType()) && - cast<PackedType>(getType())->getElementType()->isIntegral())) && + cast<PackedType>(getType())->getElementType()->isInteger())) && "Tried to create a logical operation on a non-integral type!"); break; default: @@ -1218,7 +1218,7 @@ case Instruction::Trunc: return true; case Instruction::BitCast: - return getOperand(0)->getType()->isIntegral() && getType()->isIntegral(); + return getOperand(0)->getType()->isInteger() && getType()->isInteger(); } } @@ -1351,7 +1351,7 @@ case 3: // no-op cast in second op implies firstOp as long as the DestTy // is integer - if (DstTy->isIntegral()) + if (DstTy->isInteger()) return firstOp; return 0; case 4: @@ -1363,7 +1363,7 @@ case 5: // no-op cast in first op implies secondOp as long as the SrcTy // is an integer - if (SrcTy->isIntegral()) + if (SrcTy->isInteger()) return secondOp; return 0; case 6: @@ -1528,10 +1528,10 @@ const std::string &Name, BasicBlock *InsertAtEnd) { assert(isa<PointerType>(S->getType()) && "Invalid cast"); - assert((Ty->isIntegral() || isa<PointerType>(Ty)) && + assert((Ty->isInteger() || isa<PointerType>(Ty)) && "Invalid cast"); - if (Ty->isIntegral()) + if (Ty->isInteger()) return create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd); return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); } @@ -1541,10 +1541,10 @@ const std::string &Name, Instruction *InsertBefore) { assert(isa<PointerType>(S->getType()) && "Invalid cast"); - assert((Ty->isIntegral() || isa<PointerType>(Ty)) && + assert((Ty->isInteger() || isa<PointerType>(Ty)) && "Invalid cast"); - if (Ty->isIntegral()) + if (Ty->isInteger()) return create(Instruction::PtrToInt, S, Ty, Name, InsertBefore); return create(Instruction::BitCast, S, Ty, Name, InsertBefore); } @@ -1552,7 +1552,7 @@ CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty, bool isSigned, const std::string &Name, Instruction *InsertBefore) { - assert(C->getType()->isIntegral() && Ty->isIntegral() && "Invalid cast"); + assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast"); unsigned SrcBits = C->getType()->getPrimitiveSizeInBits(); unsigned DstBits = Ty->getPrimitiveSizeInBits(); Instruction::CastOps opcode = @@ -1565,7 +1565,7 @@ CastInst *CastInst::createIntegerCast(Value *C, const Type *Ty, bool isSigned, const std::string &Name, BasicBlock *InsertAtEnd) { - assert(C->getType()->isIntegral() && Ty->isIntegral() && "Invalid cast"); + assert(C->getType()->isInteger() && Ty->isInteger() && "Invalid cast"); unsigned SrcBits = C->getType()->getPrimitiveSizeInBits(); unsigned DstBits = Ty->getPrimitiveSizeInBits(); Instruction::CastOps opcode = @@ -1616,8 +1616,8 @@ unsigned DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr/packed // Run through the possibilities ... - if (DestTy->isIntegral()) { // Casting to integral - if (SrcTy->isIntegral()) { // Casting from integral + if (DestTy->isInteger()) { // Casting to integral + if (SrcTy->isInteger()) { // Casting from integral if (DestBits < SrcBits) return Trunc; // int -> smaller int else if (DestBits > SrcBits) { // its an extension @@ -1643,7 +1643,7 @@ return PtrToInt; // ptr -> int } } else if (DestTy->isFloatingPoint()) { // Casting to floating pt - if (SrcTy->isIntegral()) { // Casting from integral + if (SrcTy->isInteger()) { // Casting from integral if (SrcIsSigned) return SIToFP; // sint -> FP else @@ -1676,7 +1676,7 @@ } else if (isa<PointerType>(DestTy)) { if (isa<PointerType>(SrcTy)) { return BitCast; // ptr -> ptr - } else if (SrcTy->isIntegral()) { + } else if (SrcTy->isInteger()) { return IntToPtr; // int -> ptr } else { assert(!"Casting pointer to other than pointer or int"); @@ -1715,11 +1715,11 @@ switch (op) { default: return false; // This is an input error case Instruction::Trunc: - return SrcTy->isIntegral() && DstTy->isIntegral()&& SrcBitSize > DstBitSize; + return SrcTy->isInteger() && DstTy->isInteger()&& SrcBitSize > DstBitSize; case Instruction::ZExt: - return SrcTy->isIntegral() && DstTy->isIntegral()&& SrcBitSize < DstBitSize; + return SrcTy->isInteger() && DstTy->isInteger()&& SrcBitSize < DstBitSize; case Instruction::SExt: - return SrcTy->isIntegral() && DstTy->isIntegral()&& SrcBitSize < DstBitSize; + return SrcTy->isInteger() && DstTy->isInteger()&& SrcBitSize < DstBitSize; case Instruction::FPTrunc: return SrcTy->isFloatingPoint() && DstTy->isFloatingPoint() && SrcBitSize > DstBitSize; @@ -1727,17 +1727,17 @@ return SrcTy->isFloatingPoint() && DstTy->isFloatingPoint() && SrcBitSize < DstBitSize; case Instruction::UIToFP: - return SrcTy->isIntegral() && DstTy->isFloatingPoint(); + return SrcTy->isInteger() && DstTy->isFloatingPoint(); case Instruction::SIToFP: - return SrcTy->isIntegral() && DstTy->isFloatingPoint(); + return SrcTy->isInteger() && DstTy->isFloatingPoint(); case Instruction::FPToUI: - return SrcTy->isFloatingPoint() && DstTy->isIntegral(); + return SrcTy->isFloatingPoint() && DstTy->isInteger(); case Instruction::FPToSI: - return SrcTy->isFloatingPoint() && DstTy->isIntegral(); + return SrcTy->isFloatingPoint() && DstTy->isInteger(); case Instruction::PtrToInt: - return isa<PointerType>(SrcTy) && DstTy->isIntegral(); + return isa<PointerType>(SrcTy) && DstTy->isInteger(); case Instruction::IntToPtr: - return SrcTy->isIntegral() && isa<PointerType>(DstTy); + return SrcTy->isInteger() && isa<PointerType>(DstTy); case Instruction::BitCast: // BitCast implies a no-op cast of type only. No bits change. // However, you can't cast pointers to anything but pointers. @@ -1913,9 +1913,9 @@ assert(Op0Ty == Op1Ty && "Both operands to ICmp instruction are not of the same type!"); // Check that the operands are the right type - assert(Op0Ty->isIntegral() || isa<PointerType>(Op0Ty) || + assert(Op0Ty->isInteger() || isa<PointerType>(Op0Ty) || (isa<PackedType>(Op0Ty) && - cast<PackedType>(Op0Ty)->getElementType()->isIntegral()) && + cast<PackedType>(Op0Ty)->getElementType()->isInteger()) && "Invalid operand types for ICmp instruction"); return; } @@ -1948,9 +1948,9 @@ assert(Op0Ty == Op1Ty && "Both operands to ICmp instruction are not of the same type!"); // Check that the operands are the right type - assert(Op0Ty->isIntegral() || isa<PointerType>(Op0Ty) || + assert(Op0Ty->isInteger() || isa<PointerType>(Op0Ty) || (isa<PackedType>(Op0Ty) && - cast<PackedType>(Op0Ty)->getElementType()->isIntegral()) && + cast<PackedType>(Op0Ty)->getElementType()->isInteger()) && "Invalid operand types for ICmp instruction"); return; } Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.160 llvm/lib/VMCore/Type.cpp:1.161 --- llvm/lib/VMCore/Type.cpp:1.160 Fri Jan 12 19:09:33 2007 +++ llvm/lib/VMCore/Type.cpp Sun Jan 14 20:27:26 2007 @@ -428,7 +428,7 @@ NumElements = NumEl; assert(NumEl > 0 && "NumEl of a PackedType must be greater than 0"); - assert((ElType->isIntegral() || ElType->isFloatingPoint()) && + assert((ElType->isInteger() || ElType->isFloatingPoint()) && "Elements of a PackedType must be a primitive type"); } Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.185 llvm/lib/VMCore/Verifier.cpp:1.186 --- llvm/lib/VMCore/Verifier.cpp:1.185 Sun Jan 14 20:05:34 2007 +++ llvm/lib/VMCore/Verifier.cpp Sun Jan 14 20:27:26 2007 @@ -500,8 +500,8 @@ unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits(); unsigned DestBitSize = DestTy->getPrimitiveSizeInBits(); - Assert1(SrcTy->isIntegral(), "Trunc only operates on integer", &I); - Assert1(DestTy->isIntegral(), "Trunc only produces integer", &I); + Assert1(SrcTy->isInteger(), "Trunc only operates on integer", &I); + Assert1(DestTy->isInteger(), "Trunc only produces integer", &I); Assert1(SrcBitSize > DestBitSize,"DestTy too big for Trunc", &I); visitInstruction(I); @@ -513,8 +513,8 @@ const Type *DestTy = I.getType(); // Get the size of the types in bits, we'll need this later - Assert1(SrcTy->isIntegral(), "ZExt only operates on integer", &I); - Assert1(DestTy->isIntegral(), "ZExt only produces an integer", &I); + Assert1(SrcTy->isInteger(), "ZExt only operates on integer", &I); + Assert1(DestTy->isInteger(), "ZExt only produces an integer", &I); unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits(); unsigned DestBitSize = DestTy->getPrimitiveSizeInBits(); @@ -532,8 +532,8 @@ unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits(); unsigned DestBitSize = DestTy->getPrimitiveSizeInBits(); - Assert1(SrcTy->isIntegral(), "SExt only operates on integer", &I); - Assert1(DestTy->isIntegral(), "SExt only produces an integer", &I); + Assert1(SrcTy->isInteger(), "SExt only operates on integer", &I); + Assert1(DestTy->isInteger(), "SExt only produces an integer", &I); Assert1(SrcBitSize < DestBitSize,"Type too small for SExt", &I); visitInstruction(I); @@ -575,7 +575,7 @@ const Type *SrcTy = I.getOperand(0)->getType(); const Type *DestTy = I.getType(); - Assert1(SrcTy->isIntegral(),"UInt2FP source must be integral", &I); + Assert1(SrcTy->isInteger(),"UInt2FP source must be integral", &I); Assert1(DestTy->isFloatingPoint(),"UInt2FP result must be FP", &I); visitInstruction(I); @@ -586,7 +586,7 @@ const Type *SrcTy = I.getOperand(0)->getType(); const Type *DestTy = I.getType(); - Assert1(SrcTy->isIntegral(),"SInt2FP source must be integral", &I); + Assert1(SrcTy->isInteger(),"SInt2FP source must be integral", &I); Assert1(DestTy->isFloatingPoint(),"SInt2FP result must be FP", &I); visitInstruction(I); @@ -598,7 +598,7 @@ const Type *DestTy = I.getType(); Assert1(SrcTy->isFloatingPoint(),"FP2UInt source must be FP", &I); - Assert1(DestTy->isIntegral(),"FP2UInt result must be integral", &I); + Assert1(DestTy->isInteger(),"FP2UInt result must be integral", &I); visitInstruction(I); } @@ -609,7 +609,7 @@ const Type *DestTy = I.getType(); Assert1(SrcTy->isFloatingPoint(),"FPToSI source must be FP", &I); - Assert1(DestTy->isIntegral(),"FP2ToI result must be integral", &I); + Assert1(DestTy->isInteger(),"FP2ToI result must be integral", &I); visitInstruction(I); } @@ -620,7 +620,7 @@ const Type *DestTy = I.getType(); Assert1(isa<PointerType>(SrcTy), "PtrToInt source must be pointer", &I); - Assert1(DestTy->isIntegral(), "PtrToInt result must be integral", &I); + Assert1(DestTy->isInteger(), "PtrToInt result must be integral", &I); visitInstruction(I); } @@ -630,7 +630,7 @@ const Type *SrcTy = I.getOperand(0)->getType(); const Type *DestTy = I.getType(); - Assert1(SrcTy->isIntegral(), "IntToPtr source must be an integral", &I); + Assert1(SrcTy->isInteger(), "IntToPtr source must be an integral", &I); Assert1(isa<PointerType>(DestTy), "IntToPtr result must be a pointer",&I); visitInstruction(I); @@ -716,9 +716,9 @@ // Check that logical operators are only used with integral operands. if (B.getOpcode() == Instruction::And || B.getOpcode() == Instruction::Or || B.getOpcode() == Instruction::Xor) { - Assert1(B.getType()->isIntegral() || + Assert1(B.getType()->isInteger() || (isa<PackedType>(B.getType()) && - cast<PackedType>(B.getType())->getElementType()->isIntegral()), + cast<PackedType>(B.getType())->getElementType()->isInteger()), "Logical operators only work with integral types!", &B); Assert1(B.getType() == B.getOperand(0)->getType(), "Logical operators must have same type for operands and result!", @@ -728,7 +728,7 @@ Assert1(B.getType() == B.getOperand(0)->getType(), "Arithmetic operators must have same type for operands and result!", &B); - Assert1(B.getType()->isIntegral() || B.getType()->isFloatingPoint() || + Assert1(B.getType()->isInteger() || B.getType()->isFloatingPoint() || isa<PackedType>(B.getType()), "Arithmetic operators must have integer, fp, or packed type!", &B); } @@ -743,7 +743,7 @@ Assert1(Op0Ty == Op1Ty, "Both operands to ICmp instruction are not of the same type!", &IC); // Check that the operands are the right type - Assert1(Op0Ty->isIntegral() || isa<PointerType>(Op0Ty), + Assert1(Op0Ty->isInteger() || isa<PointerType>(Op0Ty), "Invalid operand types for ICmp instruction", &IC); visitInstruction(IC); } @@ -761,7 +761,7 @@ } void Verifier::visitShiftInst(ShiftInst &SI) { - Assert1(SI.getType()->isIntegral(), + Assert1(SI.getType()->isInteger(), "Shift must return an integer result!", &SI); Assert1(SI.getType() == SI.getOperand(0)->getType(), "Shift return type must be same as first operand!", &SI); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits