Skip to content

Commit f085c9f

Browse files
mrjackvpfez
authored andcommitted
mlir::raw_indented_ostream: custom indent value
Changes raw_indented_ostream to make it possible to specify a custom indentation amount.
1 parent 02a6ff6 commit f085c9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir/include/mlir/Support/IndentedOstream.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace mlir {
2222
/// raw_ostream subclass that simplifies indention a sequence of code.
2323
class raw_indented_ostream : public raw_ostream {
2424
public:
25-
explicit raw_indented_ostream(llvm::raw_ostream &os) : os(os) {
25+
explicit raw_indented_ostream(llvm::raw_ostream &os, int indentSize = 2) : indentSize(indentSize), os(os) {
2626
SetUnbuffered();
2727
}
2828

@@ -83,7 +83,7 @@ class raw_indented_ostream : public raw_ostream {
8383
uint64_t current_pos() const override { return os.tell(); }
8484

8585
/// Constant indent added/removed.
86-
static constexpr int indentSize = 2;
86+
int indentSize;
8787

8888
// Tracker for current indentation.
8989
int currentIndent = 0;

0 commit comments

Comments
 (0)