|
tvm
|
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. More...
#include <base.h>
Public Member Functions | |
| IRBuilderFrameObj () | |
| Capture the source-call context when this frame is constructed. | |
| TVM_FFI_DECLARE_OBJECT_INFO ("script.ir_builder.IRBuilderFrame", IRBuilderFrameObj, ffi::Object) | |
| virtual | ~IRBuilderFrameObj ()=default |
| Default destructor. | |
| virtual void | EnterWithScope () |
| The method called when entering RAII scope. | |
| virtual void | ExitWithScope () |
| The method called when exiting RAII scope. | |
| void | AddCallback (ffi::TypedFunction< void()> callback) |
| Add a callback method invoked when exiting the RAII scope. | |
Static Public Member Functions | |
| static void | RegisterReflection () |
Public Attributes | |
| std::vector< ffi::TypedFunction< void()> > | callbacks |
| A list of callbacks used when exiting the frame. | |
| Location | loc = UnknownLoc() |
| Source context retained until this frame constructs its result. | |
Static Public Attributes | |
| static constexpr const bool | _type_mutable = true |
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.
| tvm::script::ir_builder::IRBuilderFrameObj::IRBuilderFrameObj | ( | ) |
Capture the source-call context when this frame is constructed.
|
virtualdefault |
Default destructor.
| void tvm::script::ir_builder::IRBuilderFrameObj::AddCallback | ( | ffi::TypedFunction< void()> | callback | ) |
Add a callback method invoked when exiting the RAII scope.
| callback | The callback to be added. |
|
virtual |
The method called when entering RAII scope.
Reimplemented in tvm::script::ir_builder::relax::FunctionFrameObj, tvm::script::ir_builder::relax::BindingBlockFrameObj, tvm::script::ir_builder::relax::IfFrameObj, tvm::script::ir_builder::relax::ThenFrameObj, tvm::script::ir_builder::relax::ElseFrameObj, tvm::script::ir_builder::s_tir::BlockInitFrameObj, tvm::script::ir_builder::ir::ThenFrameObj, tvm::script::ir_builder::ir::ElseFrameObj, and tvm::script::ir_builder::relax::SeqExprFrameObj.
|
virtual |
The method called when exiting RAII scope.
Reimplemented in tvm::script::ir_builder::relax::FunctionFrameObj, tvm::script::ir_builder::relax::BindingBlockFrameObj, tvm::script::ir_builder::relax::IfFrameObj, tvm::script::ir_builder::relax::ThenFrameObj, tvm::script::ir_builder::relax::ElseFrameObj, tvm::script::ir_builder::s_tir::SBlockFrameObj, tvm::script::ir_builder::s_tir::BlockInitFrameObj, tvm::script::ir_builder::ir::IRModuleFrameObj, tvm::script::ir_builder::ir::ForFrameObj, tvm::script::ir_builder::ir::AssertFrameObj, tvm::script::ir_builder::ir::RegionFrameObj, tvm::script::ir_builder::ir::WhileFrameObj, tvm::script::ir_builder::ir::IfFrameObj, tvm::script::ir_builder::ir::ThenFrameObj, tvm::script::ir_builder::ir::ElseFrameObj, tvm::script::ir_builder::tirx::FunctionFrameObj, and tvm::script::ir_builder::relax::SeqExprFrameObj.
|
inlinestatic |
| tvm::script::ir_builder::IRBuilderFrameObj::TVM_FFI_DECLARE_OBJECT_INFO | ( | "script.ir_builder.IRBuilderFrame" | , |
| IRBuilderFrameObj | , | ||
| ffi::Object | |||
| ) |
|
staticconstexpr |
| std::vector<ffi::TypedFunction<void()> > tvm::script::ir_builder::IRBuilderFrameObj::callbacks |
A list of callbacks used when exiting the frame.
|
mutable |
Source context retained until this frame constructs its result.