diff options
author | Carlo Zancanaro <carlo@carlo-laptop> | 2012-10-23 15:16:31 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@carlo-laptop> | 2012-10-23 15:16:31 +1100 |
commit | 3002319eb5fd6b3eff0ffa764534bb571536a08c (patch) | |
tree | c2f79591a54aff370b34717ebf50358f62d4bda4 /clang/lib/Analysis/Interval.cpp | |
parent | a1b28d756fe52a53d9d4da4d23853969fd529115 (diff) | |
parent | 14c0c8bb717a668084cae8cd4b359ffd6fca73b0 (diff) |
Merge branch 'master' of https://bitbucket.org/czan/honours
Conflicts:
.gitignore
impl/MaxStrategy.hpp
impl/VariableAssignment.hpp
impl/systems/test.eqns
impl/test/7.eqns
Diffstat (limited to 'clang/lib/Analysis/Interval.cpp')
-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"; - } + } + */ } |