[mlir] Add operator<< for printing Block (#92550)
Turns out it was already in Analysis/CFGLoopInfo, so just move it to IR/AsmPrinter.
This commit is contained in:
committed by
GitHub
parent
4b62afca64
commit
33550b43f4
@@ -49,8 +49,6 @@ public:
|
||||
CFGLoopInfo(const llvm::DominatorTreeBase<mlir::Block, false> &domTree);
|
||||
};
|
||||
|
||||
raw_ostream &operator<<(raw_ostream &os, mlir::Block &block);
|
||||
|
||||
} // namespace mlir
|
||||
|
||||
#endif // MLIR_ANALYSIS_LOOPINFO_H
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
namespace llvm {
|
||||
class BitVector;
|
||||
class raw_ostream;
|
||||
} // namespace llvm
|
||||
|
||||
namespace mlir {
|
||||
@@ -401,6 +402,8 @@ private:
|
||||
|
||||
friend struct llvm::ilist_traits<Block>;
|
||||
};
|
||||
|
||||
raw_ostream &operator<<(raw_ostream &, Block &);
|
||||
} // namespace mlir
|
||||
|
||||
#endif // MLIR_IR_BLOCK_H
|
||||
|
||||
@@ -23,8 +23,3 @@ CFGLoopInfo::CFGLoopInfo(
|
||||
const llvm::DominatorTreeBase<mlir::Block, false> &domTree) {
|
||||
analyze(domTree);
|
||||
}
|
||||
|
||||
raw_ostream &mlir::operator<<(raw_ostream &os, mlir::Block &block) {
|
||||
block.print(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
@@ -3984,6 +3984,11 @@ void Block::printAsOperand(raw_ostream &os, AsmState &state) {
|
||||
printer.printBlockName(this);
|
||||
}
|
||||
|
||||
raw_ostream &mlir::operator<<(raw_ostream &os, Block &block) {
|
||||
block.print(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
// Custom printers
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
||||
Reference in New Issue
Block a user