My Project
Public Member Functions | Static Public Member Functions | Friends | List of all members
mlir::edsc::ScopedContext Class Reference

#include <Builders.h>

Public Member Functions

 ScopedContext (OpBuilder &builder, Location location)
 
 ScopedContext (OpBuilder &builder, OpBuilder::InsertPoint newInsertPt, Location location)
 
 ~ScopedContext ()
 

Static Public Member Functions

static MLIRContextgetContext ()
 
static OpBuildergetBuilder ()
 
static Location getLocation ()
 

Friends

class NestedBuilder
 

Detailed Description

Helper class to transparently handle builder insertion points by RAII. As its name indicates, a ScopedContext is means to be used locally in a scoped fashion. This abstracts away all the boilerplate related to checking proper usage of captures, NestedBuilders as well as handling the setting and restoring of insertion points.

Constructor & Destructor Documentation

◆ ScopedContext() [1/2]

mlir::edsc::ScopedContext::ScopedContext ( OpBuilder builder,
Location  location 
)

◆ ScopedContext() [2/2]

mlir::edsc::ScopedContext::ScopedContext ( OpBuilder builder,
OpBuilder::InsertPoint  newInsertPt,
Location  location 
)

Sets the insertion point of the builder to 'newInsertPt' for the duration of the scope. The existing insertion point of the builder is restored on destruction.

◆ ~ScopedContext()

mlir::edsc::ScopedContext::~ScopedContext ( )

Member Function Documentation

◆ getBuilder()

OpBuilder & mlir::edsc::ScopedContext::getBuilder ( )
static

◆ getContext()

MLIRContext * mlir::edsc::ScopedContext::getContext ( )
static

◆ getLocation()

Location mlir::edsc::ScopedContext::getLocation ( )
static

Friends And Related Function Documentation

◆ NestedBuilder

friend class NestedBuilder
friend

Only NestedBuilder (which is used to create an operation with a body) may access private members in order to implement scoping.


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