[llvm-commits] [llvm-gcc-4.2] r96225 - in /llvm-gcc-4.2/trunk/gcc: config/arm/llvm-arm.cpp config/i386/llvm-i386.cpp config/rs6000/llvm-rs6000.cpp llvm-abi-default.cpp llvm-abi-linux-ppc.cpp llvm-convert.cpp llvm-types.cpp
Duncan Sands
baldrick at free.fr
Mon Feb 15 08:24:42 PST 2010
Author: baldrick
Date: Mon Feb 15 10:24:42 2010
New Revision: 96225
URL: http://llvm.org/viewvc/llvm-project?rev=96225&view=rev
Log:
Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!
Modified:
llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp
llvm-gcc-4.2/trunk/gcc/llvm-abi-default.cpp
llvm-gcc-4.2/trunk/gcc/llvm-abi-linux-ppc.cpp
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp?rev=96225&r1=96224&r2=96225&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/llvm-arm.cpp Mon Feb 15 10:24:42 2010
@@ -140,7 +140,7 @@
assert(VTy && "expected a vector type");
const Type *ElTy = VTy->getElementType();
if (Val->getType() != ElTy) {
- assert(!ElTy->isFloatingPoint() &&
+ assert(!ElTy->isFloatingPointTy() &&
"only integer types expected to be promoted");
Val = Builder.CreateTrunc(Val, ElTy);
}
@@ -1652,7 +1652,7 @@
assert(VTy && "expected a vector type for vset_lane vector operand");
const Type *ElTy = VTy->getElementType();
if (Ops[0]->getType() != ElTy) {
- assert(!ElTy->isFloatingPoint() &&
+ assert(!ElTy->isFloatingPointTy() &&
"only integer types expected to be promoted");
Ops[0] = Builder.CreateTrunc(Ops[0], ElTy);
}
@@ -2560,12 +2560,12 @@
default:
assert(0);
}
- } else if (Ty->isInteger() || isa<PointerType>(Ty) ||
+ } else if (Ty->isIntegerTy() || isa<PointerType>(Ty) ||
Ty==Type::getVoidTy(Context)) {
;
} else {
// Floating point scalar argument.
- assert(Ty->isFloatingPoint() && Ty->isPrimitiveType() &&
+ assert(Ty->isFloatingPointTy() && Ty->isPrimitiveType() &&
"Expecting a floating point primitive type!");
switch (Ty->getTypeID())
{
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp?rev=96225&r1=96224&r2=96225&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386.cpp Mon Feb 15 10:24:42 2010
@@ -655,7 +655,7 @@
for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
I != E; ++I) {
const Type *STy = I->get();
- if (!STy->isIntOrIntVector() && !isa<PointerType>(STy))
+ if (!STy->isIntOrIntVectorTy() && !isa<PointerType>(STy))
return false;
}
return true;
@@ -687,8 +687,8 @@
// 32 and 64-bit integers are fine, as are float and double. Long double
// (which can be picked as the type for a union of 16 bytes) is not fine,
// as loads and stores of it get only 10 bytes.
- if (EltTy->isInteger(32) || EltTy->isInteger(64) || EltTy->isFloatTy() ||
- EltTy->isDoubleTy() || isa<PointerType>(EltTy)) {
+ if (EltTy->isIntegerTy(32) || EltTy->isIntegerTy(64) ||
+ EltTy->isFloatTy() || EltTy->isDoubleTy() || isa<PointerType>(EltTy)) {
Elts.push_back(EltTy);
continue;
}
@@ -715,10 +715,10 @@
// makes it ABI compatible for x86-64. Same for _Complex char and _Complex
// short in 32-bit.
const Type *EltTy = STy->getElementType(0);
- return !((TARGET_64BIT && (EltTy->isInteger() ||
+ return !((TARGET_64BIT && (EltTy->isIntegerTy() ||
EltTy->isFloatTy() ||
EltTy->isDoubleTy())) ||
- EltTy->isInteger(16) || EltTy->isInteger(8));
+ EltTy->isIntegerTy(16) || EltTy->isIntegerTy(8));
}
/* Target hook for llvm-abi.h. It returns true if an aggregate of the
@@ -757,14 +757,14 @@
else
// All other vector scalar values are passed in XMM registers.
++NumXMMs;
- } else if (Ty->isInteger() || isa<PointerType>(Ty)) {
+ } else if (Ty->isIntegerTy() || isa<PointerType>(Ty)) {
++NumGPRs;
} else if (Ty->isVoidTy()) {
// Padding bytes that are not passed anywhere
;
} else {
// Floating point scalar argument.
- assert(Ty->isFloatingPoint() && Ty->isPrimitiveType() &&
+ assert(Ty->isFloatingPointTy() && Ty->isPrimitiveType() &&
"Expecting a floating point primitive type!");
if (Ty->getTypeID() == Type::FloatTyID
|| Ty->getTypeID() == Type::DoubleTyID)
@@ -879,7 +879,7 @@
Ty = STy->getElementType(0);
if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
if (VTy->getNumElements() == 2) {
- if (VTy->getElementType()->isInteger()) {
+ if (VTy->getElementType()->isIntegerTy()) {
Elts.push_back(VectorType::get(Type::getInt64Ty(Context), 2));
} else {
Elts.push_back(VectorType::get(Type::getDoubleTy(Context), 2));
@@ -887,7 +887,7 @@
Bytes -= 8;
} else {
assert(VTy->getNumElements() == 4);
- if (VTy->getElementType()->isInteger()) {
+ if (VTy->getElementType()->isIntegerTy()) {
Elts.push_back(VectorType::get(Type::getInt32Ty(Context), 4));
} else {
Elts.push_back(VectorType::get(Type::getFloatTy(Context), 4));
@@ -1261,14 +1261,14 @@
Ty = STy->getElementType(0);
if (const VectorType *VTy = dyn_cast<VectorType>(Ty)) {
if (VTy->getNumElements() == 2) {
- if (VTy->getElementType()->isInteger())
+ if (VTy->getElementType()->isIntegerTy())
Elts.push_back(VectorType::get(Type::getInt64Ty(Context), 2));
else
Elts.push_back(VectorType::get(Type::getDoubleTy(Context), 2));
Bytes -= 8;
} else {
assert(VTy->getNumElements() == 4);
- if (VTy->getElementType()->isInteger())
+ if (VTy->getElementType()->isIntegerTy())
Elts.push_back(VectorType::get(Type::getInt32Ty(Context), 4));
else
Elts.push_back(VectorType::get(Type::getFloatTy(Context), 4));
Modified: llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp?rev=96225&r1=96224&r2=96225&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/config/rs6000/llvm-rs6000.cpp Mon Feb 15 10:24:42 2010
@@ -80,9 +80,9 @@
// GetAltivecTypeNumFromType - Given an LLVM type, return a unique ID for
// the type in the range 0-3.
static int GetAltivecTypeNumFromType(const Type *Ty) {
- return (Ty->isInteger(32) ? 0 : \
- (Ty->isInteger(16) ? 1 : \
- (Ty->isInteger(8) ? 2 : \
+ return (Ty->isIntegerTy(32) ? 0 : \
+ (Ty->isIntegerTy(16) ? 1 : \
+ (Ty->isIntegerTy(8) ? 2 : \
((Ty == Type::getFloatTy(Context)) ? 3 : -1))));
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi-default.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi-default.cpp?rev=96225&r1=96224&r2=96225&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi-default.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi-default.cpp Mon Feb 15 10:24:42 2010
@@ -318,7 +318,7 @@
if (InSize < Size) {
unsigned N = STy->getNumElements();
const llvm::Type *LastEltTy = STy->getElementType(N-1);
- if (LastEltTy->isInteger())
+ if (LastEltTy->isIntegerTy())
LastEltSizeDiff =
getTargetData().getTypeAllocSize(LastEltTy) - (Size - InSize);
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi-linux-ppc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi-linux-ppc.cpp?rev=96225&r1=96224&r2=96225&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi-linux-ppc.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi-linux-ppc.cpp Mon Feb 15 10:24:42 2010
@@ -66,7 +66,7 @@
abort();
} else if (isa<PointerType>(Ty)) {
NumGPRs++;
- } else if (Ty->isInteger()) {
+ } else if (Ty->isIntegerTy()) {
unsigned TypeSize = Ty->getPrimitiveSizeInBits();
unsigned NumRegs = (TypeSize + 31) / 32;
@@ -76,7 +76,7 @@
;
} else {
// Floating point scalar argument.
- assert(Ty->isFloatingPoint() && Ty->isPrimitiveType() &&
+ assert(Ty->isFloatingPointTy() && Ty->isPrimitiveType() &&
"Expecting a floating point primitive type!");
}
}
@@ -108,7 +108,7 @@
const Type *Ty = ConvertType(type);
const Type* Int32Ty = Type::getInt32Ty(getGlobalContext());
if (Ty->isSingleValueType()) {
- if (Ty->isInteger()) {
+ if (Ty->isIntegerTy()) {
unsigned TypeSize = Ty->getPrimitiveSizeInBits();
// Determine how many general purpose registers are needed for the
@@ -129,7 +129,7 @@
C->HandlePad(Int32Ty);
}
}
- } else if (!(Ty->isFloatingPoint() ||
+ } else if (!(Ty->isFloatingPointTy() ||
isa<VectorType>(Ty) ||
isa<PointerType>(Ty))) {
abort();
@@ -440,7 +440,7 @@
if (InSize < Size) {
unsigned N = STy->getNumElements();
const llvm::Type *LastEltTy = STy->getElementType(N-1);
- if (LastEltTy->isInteger())
+ if (LastEltTy->isIntegerTy())
LastEltSizeDiff =
getTargetData().getTypeAllocSize(LastEltTy) - (Size - InSize);
}
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=96225&r1=96224&r2=96225&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Feb 15 10:24:42 2010
@@ -347,7 +347,7 @@
// If this is just a mismatch between integer types, this is due
// to K&R prototypes, where the forward proto defines the arg as int
// and the actual impls is a short or char.
- assert(ArgVal->getType()->isInteger(32) && LLVMTy->isInteger() &&
+ assert(ArgVal->getType()->isIntegerTy(32) && LLVMTy->isIntegerTy() &&
"Lowerings don't match?");
ArgVal = Builder.CreateTrunc(ArgVal, LLVMTy,NameStack.back().c_str());
}
@@ -1254,7 +1254,7 @@
// Handle 'trunc (zext i1 X to T2) to i1' as X, because this occurs all over
// the place.
if (ZExtInst *CI = dyn_cast<ZExtInst>(V))
- if (Ty->isInteger(1) && CI->getOperand(0)->getType()->isInteger(1))
+ if (Ty->isIntegerTy(1) && CI->getOperand(0)->getType()->isIntegerTy(1))
return CI->getOperand(0);
return Builder.CreateCast(Instruction::CastOps(opcode), V, Ty,
@@ -1438,14 +1438,14 @@
/// contains any floating point elements.
static bool containsFPField(const Type *LLVMTy) {
- if (LLVMTy->isFloatingPoint())
+ if (LLVMTy->isFloatingPointTy())
return true;
const StructType* STy = dyn_cast<StructType>(LLVMTy);
if (STy) {
for (StructType::element_iterator I = STy->element_begin(),
E = STy->element_end(); I != E; I++) {
const Type *Ty = *I;
- if (Ty->isFloatingPoint())
+ if (Ty->isFloatingPointTy())
return true;
if (isa<StructType>(Ty) && containsFPField(Ty))
return true;
@@ -1922,7 +1922,7 @@
if (FPPred == ~0U) {
Cond = Emit(exp_cond, 0);
// Comparison against zero to convert the result to i1.
- if (!Cond->getType()->isInteger(1))
+ if (!Cond->getType()->isIntegerTy(1))
Cond = Builder.CreateIsNotNull(Cond, "toBool");
} else {
Cond = EmitCompare(exp_cond, UIPred, SIPred, FPPred, Type::getInt1Ty(Context));
@@ -2385,7 +2385,7 @@
// The number of loads needed to read the entire bitfield.
unsigned Strides = 1 + (LV.BitStart + LV.BitSize - 1) / ValSizeInBits;
- assert(ValTy->isInteger() && "Invalid bitfield lvalue!");
+ assert(ValTy->isIntegerTy() && "Invalid bitfield lvalue!");
assert(ValSizeInBits > LV.BitStart && "Bad bitfield lvalue!");
assert(ValSizeInBits >= LV.BitSize && "Bad bitfield lvalue!");
assert(2*ValSizeInBits > LV.BitSize+LV.BitStart && "Bad bitfield lvalue!");
@@ -3133,7 +3133,7 @@
// The number of stores needed to write the entire bitfield.
unsigned Strides = 1 + (LV.BitStart + LV.BitSize - 1) / ValSizeInBits;
- assert(ValTy->isInteger() && "Invalid bitfield lvalue!");
+ assert(ValTy->isIntegerTy() && "Invalid bitfield lvalue!");
assert(ValSizeInBits > LV.BitStart && "Bad bitfield lvalue!");
assert(ValSizeInBits >= LV.BitSize && "Bad bitfield lvalue!");
assert(2*ValSizeInBits > LV.BitSize+LV.BitStart && "Bad bitfield lvalue!");
@@ -3330,7 +3330,7 @@
Value *TreeToLLVM::EmitNEGATE_EXPR(tree exp, const MemRef *DestLoc) {
if (!DestLoc) {
Value *V = Emit(TREE_OPERAND(exp, 0), 0);
- if (V->getType()->isFPOrFPVector())
+ if (V->getType()->isFPOrFPVectorTy())
return Builder.CreateFNeg(V);
if (!isa<PointerType>(V->getType())) {
bool HasNSW = !TYPE_OVERFLOW_WRAPS(TREE_TYPE(exp));
@@ -3353,7 +3353,7 @@
// Handle complex numbers: -(a+ib) = -a + i*-b
Value *R, *I;
EmitLoadFromComplex(R, I, Tmp);
- if (R->getType()->isFloatingPoint()) {
+ if (R->getType()->isFloatingPointTy()) {
R = Builder.CreateFNeg(R);
I = Builder.CreateFNeg(I);
} else {
@@ -3375,7 +3375,7 @@
// Handle complex numbers: ~(a+ib) = a + i*-b
Value *R, *I;
EmitLoadFromComplex(R, I, Tmp);
- if (I->getType()->isFloatingPoint())
+ if (I->getType()->isFloatingPointTy())
I = Builder.CreateFNeg(I);
else
I = Builder.CreateNeg(I);
@@ -3385,7 +3385,7 @@
Value *TreeToLLVM::EmitABS_EXPR(tree exp) {
Value *Op = Emit(TREE_OPERAND(exp, 0), 0);
- if (!Op->getType()->isFloatingPoint()) {
+ if (!Op->getType()->isFloatingPointTy()) {
Value *OpN = Builder.CreateNeg(Op, (Op->getNameStr()+"neg").c_str());
ICmpInst::Predicate pred = TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0))) ?
ICmpInst::ICMP_UGE : ICmpInst::ICMP_SGE;
@@ -3435,9 +3435,9 @@
"Expected integer type here");
Ty = ConvertType(TREE_TYPE(exp));
Op = CastToType(Instruction::PtrToInt, Op, Ty);
- } else if (Ty->isFloatingPoint() ||
+ } else if (Ty->isFloatingPointTy() ||
(isa<VectorType>(Ty) &&
- cast<VectorType>(Ty)->getElementType()->isFloatingPoint())) {
+ cast<VectorType>(Ty)->getElementType()->isFloatingPointTy())) {
Op = BitCastToType(Op, getSuitableBitCastIntType(Ty));
}
return BitCastToType(Builder.CreateNot(Op,
@@ -3536,9 +3536,9 @@
Opc == Instruction::Xor;
const Type *ResTy = Ty;
if (isLogicalOp &&
- (Ty->isFloatingPoint() ||
+ (Ty->isFloatingPointTy() ||
(isa<VectorType>(Ty) &&
- cast<VectorType>(Ty)->getElementType()->isFloatingPoint()))) {
+ cast<VectorType>(Ty)->getElementType()->isFloatingPointTy()))) {
Ty = getSuitableBitCastIntType(Ty);
LHS = BitCastToType(LHS, Ty);
RHS = BitCastToType(RHS, Ty);
@@ -3693,7 +3693,7 @@
RHS = CastToType(opcode, RHS, Ty);
Value *Compare;
- if (LHS->getType()->isFloatingPoint())
+ if (LHS->getType()->isFloatingPointTy())
Compare = Builder.CreateFCmp(FCmpInst::Predicate(FPPred), LHS, RHS);
else if (TYPE_UNSIGNED(TREE_TYPE(exp)))
Compare = Builder.CreateICmp(ICmpInst::Predicate(UIPred), LHS, RHS);
@@ -6362,7 +6362,7 @@
Value *Offset = Emit(TREE_VALUE(arglist), 0);
Value *Handler = Emit(TREE_VALUE(TREE_CHAIN(arglist)), 0);
- Intrinsic::ID IID = IntPtr->isInteger(32) ?
+ Intrinsic::ID IID = IntPtr->isIntegerTy(32) ?
Intrinsic::eh_return_i32 : Intrinsic::eh_return_i64;
Offset = Builder.CreateIntCast(Offset, IntPtr, true);
@@ -6640,7 +6640,7 @@
switch (TREE_CODE(exp)) {
default: TODO(exp);
case PLUS_EXPR: // (a+ib) + (c+id) = (a+c) + i(b+d)
- if (LHSr->getType()->isFloatingPoint()) {
+ if (LHSr->getType()->isFloatingPointTy()) {
DSTr = Builder.CreateFAdd(LHSr, RHSr, "tmpr");
DSTi = Builder.CreateFAdd(LHSi, RHSi, "tmpi");
} else {
@@ -6649,7 +6649,7 @@
}
break;
case MINUS_EXPR: // (a+ib) - (c+id) = (a-c) + i(b-d)
- if (LHSr->getType()->isFloatingPoint()) {
+ if (LHSr->getType()->isFloatingPointTy()) {
DSTr = Builder.CreateFSub(LHSr, RHSr, "tmpr");
DSTi = Builder.CreateFSub(LHSi, RHSi, "tmpi");
} else {
@@ -6658,7 +6658,7 @@
}
break;
case MULT_EXPR: { // (a+ib) * (c+id) = (ac-bd) + i(ad+cb)
- if (LHSr->getType()->isFloatingPoint()) {
+ if (LHSr->getType()->isFloatingPointTy()) {
Value *Tmp1 = Builder.CreateFMul(LHSr, RHSr); // a*c
Value *Tmp2 = Builder.CreateFMul(LHSi, RHSi); // b*d
DSTr = Builder.CreateFSub(Tmp1, Tmp2); // ac-bd
@@ -6679,7 +6679,7 @@
}
case RDIV_EXPR: { // (a+ib) / (c+id) = ((ac+bd)/(cc+dd)) + i((bc-ad)/(cc+dd))
// RDIV_EXPR should always be floating point.
- assert (LHSr->getType()->isFloatingPoint());
+ assert (LHSr->getType()->isFloatingPointTy());
Value *Tmp1 = Builder.CreateFMul(LHSr, RHSr); // a*c
Value *Tmp2 = Builder.CreateFMul(LHSi, RHSi); // b*d
Value *Tmp3 = Builder.CreateFAdd(Tmp1, Tmp2); // ac+bd
@@ -6696,7 +6696,7 @@
break;
}
case EQ_EXPR: // (a+ib) == (c+id) = (a == c) & (b == d)
- if (LHSr->getType()->isFloatingPoint()) {
+ if (LHSr->getType()->isFloatingPointTy()) {
DSTr = Builder.CreateFCmpOEQ(LHSr, RHSr, "tmpr");
DSTi = Builder.CreateFCmpOEQ(LHSi, RHSi, "tmpi");
} else {
@@ -6705,7 +6705,7 @@
}
return Builder.CreateAnd(DSTr, DSTi);
case NE_EXPR: // (a+ib) != (c+id) = (a != c) | (b != d)
- if (LHSr->getType()->isFloatingPoint()) {
+ if (LHSr->getType()->isFloatingPointTy()) {
DSTr = Builder.CreateFCmpUNE(LHSr, RHSr, "tmpr");
DSTi = Builder.CreateFCmpUNE(LHSi, RHSi, "tmpi");
} else {
@@ -7038,7 +7038,7 @@
if (isBitfield(FieldDecl)) {
// If this is a bitfield, the declared type must be an integral type.
- assert(FieldTy->isInteger() && "Invalid bitfield");
+ assert(FieldTy->isIntegerTy() && "Invalid bitfield");
assert(DECL_SIZE(FieldDecl) &&
TREE_CODE(DECL_SIZE(FieldDecl)) == INTEGER_CST &&
@@ -7053,7 +7053,7 @@
// things that are difficult to clean up later. This occurs in cases like
// "struct X{ unsigned long long x:50; unsigned y:2; }" when accessing y.
// We want to access the field as a ulong, not as a uint with an offset.
- if (LLVMFieldTy->isInteger() &&
+ if (LLVMFieldTy->isIntegerTy() &&
LLVMFieldTy->getPrimitiveSizeInBits() >= BitStart + BitfieldSize &&
LLVMFieldTy->getPrimitiveSizeInBits() ==
TD.getTypeAllocSizeInBits(LLVMFieldTy))
@@ -7420,7 +7420,7 @@
Constant *TreeConstantToLLVM::ConvertREAL_CST(tree exp) {
const Type *Ty = ConvertType(TREE_TYPE(exp));
- assert(Ty->isFloatingPoint() && "Integer REAL_CST?");
+ assert(Ty->isFloatingPointTy() && "Integer REAL_CST?");
long RealArr[2];
union {
int UArr[2];
@@ -7506,11 +7506,11 @@
unsigned Len = (unsigned)TREE_STRING_LENGTH(exp);
std::vector<Constant*> Elts;
- if (ElTy->isInteger(8)) {
+ if (ElTy->isIntegerTy(8)) {
const unsigned char *InStr =(const unsigned char *)TREE_STRING_POINTER(exp);
for (unsigned i = 0; i != Len; ++i)
Elts.push_back(ConstantInt::get(Type::getInt8Ty(Context), InStr[i]));
- } else if (ElTy->isInteger(16)) {
+ } else if (ElTy->isIntegerTy(16)) {
assert((Len&1) == 0 &&
"Length in bytes should be a multiple of element size");
const uint16_t *InStr =
@@ -7524,7 +7524,7 @@
else
Elts.push_back(ConstantInt::get(Type::getInt16Ty(Context), ByteSwap_16(InStr[i])));
}
- } else if (ElTy->isInteger(32)) {
+ } else if (ElTy->isIntegerTy(32)) {
assert((Len&3) == 0 &&
"Length in bytes should be a multiple of element size");
const uint32_t *InStr = (const uint32_t *)TREE_STRING_POINTER(exp);
@@ -7961,7 +7961,7 @@
if (GCCFieldOffsetInBits < NextFieldByteStart*8) {
unsigned ValBitSize = ValC->getBitWidth();
assert(!ResultElts.empty() && "Bitfield starts before first element?");
- assert(ResultElts.back()->getType()->isInteger(8) &&
+ assert(ResultElts.back()->getType()->isIntegerTy(8) &&
isa<ConstantInt>(ResultElts.back()) &&
"Merging bitfield with non-bitfield value?");
assert(NextFieldByteStart*8 - GCCFieldOffsetInBits < 8 &&
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=96225&r1=96224&r2=96225&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Mon Feb 15 10:24:42 2010
@@ -988,8 +988,8 @@
if (KNRPromotion) {
if (type == float_type_node)
LLVMTy = ConvertType(double_type_node);
- else if (LLVMTy->isInteger(16) || LLVMTy->isInteger(8) ||
- LLVMTy->isInteger(1))
+ else if (LLVMTy->isIntegerTy(16) || LLVMTy->isIntegerTy(8) ||
+ LLVMTy->isIntegerTy(1))
LLVMTy = Type::getInt32Ty(Context);
}
ArgTypes.push_back(LLVMTy);
@@ -1391,13 +1391,13 @@
const Type *LastType = Elements.back();
unsigned PadBytes = 0;
- if (LastType->isInteger(8))
+ if (LastType->isIntegerTy(8))
PadBytes = 1 - NoOfBytesToRemove;
- else if (LastType->isInteger(16))
+ else if (LastType->isIntegerTy(16))
PadBytes = 2 - NoOfBytesToRemove;
- else if (LastType->isInteger(32))
+ else if (LastType->isIntegerTy(32))
PadBytes = 4 - NoOfBytesToRemove;
- else if (LastType->isInteger(64))
+ else if (LastType->isIntegerTy(64))
PadBytes = 8 - NoOfBytesToRemove;
else
return;
More information about the llvm-commits
mailing list