MLIR 22.0.0git
mlir::tblgen::MethodBody Class Reference

This class contains the body of a C++ method. More...

#include "mlir/TableGen/Class.h"

Public Member Functions

 MethodBody (bool declOnly)
 Create a method body, indicating whether it should be elided for methods that are declaration-only.
 MethodBody (MethodBody &&other)
 Define a move constructor to correctly initialize the streams.
MethodBodyoperator= (MethodBody &&body)
 Define a move assignment operator.
template<typename ValueT>
MethodBodyoperator<< (ValueT &&value)
 Write a value to the method body.
void writeTo (raw_indented_ostream &os) const
 Write the method body to the output stream.
MethodBodyindent ()
 Indent the output stream.
MethodBodyunindent ()
 Unindent the output stream.
raw_indented_ostream::DelimitedScope scope (StringRef open="", StringRef close="", bool indent=false)
 Create a delimited scope: immediately print open, indent if indent is true, and print close on object destruction.
raw_indented_ostreamgetStream ()
 Get the underlying indented output stream.

Detailed Description

This class contains the body of a C++ method.

Definition at line 201 of file Class.h.

Constructor & Destructor Documentation

◆ MethodBody() [1/2]

MethodBody::MethodBody ( bool declOnly)

Create a method body, indicating whether it should be elided for methods that are declaration-only.

Definition at line 110 of file Class.cpp.

Referenced by indent(), MethodBody(), operator<<(), operator=(), and unindent().

◆ MethodBody() [2/2]

mlir::tblgen::MethodBody::MethodBody ( MethodBody && other)
inline

Define a move constructor to correctly initialize the streams.

Definition at line 208 of file Class.h.

References MethodBody().

Member Function Documentation

◆ getStream()

raw_indented_ostream & mlir::tblgen::MethodBody::getStream ( )
inline

Get the underlying indented output stream.

Definition at line 251 of file Class.h.

◆ indent()

MethodBody & mlir::tblgen::MethodBody::indent ( )
inline

Indent the output stream.

Definition at line 234 of file Class.h.

References indent(), and MethodBody().

Referenced by indent(), and scope().

◆ operator<<()

template<typename ValueT>
MethodBody & mlir::tblgen::MethodBody::operator<< ( ValueT && value)
inline

Write a value to the method body.

Definition at line 221 of file Class.h.

References MethodBody().

◆ operator=()

MethodBody & mlir::tblgen::MethodBody::operator= ( MethodBody && body)
inline

Define a move assignment operator.

raw_ostream has deleted assignment operators, so reinitialize the whole object.

Definition at line 213 of file Class.h.

References MethodBody().

◆ scope()

raw_indented_ostream::DelimitedScope mlir::tblgen::MethodBody::scope ( StringRef open = "",
StringRef close = "",
bool indent = false )
inline

Create a delimited scope: immediately print open, indent if indent is true, and print close on object destruction.

Definition at line 246 of file Class.h.

References indent().

◆ unindent()

MethodBody & mlir::tblgen::MethodBody::unindent ( )
inline

Unindent the output stream.

Definition at line 239 of file Class.h.

References MethodBody(), and unindent().

Referenced by unindent().

◆ writeTo()

void MethodBody::writeTo ( raw_indented_ostream & os) const

Write the method body to the output stream.

The body can be written as part of the declaration of an inline method or just in the definition.

Definition at line 113 of file Class.cpp.


The documentation for this class was generated from the following files: