MLIR  19.0.0git
Public Member Functions | List of all members
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. More...
 
 MethodBody (MethodBody &&other)
 Define a move constructor to correctly initialize the streams. More...
 
MethodBodyoperator= (MethodBody &&body)
 Define a move assignment operator. More...
 
template<typename ValueT >
MethodBodyoperator<< (ValueT &&value)
 Write a value to the method body. More...
 
void writeTo (raw_indented_ostream &os) const
 Write the method body to the output stream. More...
 
MethodBodyindent ()
 Indent the output stream. More...
 
MethodBodyunindent ()
 Unindent the output stream. More...
 
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. More...
 
raw_indented_ostreamgetStream ()
 Get the underlying indented output stream. More...
 

Detailed Description

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

Definition at line 196 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 112 of file Class.cpp.

Referenced by operator=().

◆ MethodBody() [2/2]

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

Define a move constructor to correctly initialize the streams.

Definition at line 203 of file Class.h.

Member Function Documentation

◆ getStream()

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

Get the underlying indented output stream.

Definition at line 246 of file Class.h.

◆ indent()

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

Indent the output stream.

Definition at line 229 of file Class.h.

References mlir::raw_indented_ostream::indent().

Referenced by scope().

◆ operator<<()

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

Write a value to the method body.

Definition at line 216 of file Class.h.

◆ 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 208 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 241 of file Class.h.

References indent(), and mlir::raw_indented_ostream::scope().

◆ unindent()

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

Unindent the output stream.

Definition at line 234 of file Class.h.

References mlir::raw_indented_ostream::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 115 of file Class.cpp.

Referenced by mlir::tblgen::Method::writeDeclTo().


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