if (llvm::ConstantInt *LHSCst = dyn_cast<llvm::ConstantInt>(LHSCond)) {
// If we have 0 && RHS, see if we can elide RHS, if so, just return LHSCond.
- if (LHSCst->getZExtValue() == 0) {
+ if (LHSCst->isZero()) {
if (!CGF.ContainsLabel(E->getRHS()))
// Elide RHS, return 0
return llvm::Constant::getNullValue(CGF.LLVMIntTy);
if (llvm::ConstantInt *LHSCst = dyn_cast<llvm::ConstantInt>(LHSCond)) {
// If we have 1 || RHS, see if we can elide RHS, if so, just return LHSCond.
- if (LHSCst->getZExtValue() != 0) {
+ if (!LHSCst->isZero()) {
if (!CGF.ContainsLabel(E->getRHS()))
// Elide RHS, return 1
return llvm::ConstantInt::get(CGF.LLVMIntTy, 1);
// can't do this if the dead side contains a label.
if (llvm::ConstantInt *CondCI = dyn_cast<llvm::ConstantInt>(CondVal)) {
Expr *Live = E->getLHS(), *Dead = E->getRHS();
- if (CondCI->getZExtValue() == 0)
+ if (CondCI->isZero())
std::swap(Live, Dead);
if (!Dead || !CGF.ContainsLabel(Dead)) {
// Emit the live side.
if (llvm::ConstantInt *CondCst = dyn_cast<llvm::ConstantInt>(BoolCondVal)) {
// Figure out which block (then or else) is executed.
const Stmt *Executed = S.getThen(), *Skipped = S.getElse();
- if (!CondCst->getZExtValue())
+ if (CondCst->isZero())
std::swap(Executed, Skipped);
// If the skipped block has no labels in it, just emit the executed block.