summaryrefslogtreecommitdiff
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/Interval.cpp42
1 files changed, 13 insertions, 29 deletions
diff --git a/clang/lib/Analysis/Interval.cpp b/clang/lib/Analysis/Interval.cpp
index ac96107..d005048 100644
--- a/clang/lib/Analysis/Interval.cpp
+++ b/clang/lib/Analysis/Interval.cpp
@@ -702,40 +702,24 @@ void IntervalAnalysis::runOnAllBlocks() {
}
}
- std::vector<EqnExpr*> a;
-
- a.push_back(&system.constant(-infinity<ZBar>()));
- a.push_back(&system.constant(0));
- system[system.variable("x")] = &system.maxExpression(a);
- a.clear();
-
- system.variable("y");
-
- a.push_back(&system.variable("x"));
- a.push_back(&system.variable("z"));
- EqnExpr* minExpr = &system.expression(new Maximum<ZBar>(), a);
- a.clear();
-
- a.push_back(&system.constant(-infinity<ZBar>()));
- a.push_back(minExpr);
- system[system.variable("y")] = &system.maxExpression(a);
- a.clear();
-
- a.push_back(&system.constant(-infinity<ZBar>()));
- a.push_back(&system.variable("y"));
- system[system.variable("z")] = &system.maxExpression(a);
-
- llvm::errs() << toString(system) << "\n";
-
system.indexMaxExpressions();
- DynamicMaxStrategy<ZBar> strategy(system);
- DynamicVariableAssignment<ZBar> rho(system, strategy);
- strategy.setRho(rho);
+ IdMap<EqnVar,ZBar> result = solve_for(system);
for (unsigned int i = 0, size = system.variableCount(); i < size; ++i) {
+ EqnVar& var = system.variable(i);
+ cout << var.name() << " = " << result[var] << endl;
+ }
+
+ /*
+ DynamicMaxStrategy<ZBar> strategy(system);
+ DynamicVariableAssignment<ZBar> rho(system, strategy);
+ strategy.setRho(rho);
+
+ for (unsigned int i = 0, size = system.variableCount(); i < size; ++i) {
EqnVar& var = system.variable(size - i - 1);
llvm::errs() << toString(var.name()) << " = " << toString(rho[var]) << "\n";
- }
+ }
+ */
}