MLIR  14.0.0git
Public Types | Public Member Functions | List of all members
mlir::AsmState Class Reference

This class provides management for the lifetime of the state used when printing the IR. More...

#include "mlir/IR/AsmState.h"

Public Types

using LocationMap = DenseMap< Operation *, std::pair< unsigned, unsigned > >
 This map represents the raw locations of operations within the output stream. More...
 

Public Member Functions

 AsmState (Operation *op, const OpPrintingFlags &printerFlags=OpPrintingFlags(), LocationMap *locationMap=nullptr)
 Initialize the asm state at the level of the given operation. More...
 
 ~AsmState ()
 
detail::AsmStateImplgetImpl ()
 Return an instance of the internal implementation. More...
 

Detailed Description

This class provides management for the lifetime of the state used when printing the IR.

It allows for alleviating the cost of recomputing the internal state of the asm printer.

The IR should not be mutated in-between invocations using this state, and the IR being printed must not be an parent of the IR originally used to initialize this state. This means that if a child operation is provided, a parent operation cannot reuse this state.

Definition at line 36 of file AsmState.h.

Member Typedef Documentation

◆ LocationMap

This map represents the raw locations of operations within the output stream.

This maps the original pointer to the operation, to a pair of line and column in the output stream.

Definition at line 41 of file AsmState.h.

Constructor & Destructor Documentation

◆ AsmState()

AsmState::AsmState ( Operation op,
const OpPrintingFlags printerFlags = OpPrintingFlags(),
LocationMap locationMap = nullptr 
)

Initialize the asm state at the level of the given operation.

A location map may optionally be provided to be populated when printing.

Definition at line 1215 of file AsmPrinter.cpp.

References ~AsmState().

◆ ~AsmState()

AsmState::~AsmState ( )
default

Referenced by AsmState().

Member Function Documentation

◆ getImpl()

detail::AsmStateImpl& mlir::AsmState::getImpl ( )
inline

Return an instance of the internal implementation.

Returns nullptr if the state has not been initialized.

Definition at line 52 of file AsmState.h.

References mlir::registerAsmPrinterCLOptions().

Referenced by mlir::Operation::print(), mlir::Block::print(), mlir::Value::printAsOperand(), and mlir::Block::printAsOperand().


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