MLIR  20.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mlir::StructBuilder Class Reference

Helper class to produce LLVM dialect operations extracting or inserting values to a struct. More...

#include "mlir/Conversion/LLVMCommon/StructBuilder.h"

+ Inheritance diagram for mlir::StructBuilder:

Public Member Functions

 StructBuilder (Value v)
 Construct a helper for the given value. More...
 
 operator Value ()
 

Static Public Member Functions

static StructBuilder undef (OpBuilder &builder, Location loc, Type descriptorType)
 Builds IR creating an undef value of the descriptor type. More...
 

Protected Member Functions

Value extractPtr (OpBuilder &builder, Location loc, unsigned pos) const
 Builds IR to extract a value from the struct at position pos. More...
 
void setPtr (OpBuilder &builder, Location loc, unsigned pos, Value ptr)
 Builds IR to set a value in the struct at position pos. More...
 

Protected Attributes

Value value
 
Type structType
 

Detailed Description

Helper class to produce LLVM dialect operations extracting or inserting values to a struct.

Definition at line 26 of file StructBuilder.h.

Constructor & Destructor Documentation

◆ StructBuilder()

StructBuilder::StructBuilder ( Value  v)
explicit

Construct a helper for the given value.

Definition at line 20 of file StructBuilder.cpp.

References mlir::LLVM::isCompatibleType(), structType, and value.

Member Function Documentation

◆ extractPtr()

Value StructBuilder::extractPtr ( OpBuilder builder,
Location  loc,
unsigned  pos 
) const
protected

◆ operator Value()

mlir::StructBuilder::operator Value ( )
inline

Definition at line 34 of file StructBuilder.h.

References value.

◆ setPtr()

void StructBuilder::setPtr ( OpBuilder builder,
Location  loc,
unsigned  pos,
Value  ptr 
)
protected

◆ undef()

static StructBuilder mlir::StructBuilder::undef ( OpBuilder builder,
Location  loc,
Type  descriptorType 
)
static

Builds IR creating an undef value of the descriptor type.

Member Data Documentation

◆ structType

Type mlir::StructBuilder::structType
protected

Definition at line 40 of file StructBuilder.h.

Referenced by StructBuilder().

◆ value

Value mlir::StructBuilder::value
protected

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