diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-29 00:50:52 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-29 00:50:52 +0000 |
commit | 51f4708c00110940ca3f337961915f2ca1668375 (patch) | |
tree | 8507a7dfb0f17042f2373b7fa309b00967283c2c /lib/StaticAnalyzer/Core/ExprEngineC.cpp | |
parent | 7800212ef29be314d55814e8dcc568ff8beed106 (diff) |
Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143263 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngineC.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngineC.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/lib/StaticAnalyzer/Core/ExprEngineC.cpp index 1769ba35b3..bf97b8bbad 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -489,7 +489,7 @@ VisitOffsetOfExpr(const OffsetOfExpr *OOE, ExplodedNode *Pred, ExplodedNodeSet &Dst) { StmtNodeBuilder B(Pred, Dst, *currentBuilderContext); Expr::EvalResult Res; - if (OOE->Evaluate(Res, getContext()) && Res.Val.isInt()) { + if (OOE->EvaluateAsRValue(Res, getContext()) && Res.Val.isInt()) { const APSInt &IV = Res.Val.getInt(); assert(IV.getBitWidth() == getContext().getTypeSize(OOE->getType())); assert(OOE->getType()->isIntegerType()); @@ -526,7 +526,7 @@ VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Ex, } Expr::EvalResult Result; - Ex->Evaluate(Result, getContext()); + Ex->EvaluateAsRValue(Result, getContext()); CharUnits amt = CharUnits::fromQuantity(Result.Val.getInt().getZExtValue()); const ProgramState *state = Pred->getState(); |