aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-15 01:48:11 +0000
committerChris Lattner <sabre@nondot.org>2007-01-15 01:48:11 +0000
commit9e1b1cf3aa1457f7d81d48962e58ec387714c219 (patch)
tree352efef5cd438d4c6e746d6dda4493499fd89149
parentd4427b6d31a133a7336f1a4ca931cc84ef269af8 (diff)
Make use of isInteger vs isIntegral more explicit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33216 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/CBackend/CBackend.cpp8
-rw-r--r--lib/Target/X86/X86TargetAsmInfo.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 06779cad5d..afc8c8002c 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -1022,7 +1022,7 @@ bool CWriter::printConstExprCast(const ConstantExpr* CE) {
}
if (NeedsExplicitCast) {
Out << "((";
- if (Ty->isInteger())
+ if (Ty->isIntegral() && 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->isInteger())
+ if (OpTy->isIntegral() && OpTy != Type::Int1Ty)
printSimpleType(Out, OpTy, castIsSigned);
else
printType(Out, OpTy); // not integer, sign doesn't matter
@@ -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->isInteger()) ||
- (DstTy->isFloatingPoint() && SrcTy->isInteger());
+ return (SrcTy->isFloatingPoint() && DstTy->isIntegral()) ||
+ (DstTy->isFloatingPoint() && SrcTy->isIntegral());
}
void CWriter::printFunction(Function &F) {
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index 5f15645181..9a8ea0fef9 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()->isInteger())
+ !CI->getType()->isIntegral())
return false;
const Type *Ty = CI->getType();