From b79283306f300489c101460609f9d3d84a6691b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 3 Oct 2019 08:48:05 +0200 Subject: [PATCH] ExprEngine: Rename Data::conditions => Data::constraints --- lib/exprengine.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index 36540b601..16e839109 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -121,7 +121,7 @@ namespace { int * const symbolValueIndex; const Tokenizer * const tokenizer; const std::vector &callbacks; - std::vector conditions; + std::vector constraints; void assignValue(const Token *tok, unsigned int varId, ExprEngine::ValuePtr value) { mTrackExecution->symbolRange(tok, value); @@ -217,11 +217,11 @@ namespace { return std::make_shared("==", v, zero); } - void addCondition(ExprEngine::ValuePtr condValue, bool trueCond) { + void addConstraint(ExprEngine::ValuePtr condValue, bool trueCond) { if (trueCond) - conditions.push_back(condValue); + constraints.push_back(condValue); else - conditions.push_back(notValue(condValue)); + constraints.push_back(notValue(condValue)); } private: TrackExecution * const mTrackExecution; @@ -564,8 +564,8 @@ bool ExprEngine::BinOpResult::isIntValueInRange(ExprEngine::DataBase *dataBase, z3::solver solver(exprData.c); z3::expr e = ::getExpr(this, exprData); exprData.addAssertions(solver); - for (auto condition : dynamic_cast(dataBase)->conditions) - solver.add(::getExpr(condition, exprData)); + for (auto constraint : dynamic_cast(dataBase)->constraints) + solver.add(::getExpr(constraint, exprData)); solver.add(e == value); return solver.check() == z3::sat; #else @@ -582,8 +582,8 @@ std::string ExprEngine::BinOpResult::getExpr(ExprEngine::DataBase *dataBase) con z3::solver solver(exprData.c); z3::expr e = ::getExpr(this, exprData); exprData.addAssertions(solver); - for (auto condition : dynamic_cast(dataBase)->conditions) - solver.add(::getExpr(condition, exprData)); + for (auto constraint : dynamic_cast(dataBase)->constraints) + solver.add(::getExpr(constraint, exprData)); solver.add(e); std::ostringstream os; os << solver; @@ -1027,8 +1027,8 @@ static void execute(const Token *start, const Token *end, Data &data) const ExprEngine::ValuePtr condValue = executeExpression(cond, data); Data ifData(data); Data elseData(data); - ifData.addCondition(condValue, true); - elseData.addCondition(condValue, false); + ifData.addConstraint(condValue, true); + elseData.addConstraint(condValue, false); const Token *thenStart = tok->linkAt(1)->next(); const Token *thenEnd = thenStart->link();