LLZK 2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Builder.cpp File Reference
#include "llzk/CAPI/Builder.h"
#include "llzk-c/Builder.h"
#include "llzk/CAPI/Support.h"
#include <mlir/CAPI/IR.h>
#include <mlir/CAPI/Support.h>
#include <mlir/CAPI/Wrap.h>
#include <mlir/IR/Builders.h>
Include dependency graph for Builder.cpp:

Go to the source code of this file.

Typedefs

using OpBuilderT = OpBuilder

Functions

MlirOpBuilder mlirOpBuilderCreate (MlirContext ctx)
 Creates a new OpBuilder for the given MLIR context.
MlirOpBuilder mlirOpBuilderCreateWithListener (MlirContext ctx, MlirOpBuilderListener listener)
 Creates a new OpBuilder for the given MLIR context and attaches listener so that operation and block insertion events are forwarded to its callbacks.
void mlirOpBuilderDestroy (MlirOpBuilder builder)
 Destroys builder and frees the underlying OpBuilder object.
MlirContext mlirOpBuilderGetContext (MlirOpBuilder builder)
 Returns the MLIR context associated with builder.
void mlirOpBuilderSetInsertionPointToStart (MlirOpBuilder builder, MlirBlock block)
 Sets the insertion point of builder to the beginning of block so that subsequent insertions prepend to that block.
void mlirOpBuilderSetInsertionPointToEnd (MlirOpBuilder builder, MlirBlock block)
 Sets the insertion point to the end of the given block.
void mlirOpBuilderSetInsertionPoint (MlirOpBuilder builder, MlirOperation operation)
 Sets the insertion point right before the given operation.
void mlirOpBuilderSetInsertionPointAfter (MlirOpBuilder builder, MlirOperation operation)
 Sets the insertion point right after the given operation.
void mlirOpBuilderSetInsertionPointAfterValue (MlirOpBuilder builder, MlirValue value)
 Sets the insertion point right after the given value is defined.
MlirOpBuilderInsertPoint mlirOpBuilderSaveInsertionPoint (MlirOpBuilder builder)
 Return a saved insertion point.
void mlirOpBuilderRestoreInsertionPoint (MlirOpBuilder builder, MlirOpBuilderInsertPoint rawIp)
 Restore the insert point to a previously saved point.
void mlirOpBuilderClearInsertionPoint (MlirOpBuilder builder)
 Reset the insertion point to no location.
MlirOperation mlirOpBuilderGetInsertionPoint (MlirOpBuilder builder)
 Returns the operation before which new operations will be inserted, or a null MlirOperation if there is no current insertion block or the insertion point is at the end of the block.
MlirBlock mlirOpBuilderGetInsertionBlock (MlirOpBuilder builder)
 Returns the block that builder is currently inserting into, or a null MlirBlock if no insertion point has been set.
MlirOperation mlirOpBuilderInsert (MlirOpBuilder builder, MlirOperation op)
 Inserts op at the current insertion point of builder and returns it.
MlirOpBuilderListener mlirOpBuilderListenerCreate (MlirNotifyOperationInserted opCb, MlirNotifyBlockInserted blockCb, void *userData)
 Creates a new OpBuilder::Listener that calls opCb whenever an operation is inserted and blockCb whenever a block is inserted.
void mlirOpBuilderListenerDestroy (MlirOpBuilderListener listener)
 Destroys listener and frees the underlying ListenerT object.

Typedef Documentation

◆ OpBuilderT

using OpBuilderT = OpBuilder

Definition at line 23 of file Builder.cpp.

Function Documentation

◆ mlirOpBuilderClearInsertionPoint()

void mlirOpBuilderClearInsertionPoint ( MlirOpBuilder builder)

Reset the insertion point to no location.

Definition at line 144 of file Builder.cpp.

◆ mlirOpBuilderCreate()

MlirOpBuilder mlirOpBuilderCreate ( MlirContext ctx)

Creates a new OpBuilder for the given MLIR context.

Definition at line 78 of file Builder.cpp.

◆ mlirOpBuilderCreateWithListener()

MlirOpBuilder mlirOpBuilderCreateWithListener ( MlirContext ctx,
MlirOpBuilderListener listener )

Creates a new OpBuilder for the given MLIR context and attaches listener so that operation and block insertion events are forwarded to its callbacks.

Definition at line 84 of file Builder.cpp.

◆ mlirOpBuilderDestroy()

void mlirOpBuilderDestroy ( MlirOpBuilder builder)

Destroys builder and frees the underlying OpBuilder object.

Destroys the given builder.

Definition at line 90 of file Builder.cpp.

◆ mlirOpBuilderGetContext()

MlirContext mlirOpBuilderGetContext ( MlirOpBuilder builder)

Returns the MLIR context associated with builder.

Returns the context.

Definition at line 95 of file Builder.cpp.

◆ mlirOpBuilderGetInsertionBlock()

MlirBlock mlirOpBuilderGetInsertionBlock ( MlirOpBuilder builder)

Returns the block that builder is currently inserting into, or a null MlirBlock if no insertion point has been set.

Returns the current insertion block in the builder.

Definition at line 162 of file Builder.cpp.

◆ mlirOpBuilderGetInsertionPoint()

MlirOperation mlirOpBuilderGetInsertionPoint ( MlirOpBuilder builder)

Returns the operation before which new operations will be inserted, or a null MlirOperation if there is no current insertion block or the insertion point is at the end of the block.

Returns the current insertion point in the builder.

Definition at line 150 of file Builder.cpp.

◆ mlirOpBuilderInsert()

MlirOperation mlirOpBuilderInsert ( MlirOpBuilder builder,
MlirOperation op )

Inserts op at the current insertion point of builder and returns it.

Insert the given operation at the current insertion point and return it.

Definition at line 167 of file Builder.cpp.

◆ mlirOpBuilderListenerCreate()

MlirOpBuilderListener mlirOpBuilderListenerCreate ( MlirNotifyOperationInserted opCb,
MlirNotifyBlockInserted blockCb,
void * userData )

Creates a new OpBuilder::Listener that calls opCb whenever an operation is inserted and blockCb whenever a block is inserted.

Creates a new mlir::OpBuilder::Listener.

userData is an opaque pointer forwarded unchanged to each callback.

Definition at line 178 of file Builder.cpp.

◆ mlirOpBuilderListenerDestroy()

void mlirOpBuilderListenerDestroy ( MlirOpBuilderListener listener)

Destroys listener and frees the underlying ListenerT object.

Destroys the given listener.

Definition at line 185 of file Builder.cpp.

◆ mlirOpBuilderRestoreInsertionPoint()

void mlirOpBuilderRestoreInsertionPoint ( MlirOpBuilder builder,
MlirOpBuilderInsertPoint rawIp )

Restore the insert point to a previously saved point.

Definition at line 131 of file Builder.cpp.

◆ mlirOpBuilderSaveInsertionPoint()

MlirOpBuilderInsertPoint mlirOpBuilderSaveInsertionPoint ( MlirOpBuilder builder)

Return a saved insertion point.

Definition at line 126 of file Builder.cpp.

◆ mlirOpBuilderSetInsertionPoint()

void mlirOpBuilderSetInsertionPoint ( MlirOpBuilder builder,
MlirOperation operation )

Sets the insertion point right before the given operation.

Definition at line 111 of file Builder.cpp.

◆ mlirOpBuilderSetInsertionPointAfter()

void mlirOpBuilderSetInsertionPointAfter ( MlirOpBuilder builder,
MlirOperation operation )

Sets the insertion point right after the given operation.

Definition at line 116 of file Builder.cpp.

◆ mlirOpBuilderSetInsertionPointAfterValue()

void mlirOpBuilderSetInsertionPointAfterValue ( MlirOpBuilder builder,
MlirValue value )

Sets the insertion point right after the given value is defined.

Definition at line 121 of file Builder.cpp.

◆ mlirOpBuilderSetInsertionPointToEnd()

void mlirOpBuilderSetInsertionPointToEnd ( MlirOpBuilder builder,
MlirBlock block )

Sets the insertion point to the end of the given block.

Definition at line 106 of file Builder.cpp.

◆ mlirOpBuilderSetInsertionPointToStart()

void mlirOpBuilderSetInsertionPointToStart ( MlirOpBuilder builder,
MlirBlock block )

Sets the insertion point of builder to the beginning of block so that subsequent insertions prepend to that block.

Sets the insertion point to the beginning of the given block.

Definition at line 101 of file Builder.cpp.