rename Expr::tryEvaluate to Expr::Evaluate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59426 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index 5255f18..6e67f28 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -134,13 +134,13 @@
   /// isConstantExpr - Return true if this expression is a valid constant expr.
   bool isConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const;
   
-  /// tryEvaluate - Return true if this is a constant which we can fold using
+  /// Evaluate - Return true if this is a constant which we can fold using
   /// any crazy technique (that has nothing to do with language standards) that
   /// we want to.  If this function returns true, it returns the folded constant
   /// in Result.
-  bool tryEvaluate(APValue& Result, ASTContext &Ctx) const;
+  bool Evaluate(APValue& Result, ASTContext &Ctx) const;
   
-  /// isEvaluatable - Call tryEvaluate to see if this expression can be constant
+  /// isEvaluatable - Call Evaluate to see if this expression can be constant
   /// folded, but discard the result.
   bool isEvaluatable(ASTContext &Ctx) const;
 
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 871dc4b..29d9a11 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -798,7 +798,7 @@
     // reject it.
     if (CE->isBuiltinCall()) {
       APValue ResultAP;
-      if (CE->tryEvaluate(ResultAP, Ctx)) {
+      if (CE->Evaluate(ResultAP, Ctx)) {
         Result = ResultAP.getInt();
         break;  // It is a constant, expand it.
       }
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 86f7a21..625a414 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -508,7 +508,7 @@
     // __builtin_constant_p always has one operand: it returns true if that
     // operand can be folded, false otherwise.
     APValue Res;
-    Result = E->getArg(0)->tryEvaluate(Res, Info.Ctx);
+    Result = E->getArg(0)->Evaluate(Res, Info.Ctx);
     return true;
   }
   }
@@ -1094,14 +1094,14 @@
 }
 
 //===----------------------------------------------------------------------===//
-// Top level TryEvaluate.
+// Top level Expr::Evaluate method.
 //===----------------------------------------------------------------------===//
 
-/// tryEvaluate - Return true if this is a constant which we can fold using
+/// Evaluate - Return true if this is a constant which we can fold using
 /// any crazy technique (that has nothing to do with language standards) that
 /// we want to.  If this function returns true, it returns the folded constant
 /// in Result.
-bool Expr::tryEvaluate(APValue &Result, ASTContext &Ctx) const {
+bool Expr::Evaluate(APValue &Result, ASTContext &Ctx) const {
   EvalInfo Info(Ctx);
   if (getType()->isIntegerType()) {
     llvm::APSInt sInt(32);
@@ -1127,9 +1127,9 @@
   return false;
 }
 
-/// isEvaluatable - Call tryEvaluate to see if this expression can be constant
+/// isEvaluatable - Call Evaluate to see if this expression can be constant
 /// folded, but discard the result.
 bool Expr::isEvaluatable(ASTContext &Ctx) const {
   APValue V;
-  return tryEvaluate(V, Ctx);
+  return Evaluate(V, Ctx);
 }
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp
index 98e70e8..a8eb8f7 100644
--- a/lib/CodeGen/CGBuiltin.cpp
+++ b/lib/CodeGen/CGBuiltin.cpp
@@ -39,7 +39,7 @@
 RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
   // See if we can constant fold this builtin.  If so, don't emit it at all.
   APValue Result;
-  if (E->tryEvaluate(Result, CGM.getContext())) {
+  if (E->Evaluate(Result, CGM.getContext())) {
     if (Result.isInt())
       return RValue::get(llvm::ConstantInt::get(Result.getInt()));
     assert(Result.isFloat() && "Unsupported constant type");
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index 7b33fdb..41379b5 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/lib/CodeGen/CGExprConstant.cpp
@@ -610,7 +610,7 @@
 
   llvm::Constant *VisitCallExpr(const CallExpr *E) {
     APValue Result;
-    if (E->tryEvaluate(Result, CGM.getContext())) {
+    if (E->Evaluate(Result, CGM.getContext())) {
       if (Result.isInt())
         return llvm::ConstantInt::get(Result.getInt());
       if (Result.isFloat())
@@ -845,7 +845,7 @@
 
 #ifdef USE_TRY_EVALUATE
   APValue V;
-  if (E->tryEvaluate(V, Context)) {
+  if (E->Evaluate(V, Context)) {
     // FIXME: Assert that the value doesn't have any side effects.
     switch (V.getKind()) {
     default: assert(0 && "unhandled value kind!");
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index e6deaa7..ff05f6e 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -197,7 +197,7 @@
   
   // FIXME: Rename and handle conversion of other evaluatable things
   // to bool.
-  if (!Cond->tryEvaluate(V, getContext()) || !V.isInt())
+  if (!Cond->Evaluate(V, getContext()) || !V.isInt())
     return 0;  // Not foldable or not integer.
   
   if (CodeGenFunction::ContainsLabel(Cond))
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index dd76e15..1ecaaa3 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1560,11 +1560,11 @@
     // specified arm of the conditional to be a constant.  This is a horrible
     // hack, but is require by real world code that uses __builtin_constant_p.
     APValue Val;
-    if (!Exp->getCond()->tryEvaluate(Val, Context)) {
-      // If the tryEvaluate couldn't fold it, CheckArithmeticConstantExpression
+    if (!Exp->getCond()->Evaluate(Val, Context)) {
+      // If Evaluate couldn't fold it, CheckArithmeticConstantExpression
       // won't be able to either.  Use it to emit the diagnostic though.
       bool Res = CheckArithmeticConstantExpression(Exp->getCond());
-      assert(Res && "tryEvaluate couldn't evaluate this constant?");
+      assert(Res && "Evaluate couldn't evaluate this constant?");
       return Res;
     }
     
@@ -2494,7 +2494,7 @@
   
   APValue Result;
   if (!VLATy->getSizeExpr() ||
-      !VLATy->getSizeExpr()->tryEvaluate(Result, Context))
+      !VLATy->getSizeExpr()->Evaluate(Result, Context))
     return QualType();
     
   assert(Result.isInt() && "Size expressions must be integers!");