[llvm-commits] [llvm-gcc-4.2] r76551 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-convert.cpp llvm-types.cpp
Duncan Sands
baldrick at free.fr
Tue Jul 21 01:45:46 PDT 2009
Author: baldrick
Date: Tue Jul 21 03:45:16 2009
New Revision: 76551
URL: http://llvm.org/viewvc/llvm-project?rev=76551&view=rev
Log:
Use "isa" rather than getTypeID.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-abi.h
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/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=76551&r1=76550&r2=76551&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Tue Jul 21 03:45:16 2009
@@ -378,7 +378,7 @@
void HandleReturnType(tree type, tree fn, bool isBuiltin) {
unsigned Offset = 0;
const Type *Ty = ConvertType(type);
- if (Ty->getTypeID() == Type::VectorTyID) {
+ if (isa<VectorType>(Ty)) {
// Vector handling is weird on x86. In particular builtin and
// non-builtin function of the same return types can use different
// calling conventions.
@@ -444,7 +444,7 @@
const Type *PtrTy = PointerType::getUnqual(Ty);
C.HandleByInvisibleReferenceArgument(PtrTy, type);
ScalarElts.push_back(PtrTy);
- } else if (Ty->getTypeID()==Type::VectorTyID) {
+ } else if (isa<VectorType>(Ty)) {
if (LLVM_SHOULD_PASS_VECTOR_IN_INTEGER_REGS(type)) {
PassInIntegerRegisters(type, Ty, ScalarElts, 0, false);
} else if (LLVM_SHOULD_PASS_VECTOR_USING_BYVAL_ATTR(type)) {
@@ -729,7 +729,7 @@
void HandleReturnType(tree type, tree fn, bool isBuiltin) {
unsigned Offset = 0;
const Type *Ty = ConvertType(type);
- if (Ty->getTypeID() == Type::VectorTyID) {
+ if (isa<VectorType>(Ty)) {
// Vector handling is weird on x86. In particular builtin and
// non-builtin function of the same return types can use different
// calling conventions.
@@ -818,7 +818,7 @@
if (Attributes) {
*Attributes |= Attr;
}
- } else if (Ty->getTypeID()==Type::VectorTyID) {
+ } else if (isa<VectorType>(Ty)) {
if (LLVM_SHOULD_PASS_VECTOR_IN_INTEGER_REGS(type)) {
PassInIntegerRegisters(type, Ty, ScalarElts, 0, false);
} else if (LLVM_SHOULD_PASS_VECTOR_USING_BYVAL_ATTR(type)) {
@@ -857,7 +857,7 @@
Attr |= Attribute::InReg;
NumGPR = NumArgRegs;
}
- } else if (Ty->getTypeID() == Type::PointerTyID) {
+ } else if (isa<PointerType>(Ty)) {
if (NumGPR < NumArgRegs) {
NumGPR++;
} else {
@@ -865,8 +865,7 @@
}
// We don't care about arguments passed in Floating-point or vector
// registers.
- } else if (!(Ty->isFloatingPoint() ||
- Ty->getTypeID() == Type::VectorTyID)) {
+ } else if (!(Ty->isFloatingPoint() || isa<VectorType>(Ty))) {
abort();
}
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=76551&r1=76550&r2=76551&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Jul 21 03:45:16 2009
@@ -565,7 +565,7 @@
const Type *ArgTy = ConvertType(TREE_TYPE(Args));
bool isInvRef = isPassedByInvisibleReference(TREE_TYPE(Args));
if (isInvRef ||
- (ArgTy->getTypeID()==Type::VectorTyID &&
+ (isa<VectorType>(ArgTy) &&
LLVM_SHOULD_PASS_VECTOR_USING_BYVAL_ATTR(TREE_TYPE(Args))) ||
(!ArgTy->isSingleValueType() &&
isPassedByVal(TREE_TYPE(Args), ArgTy, ScalarArgs,
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=76551&r1=76550&r2=76551&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Tue Jul 21 03:45:16 2009
@@ -801,7 +801,7 @@
// Restore ConvertingStruct for the caller.
ConvertingStruct = false;
- if (Actual->getTypeID() == Type::VoidTyID)
+ if (Actual == Type::VoidTy)
Actual = Type::Int8Ty; // void* -> sbyte*
// Update the type, potentially updating TYPE_LLVM(type).
@@ -836,7 +836,7 @@
Ty = ConvertType(TREE_TYPE(type));
}
- if (Ty->getTypeID() == Type::VoidTyID)
+ if (Ty == Type::VoidTy)
Ty = Type::Int8Ty; // void* -> sbyte*
return TypeDB.setType(type, Context.getPointerTypeUnqual(Ty));
}
More information about the llvm-commits
mailing list