MLIR
15.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) |
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.
References mlir::raw_indented_ostream::DelimitedScope::os.
|
inline |
Increases the indent and returning this raw_indented_ostream.
Definition at line 66 of file IndentedOstream.h.
Referenced by mlir::raw_indented_ostream::DelimitedScope::DelimitedScope(), indent(), mlir::tblgen::MethodBody::indent(), printOperation(), and mlir::tblgen::VisibilityDeclaration::writeDeclTo().
|
inline |
Emits whitespace and sets the indentation for the stream.
Definition at line 78 of file IndentedOstream.h.
References indent(), and mlir::raw_indented_ostream::DelimitedScope::os.
raw_indented_ostream & mlir::raw_indented_ostream::printReindented | ( | StringRef | str | ) |
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.
Definition at line 19 of file IndentedOstream.cpp.
References min(), and print().
Referenced by mlir::detail::Parser::parseCommaSeparatedListUntil(), scope(), mlir::tblgen::ExtraClassDeclaration::writeDeclTo(), and mlir::tblgen::ExtraClassDeclaration::writeDefTo().
|
inline |
Returns DelimitedScope.
Definition at line 55 of file IndentedOstream.h.
References mlir::raw_indented_ostream::DelimitedScope::DelimitedScope(), and printReindented().
Referenced by mlir::tblgen::MethodBody::scope(), mlir::tblgen::Class::writeDeclTo(), and mlir::tblgen::ParentClass::writeTo().
|
inline |
Decreases the indent and returning this raw_indented_ostream.
Definition at line 72 of file IndentedOstream.h.
References max().
Referenced by printOperation(), mlir::tblgen::MethodBody::unindent(), mlir::tblgen::VisibilityDeclaration::writeDeclTo(), and mlir::raw_indented_ostream::DelimitedScope::~DelimitedScope().