LLZK 2.0.0
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.
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

◆ mlirOpBuilderCreate()

MlirOpBuilder mlirOpBuilderCreate ( MlirContext ctx)

Creates a new OpBuilder for the given MLIR context.

Definition at line 62 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 68 of file Builder.cpp.

◆ mlirOpBuilderDestroy()

void mlirOpBuilderDestroy ( MlirOpBuilder builder)

Destroys builder and frees the underlying OpBuilder object.

Destroys the given builder.

Definition at line 74 of file Builder.cpp.

◆ mlirOpBuilderGetContext()

MlirContext mlirOpBuilderGetContext ( MlirOpBuilder builder)

Returns the MLIR context associated with builder.

Returns the context.

Definition at line 79 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 103 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 91 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 108 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 119 of file Builder.cpp.

◆ mlirOpBuilderListenerDestroy()

void mlirOpBuilderListenerDestroy ( MlirOpBuilderListener listener)

Destroys listener and frees the underlying ListenerT object.

Destroys the given listener.

Definition at line 126 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 85 of file Builder.cpp.