}
void CWriter::visitCastInst(CastInst &I) {
+ if (I.getType() == Type::BoolTy) {
+ Out << "(";
+ writeOperand(I.getOperand(0));
+ Out << " != 0)";
+ return;
+ }
Out << "(";
printType(Out, I.getType(), "", /*ignoreName*/false, /*namedContext*/false);
Out << ")";
// Avoid "cast to pointer from integer of different size" warnings
Out << "(long)";
}
-
+
writeOperand(I.getOperand(0));
}
}
void CWriter::visitCastInst(CastInst &I) {
+ if (I.getType() == Type::BoolTy) {
+ Out << "(";
+ writeOperand(I.getOperand(0));
+ Out << " != 0)";
+ return;
+ }
Out << "(";
printType(Out, I.getType(), "", /*ignoreName*/false, /*namedContext*/false);
Out << ")";
// Avoid "cast to pointer from integer of different size" warnings
Out << "(long)";
}
-
+
writeOperand(I.getOperand(0));
}