MLIR
20.0.0git
|
raw_ostream subclass that simplifies indention a sequence of code. More...
#include "mlir/Support/IndentedOstream.h"
Classes | |
struct | DelimitedScope |
Simple RAII struct to use to indentation around entering/exiting region. More... | |
Public Member Functions | |
raw_indented_ostream (llvm::raw_ostream &os) | |
raw_ostream & | getOStream () const |
Returns the underlying (unindented) raw_ostream. More... | |
DelimitedScope | scope (StringRef open="", StringRef close="", bool indent=true) |
Returns DelimitedScope. More... | |
raw_indented_ostream & | printReindented (StringRef str, StringRef extraPrefix="") |
Prints a string re-indented to the current indent. More... | |
raw_indented_ostream & | indent () |
Increases the indent and returning this raw_indented_ostream. More... | |
raw_indented_ostream & | unindent () |
Decreases the indent and returning this raw_indented_ostream. More... | |
raw_indented_ostream & | indent (int with) |
Emits whitespace and sets the indentation for the stream. More... | |
raw_ostream subclass that simplifies indention a sequence of code.
Definition at line 23 of file IndentedOstream.h.
|
inlineexplicit |
Definition at line 25 of file IndentedOstream.h.
|
inline |
Returns the underlying (unindented) raw_ostream.
Definition at line 52 of file IndentedOstream.h.
|
inline |
Increases the indent and returning this raw_indented_ostream.
Definition at line 68 of file IndentedOstream.h.
Referenced by mlir::raw_indented_ostream::DelimitedScope::DelimitedScope(), mlir::tblgen::MethodBody::indent(), printFunctionBody(), printOperation(), and scope().
|
inline |
Emits whitespace and sets the indentation for the stream.
Definition at line 80 of file IndentedOstream.h.
|
inline |
Prints a string re-indented to the current indent.
Re-indents by removing the leading whitespace from the first non-empty line from every line of the string, skipping over empty lines at the start. Prefixes each line with extraPrefix after the indentation.
Definition at line 114 of file IndentedOstream.h.
References min().
|
inline |
Returns DelimitedScope.
Definition at line 55 of file IndentedOstream.h.
References indent().
Referenced by mlir::tblgen::MethodBody::scope().
|
inline |
Decreases the indent and returning this raw_indented_ostream.
Definition at line 74 of file IndentedOstream.h.
References max().
Referenced by printFunctionBody(), printOperation(), mlir::tblgen::MethodBody::unindent(), and mlir::raw_indented_ostream::DelimitedScope::~DelimitedScope().