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:
Richard Smith
2011-10-29 00:50:52 +00:00
parent 9b9c970148
commit 7b553f1b19
15 changed files with 58 additions and 51 deletions

View File

@@ -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.