1313#include " clang/3C/3CGlobalOptions.h"
1414#include " clang/3C/ConstraintVariables.h"
1515#include " clang/3C/ConstraintsGraph.h"
16- #include " llvm/Support/CommandLine.h"
1716#include < iostream>
1817#include < set>
1918
2019using namespace llvm ;
2120
22- static cl::OptionCategory SolverCategory (" solver options" );
23- static cl::opt<bool > DebugSolver (" debug-solver" ,
24- cl::desc (" Dump intermediate solver state" ),
25- cl::init(false ), cl::cat(SolverCategory));
26- static cl::opt<bool > OnlyGreatestSol (
27- " only-g-sol" ,
28- cl::desc (" Perform only greatest solution for Pty Constrains." ),
29- cl::init(false ), cl::cat(SolverCategory));
30-
31- static cl::opt<bool >
32- OnlyLeastSol (" only-l-sol" ,
33- cl::desc (" Perform only least solution for Pty Constrains." ),
34- cl::init(false ), cl::cat(SolverCategory));
35-
3621// Remove the constraint from the global constraint set.
3722bool Constraints::removeConstraint (Constraint *C) {
3823 bool RetVal = false ;
@@ -339,7 +324,7 @@ bool Constraints::graphBasedSolve() {
339324 }
340325 }
341326
342- if (DebugSolver)
327+ if (_3COpts. DebugSolver )
343328 GraphVizOutputGraph::dumpConstraintGraphs (" initial_constraints_graph.dot" ,
344329 SolChkCG, SolPtrTypCG);
345330
@@ -351,9 +336,9 @@ bool Constraints::graphBasedSolve() {
351336 // Now solve PtrType constraints
352337 if (Res && _3COpts.AllTypes ) {
353338 Env.doCheckedSolve (false );
354- bool RegularSolve = !(OnlyGreatestSol || OnlyLeastSol);
339+ bool RegularSolve = !(_3COpts. OnlyGreatestSol || _3COpts. OnlyLeastSol );
355340
356- if (OnlyLeastSol) {
341+ if (_3COpts. OnlyLeastSol ) {
357342 // Do only least solution.
358343 // First reset ptr solution to NTArr.
359344 Env.resetSolution (
@@ -363,7 +348,7 @@ bool Constraints::graphBasedSolve() {
363348 },
364349 getNTArr ());
365350 Res = doSolve (SolPtrTypCG, Env, this , true , nullptr , Conflicts);
366- } else if (OnlyGreatestSol) {
351+ } else if (_3COpts. OnlyGreatestSol ) {
367352 // Do only greatest solution
368353 Res = doSolve (SolPtrTypCG, Env, this , false , nullptr , Conflicts);
369354 } else {
@@ -481,13 +466,13 @@ bool Constraints::graphBasedSolve() {
481466// an empty. If the system could not be solved, the constraints in conflict
482467// are returned in the first position.
483468void Constraints::solve () {
484- if (DebugSolver) {
469+ if (_3COpts. DebugSolver ) {
485470 errs () << " constraints beginning solve\n " ;
486471 dump ();
487472 }
488473 graphBasedSolve ();
489474
490- if (DebugSolver) {
475+ if (_3COpts. DebugSolver ) {
491476 errs () << " solution, when done solving\n " ;
492477 Environment.dump ();
493478 }
0 commit comments