Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263
This commit is contained in:
@@ -513,7 +513,7 @@ ConstantFoldsToSimpleInteger(const Expr *Cond, llvm::APInt &ResultInt) {
|
||||
// FIXME: Rename and handle conversion of other evaluatable things
|
||||
// to bool.
|
||||
Expr::EvalResult Result;
|
||||
if (!Cond->Evaluate(Result, getContext()) || !Result.Val.isInt() ||
|
||||
if (!Cond->EvaluateAsRValue(Result, getContext()) || !Result.Val.isInt() ||
|
||||
Result.HasSideEffects)
|
||||
return false; // Not foldable, not integer or not fully evaluatable.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user