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
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 06779ca..afc8c80 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -1022,7 +1022,7 @@
}
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 @@
// 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 @@
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) {