1414#include " llvm/ADT/iterator.h"
1515#include " llvm/Config/abi-breaking.h"
1616#include " llvm/Support/Casting.h"
17- #include " llvm/Support/Debug .h"
17+ #include " llvm/Support/DebugLog .h"
1818#include " llvm/Support/raw_ostream.h"
1919
2020#define DEBUG_TYPE " dataflow"
@@ -44,9 +44,8 @@ void AnalysisState::addDependency(ProgramPoint *dependent,
4444 (void )inserted;
4545 DATAFLOW_DEBUG ({
4646 if (inserted) {
47- llvm::dbgs () << " Creating dependency between " << debugName << " of "
48- << anchor << " \n and " << debugName << " on " << dependent
49- << " \n " ;
47+ LDBG () << " Creating dependency between " << debugName << " of " << anchor
48+ << " \n and " << debugName << " on " << dependent;
5049 }
5150 });
5251}
@@ -116,8 +115,7 @@ LogicalResult DataFlowSolver::initializeAndRun(Operation *top) {
116115
117116 // Initialize the analyses.
118117 for (DataFlowAnalysis &analysis : llvm::make_pointee_range (childAnalyses)) {
119- DATAFLOW_DEBUG (llvm::dbgs ()
120- << " Priming analysis: " << analysis.debugName << " \n " );
118+ DATAFLOW_DEBUG (LDBG () << " Priming analysis: " << analysis.debugName );
121119 if (failed (analysis.initialize (top)))
122120 return failure ();
123121 }
@@ -129,8 +127,8 @@ LogicalResult DataFlowSolver::initializeAndRun(Operation *top) {
129127 auto [point, analysis] = worklist.front ();
130128 worklist.pop ();
131129
132- DATAFLOW_DEBUG (llvm::dbgs () << " Invoking '" << analysis->debugName
133- << " ' on: " << point << " \n " );
130+ DATAFLOW_DEBUG (LDBG () << " Invoking '" << analysis->debugName
131+ << " ' on: " << point);
134132 if (failed (analysis->visit (point)))
135133 return failure ();
136134 }
@@ -143,9 +141,9 @@ void DataFlowSolver::propagateIfChanged(AnalysisState *state,
143141 assert (isRunning &&
144142 " DataFlowSolver is not running, should not use propagateIfChanged" );
145143 if (changed == ChangeResult::Change) {
146- DATAFLOW_DEBUG (llvm::dbgs () << " Propagating update to " << state->debugName
147- << " of " << state->anchor << " \n "
148- << " Value: " << *state << " \n " );
144+ DATAFLOW_DEBUG (LDBG () << " Propagating update to " << state->debugName
145+ << " of " << state->anchor << " \n "
146+ << " Value: " << *state);
149147 state->onUpdate (this );
150148 }
151149}
0 commit comments