diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-22 14:55:54 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-22 14:55:54 +1100 |
commit | 14c0c8bb717a668084cae8cd4b359ffd6fca73b0 (patch) | |
tree | 410d429c004f40f1f47fadb4ff0fe701a50eb285 /clang/lib | |
parent | 86ca7448849aaaea6db34b1d2bcf8d99d7d7b12c (diff) |
Try fixing clang to work with the fixed solver.
(This may not compile, for an annoying reason. I'll check in again soon
with something better-er, or whatever.)
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Analysis/Interval.cpp | 42 |
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"; - } + } + */ } |