[cfe-commits] r152818 - in /cfe/trunk: include/clang/Basic/DiagnosticASTKinds.td lib/AST/ExprConstant.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Thu Mar 15 11:07:14 PDT 2012


Author: akirtzidis
Date: Thu Mar 15 13:07:13 2012
New Revision: 152818

URL: http://llvm.org/viewvc/llvm-project?rev=152818&view=rev
Log:
Remove hacky temporary fix of r151585.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
    cfe/trunk/lib/AST/ExprConstant.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td?rev=152818&r1=152817&r2=152818&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td Thu Mar 15 13:07:13 2012
@@ -107,11 +107,6 @@
   "see all)">;
 def note_constexpr_call_here : Note<"in call to '%0'">;
 
-// FIXME: See EvalInfo::IntExprEvaluatorDepth.
-def err_intexpr_depth_limit_exceeded : Error<
-  "integer expression evaluation exceeded maximum sub-expression depth">,
-  DefaultFatal; // avoid emitting it multiple times for the same parent expr.
-
 // inline asm related.
 let CategoryName = "Inline Assembly Issue" in {
   def err_asm_invalid_escape : Error<

Modified: cfe/trunk/lib/AST/ExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=152818&r1=152817&r2=152818&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Thu Mar 15 13:07:13 2012
@@ -44,7 +44,6 @@
 #include "clang/Basic/Builtins.h"
 #include "clang/Basic/TargetInfo.h"
 #include "llvm/ADT/SmallString.h"
-#include "llvm/Support/SaveAndRestore.h"
 #include <cstring>
 #include <functional>
 
@@ -388,18 +387,12 @@
     /// are suppressed.
     bool CheckingPotentialConstantExpression;
 
-    /// \brief Stack depth of IntExprEvaluator.
-    /// We check this against a maximum value to avoid stack overflow, see
-    /// test case in test/Sema/many-logical-ops.c.
-    // FIXME: This is a hack; handle properly unlimited logical ops.
-    unsigned IntExprEvaluatorDepth;
-
     EvalInfo(const ASTContext &C, Expr::EvalStatus &S)
       : Ctx(const_cast<ASTContext&>(C)), EvalStatus(S), CurrentCall(0),
         CallStackDepth(0), NextCallIndex(1),
         BottomFrame(*this, SourceLocation(), 0, 0, 0),
         EvaluatingDecl(0), EvaluatingDeclValue(0), HasActiveDiagnostic(false),
-        CheckingPotentialConstantExpression(false), IntExprEvaluatorDepth(0) {}
+        CheckingPotentialConstantExpression(false) {}
 
     const APValue *getOpaqueValue(const OpaqueValueExpr *e) const {
       MapTy::const_iterator i = OpaqueValues.find(e);
@@ -4008,20 +4001,6 @@
 
   bool ZeroInitialization(const Expr *E) { return Success(0, E); }
 
-  // FIXME: See EvalInfo::IntExprEvaluatorDepth.
-  bool Visit(const Expr *E) {
-    SaveAndRestore<unsigned> Depth(Info.IntExprEvaluatorDepth,
-                                   Info.IntExprEvaluatorDepth+1);
-    const unsigned MaxDepth = 512;
-    if (Depth.get() > MaxDepth) {
-      Info.Ctx.getDiagnostics().Report(E->getExprLoc(),
-                                       diag::err_intexpr_depth_limit_exceeded);
-      return false;
-    }
-
-    return ExprEvaluatorBaseTy::Visit(E);
-  }
-
   //===--------------------------------------------------------------------===//
   //                            Visitor Methods
   //===--------------------------------------------------------------------===//





More information about the cfe-commits mailing list