forked from OSchip/llvm-project
Handle Unary ! in EmitBranchOnBoolExpr, so that we can efficiently
codegen stuff like "if (!(X && Y))" llvm-svn: 59115
This commit is contained in:
parent
51e7118c30
commit
d95377341b
|
@ -263,7 +263,12 @@ void CodeGenFunction::EmitBranchOnBoolExpr(const Expr *Cond,
|
|||
EmitBranchOnBoolExpr(CondBOp->getRHS(), TrueBlock, FalseBlock);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (const UnaryOperator *CondUOp = dyn_cast<UnaryOperator>(Cond)) {
|
||||
// br(!x, t, f) -> br(x, f, t)
|
||||
if (CondUOp->getOpcode() == UnaryOperator::LNot)
|
||||
return EmitBranchOnBoolExpr(CondUOp->getSubExpr(), FalseBlock, TrueBlock);
|
||||
}
|
||||
|
||||
// Emit the code with the fully general case.
|
||||
|
|
Loading…
Reference in New Issue