Get rid of the old Expr::Evaluate variant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61260 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 7a83d6c..6810167 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -1194,19 +1194,6 @@
return true;
}
-bool Expr::Evaluate(APValue &Result, ASTContext &Ctx, bool *isEvaluated) const {
- EvalResult EvalResult;
-
- if (!Evaluate(EvalResult, Ctx))
- return false;
-
- Result = EvalResult.Val;
- if (isEvaluated)
- *isEvaluated = !EvalResult.HasSideEffects;
-
- return true;
-}
-
/// isEvaluatable - Call Evaluate to see if this expression can be constant
/// folded, but discard the result.
bool Expr::isEvaluatable(ASTContext &Ctx) const {
@@ -1215,10 +1202,10 @@
}
APSInt Expr::EvaluateAsInt(ASTContext &Ctx) const {
- APValue V;
- bool Result = Evaluate(V, Ctx);
+ EvalResult EvalResult;
+ bool Result = Evaluate(EvalResult, Ctx);
assert(Result && "Could not evaluate expression");
- assert(V.isInt() && "Expression did not evaluate to integer");
+ assert(EvalResult.Val.isInt() && "Expression did not evaluate to integer");
- return V.getInt();
+ return EvalResult.Val.getInt();
}