diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-15 18:07:13 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-15 18:07:13 +0000 |
commit | 649dfbc389671d0c852ead5953da630d675a5d43 (patch) | |
tree | abb6d6e0fc9ab3c4b188e94113d495e3bbd527e1 /lib/AST | |
parent | 30650ebe652854d8bdce832cbdae1cf3c43e54aa (diff) |
Remove hacky temporary fix of r151585.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152818 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index b8b98da25d..6023a678e2 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -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 @@ namespace { /// 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 @@ public: 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 //===--------------------------------------------------------------------===// |