summaryrefslogtreecommitdiff
path: root/clang/include/clang/Analysis/Analyses/IntervalSolver/EquationSystem.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include/clang/Analysis/Analyses/IntervalSolver/EquationSystem.hpp')
-rw-r--r--clang/include/clang/Analysis/Analyses/IntervalSolver/EquationSystem.hpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/clang/include/clang/Analysis/Analyses/IntervalSolver/EquationSystem.hpp b/clang/include/clang/Analysis/Analyses/IntervalSolver/EquationSystem.hpp
index d95366d..3342cc7 100644
--- a/clang/include/clang/Analysis/Analyses/IntervalSolver/EquationSystem.hpp
+++ b/clang/include/clang/Analysis/Analyses/IntervalSolver/EquationSystem.hpp
@@ -91,13 +91,12 @@ struct EquationSystem {
void indexMaxExpressions() {
_expr_to_var = new IdMap<MaxExpression<Domain>,Variable<Domain>*>(maxExpressionCount(), NULL);
for (unsigned int i = 0, length = _right_sides.size(); i < length; ++i) {
- if (_right_sides[i])
- _right_sides[i]->mapTo(*_variables[i], *_expr_to_var);
+ _right_sides[i]->mapTo(*_variables[i], *_expr_to_var);
}
}
Variable<Domain>* varFromExpr(const Expression<Domain>& expr) const {
- assert(_expr_to_var != NULL); // ensure we've indexed
+ assert(_expr_to_var); // make sure we've indexed
const MaxExpression<Domain>* maxExpr = expr.toMaxExpression();//dynamic_cast<const MaxExpression<Domain>*>(&expr);
if (maxExpr) {
return (*_expr_to_var)[*maxExpr];
@@ -106,7 +105,7 @@ struct EquationSystem {
}
}
- virtual bool equalAssignments(const VariableAssignment<Domain>& l, const VariableAssignment<Domain>& r) const {
+ virtual bool equalAssignments(VariableAssignment<Domain>& l, VariableAssignment<Domain>& r) const {
for (unsigned int i = 0, length = _variables.size();
i < length;
++i) {
@@ -121,10 +120,7 @@ struct EquationSystem {
for (unsigned int i = 0, length = _variables.size();
i < length;
++i) {
- if (_right_sides[i])
- cout << *_variables[i] << " = " << *_right_sides[i] << std::endl;
- else
- cout << *_variables[i] << " = NULL" << std::endl;
+ cout << *_variables[i] << " = " << *_right_sides[i] << std::endl;
}
}