diff options
| author | Anders Carlsson <andersca@mac.com> | 2008-12-19 20:58:05 +0000 | 
|---|---|---|
| committer | Anders Carlsson <andersca@mac.com> | 2008-12-19 20:58:05 +0000 | 
| commit | 6736d1a2bb9e690cf88d2fe9bcb3896a66334833 (patch) | |
| tree | 1d411f8c73dffa41c0f66b8b3bf1b3e524edbecf /clang/lib/AST/Expr.cpp | |
| parent | 0869f78555d7799c2e3cb35d2fcffa22cbaff08f (diff) | |
| download | bcm5719-llvm-6736d1a2bb9e690cf88d2fe9bcb3896a66334833.tar.gz bcm5719-llvm-6736d1a2bb9e690cf88d2fe9bcb3896a66334833.zip | |
Get rid of the old Expr::Evaluate variant.
llvm-svn: 61260
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index c01c973cf59..8aaea7ac9f3 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -763,9 +763,11 @@ bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx,      // If this is a call to a builtin function, constant fold it otherwise      // reject it.      if (CE->isBuiltinCall()) { -      APValue ResultAP; -      if (CE->Evaluate(ResultAP, Ctx)) { -        Result = ResultAP.getInt(); +      EvalResult EvalResult; +      if (CE->Evaluate(EvalResult, Ctx)) { +        assert(!EvalResult.HasSideEffects &&  +               "Foldable builtin call should not have side effects!"); +        Result = EvalResult.Val.getInt();          break;  // It is a constant, expand it.        }      } | 

