13
13
#include " clang/3C/3CGlobalOptions.h"
14
14
#include " clang/3C/ConstraintVariables.h"
15
15
#include " clang/3C/ConstraintsGraph.h"
16
- #include " llvm/Support/CommandLine.h"
17
16
#include < iostream>
18
17
#include < set>
19
18
20
19
using namespace llvm ;
21
20
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
-
36
21
// Remove the constraint from the global constraint set.
37
22
bool Constraints::removeConstraint (Constraint *C) {
38
23
bool RetVal = false ;
@@ -339,7 +324,7 @@ bool Constraints::graphBasedSolve() {
339
324
}
340
325
}
341
326
342
- if (DebugSolver)
327
+ if (_3COpts. DebugSolver )
343
328
GraphVizOutputGraph::dumpConstraintGraphs (" initial_constraints_graph.dot" ,
344
329
SolChkCG, SolPtrTypCG);
345
330
@@ -351,9 +336,9 @@ bool Constraints::graphBasedSolve() {
351
336
// Now solve PtrType constraints
352
337
if (Res && _3COpts.AllTypes ) {
353
338
Env.doCheckedSolve (false );
354
- bool RegularSolve = !(OnlyGreatestSol || OnlyLeastSol);
339
+ bool RegularSolve = !(_3COpts. OnlyGreatestSol || _3COpts. OnlyLeastSol );
355
340
356
- if (OnlyLeastSol) {
341
+ if (_3COpts. OnlyLeastSol ) {
357
342
// Do only least solution.
358
343
// First reset ptr solution to NTArr.
359
344
Env.resetSolution (
@@ -363,7 +348,7 @@ bool Constraints::graphBasedSolve() {
363
348
},
364
349
getNTArr ());
365
350
Res = doSolve (SolPtrTypCG, Env, this , true , nullptr , Conflicts);
366
- } else if (OnlyGreatestSol) {
351
+ } else if (_3COpts. OnlyGreatestSol ) {
367
352
// Do only greatest solution
368
353
Res = doSolve (SolPtrTypCG, Env, this , false , nullptr , Conflicts);
369
354
} else {
@@ -481,13 +466,13 @@ bool Constraints::graphBasedSolve() {
481
466
// an empty. If the system could not be solved, the constraints in conflict
482
467
// are returned in the first position.
483
468
void Constraints::solve () {
484
- if (DebugSolver) {
469
+ if (_3COpts. DebugSolver ) {
485
470
errs () << " constraints beginning solve\n " ;
486
471
dump ();
487
472
}
488
473
graphBasedSolve ();
489
474
490
- if (DebugSolver) {
475
+ if (_3COpts. DebugSolver ) {
491
476
errs () << " solution, when done solving\n " ;
492
477
Environment.dump ();
493
478
}
0 commit comments