|
1 | 1 | #include "mlir/IR/PatternMatch.h" |
2 | | -#include "llvm/Support/Debug.h" |
| 2 | +#include "llvm/Support/DebugLog.h" |
3 | 3 |
|
4 | 4 | #define DEBUG_TYPE "pattern-logging-listener" |
5 | | -#define DBGS() (llvm::dbgs() << "[" << DEBUG_TYPE << "] ") |
6 | | -#define LDBG(X) LLVM_DEBUG(DBGS() << X << "\n") |
7 | 5 |
|
8 | 6 | using namespace mlir; |
9 | 7 |
|
10 | 8 | void RewriterBase::PatternLoggingListener::notifyOperationInserted( |
11 | 9 | Operation *op, InsertPoint previous) { |
12 | | - LDBG(patternName << " | notifyOperationInserted" |
13 | | - << " | " << op->getName()); |
| 10 | + LDBG() << patternName << " | notifyOperationInserted" |
| 11 | + << " | " << op->getName(); |
14 | 12 | ForwardingListener::notifyOperationInserted(op, previous); |
15 | 13 | } |
16 | 14 |
|
17 | 15 | void RewriterBase::PatternLoggingListener::notifyOperationModified( |
18 | 16 | Operation *op) { |
19 | | - LDBG(patternName << " | notifyOperationModified" |
20 | | - << " | " << op->getName()); |
| 17 | + LDBG() << patternName << " | notifyOperationModified" |
| 18 | + << " | " << op->getName(); |
21 | 19 | ForwardingListener::notifyOperationModified(op); |
22 | 20 | } |
23 | 21 |
|
24 | 22 | void RewriterBase::PatternLoggingListener::notifyOperationReplaced( |
25 | 23 | Operation *op, Operation *newOp) { |
26 | | - LDBG(patternName << " | notifyOperationReplaced (with op)" |
27 | | - << " | " << op->getName() << " | " << newOp->getName()); |
| 24 | + LDBG() << patternName << " | notifyOperationReplaced (with op)" |
| 25 | + << " | " << op->getName() << " | " << newOp->getName(); |
28 | 26 | ForwardingListener::notifyOperationReplaced(op, newOp); |
29 | 27 | } |
30 | 28 |
|
31 | 29 | void RewriterBase::PatternLoggingListener::notifyOperationReplaced( |
32 | 30 | Operation *op, ValueRange replacement) { |
33 | | - LDBG(patternName << " | notifyOperationReplaced (with values)" |
34 | | - << " | " << op->getName()); |
| 31 | + LDBG() << patternName << " | notifyOperationReplaced (with values)" |
| 32 | + << " | " << op->getName(); |
35 | 33 | ForwardingListener::notifyOperationReplaced(op, replacement); |
36 | 34 | } |
37 | 35 |
|
38 | 36 | void RewriterBase::PatternLoggingListener::notifyOperationErased( |
39 | 37 | Operation *op) { |
40 | | - LDBG(patternName << " | notifyOperationErased" |
41 | | - << " | " << op->getName()); |
| 38 | + LDBG() << patternName << " | notifyOperationErased" |
| 39 | + << " | " << op->getName(); |
42 | 40 | ForwardingListener::notifyOperationErased(op); |
43 | 41 | } |
44 | 42 |
|
45 | 43 | void RewriterBase::PatternLoggingListener::notifyPatternBegin( |
46 | 44 | const Pattern &pattern, Operation *op) { |
47 | | - LDBG(patternName << " | notifyPatternBegin" |
48 | | - << " | " << op->getName()); |
| 45 | + LDBG() << patternName << " | notifyPatternBegin" |
| 46 | + << " | " << op->getName(); |
49 | 47 | ForwardingListener::notifyPatternBegin(pattern, op); |
50 | 48 | } |
0 commit comments