Class IRBuilderFrameObj#

Inheritance Relationships#

Base Type#

  • public ffi::Object

Derived Types#

Class Documentation#

class IRBuilderFrameObj : public ffi::Object#

A stack frame of the IRBuilder used to keep track of the current scope. Furthermore, the information stored in each stack frame can be useful for context-dependent IR construction.

Frames capture construction context and nested scopes. Language variant builders define concrete frame subclasses and decide how their contents contribute to the result.

Subclassed by tvm::script::ir_builder::ir::IRModuleFrameObj, tvm::script::ir_builder::ir::StmtFrameObj

Public Functions

IRBuilderFrameObj()#

Capture the source-call context when this frame is constructed.

virtual ~IRBuilderFrameObj() = default#

Default destructor.

virtual void EnterWithScope()#

The method called when entering RAII scope.

See also

tvm::support::With

virtual void ExitWithScope()#

The method called when exiting RAII scope.

See also

tvm::support::With

void AddCallback(ffi::TypedFunction<void()> callback)#

Add a callback method invoked when exiting the RAII scope.

Parameters:

callback – The callback to be added.

Public Members

std::vector<ffi::TypedFunction<void()>> callbacks#

A list of callbacks used when exiting the frame.

mutable Location loc = UnknownLoc()#

Source context retained until this frame constructs its result.

Public Static Functions

static inline void RegisterReflection()#
static inline int32_t _GetOrAllocRuntimeTypeIndex()#
static inline int32_t RuntimeTypeIndex() noexcept#