}
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
// 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
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) {
// 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();