14
14
#include " llvm/ADT/iterator.h"
15
15
#include " llvm/Config/abi-breaking.h"
16
16
#include " llvm/Support/Casting.h"
17
- #include " llvm/Support/Debug .h"
17
+ #include " llvm/Support/DebugLog .h"
18
18
#include " llvm/Support/raw_ostream.h"
19
19
20
20
#define DEBUG_TYPE " dataflow"
@@ -44,9 +44,8 @@ void AnalysisState::addDependency(ProgramPoint *dependent,
44
44
(void )inserted;
45
45
DATAFLOW_DEBUG ({
46
46
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;
50
49
}
51
50
});
52
51
}
@@ -116,8 +115,7 @@ LogicalResult DataFlowSolver::initializeAndRun(Operation *top) {
116
115
117
116
// Initialize the analyses.
118
117
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 );
121
119
if (failed (analysis.initialize (top)))
122
120
return failure ();
123
121
}
@@ -129,8 +127,8 @@ LogicalResult DataFlowSolver::initializeAndRun(Operation *top) {
129
127
auto [point, analysis] = worklist.front ();
130
128
worklist.pop ();
131
129
132
- DATAFLOW_DEBUG (llvm::dbgs () << " Invoking '" << analysis->debugName
133
- << " ' on: " << point << " \n " );
130
+ DATAFLOW_DEBUG (LDBG () << " Invoking '" << analysis->debugName
131
+ << " ' on: " << point);
134
132
if (failed (analysis->visit (point)))
135
133
return failure ();
136
134
}
@@ -143,9 +141,9 @@ void DataFlowSolver::propagateIfChanged(AnalysisState *state,
143
141
assert (isRunning &&
144
142
" DataFlowSolver is not running, should not use propagateIfChanged" );
145
143
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);
149
147
state->onUpdate (this );
150
148
}
151
149
}
0 commit comments