LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
llzk::BuildShortTypeString Class Reference

Note: If any symbol refs in an input Type/Attribute use any of the special characters that this class generates, they are not escaped. More...

#include <TypeHelper.h>

Static Public Member Functions

static std::string from (mlir::Type type)
 Return a brief string representation of the given LLZK type.
 
static std::string from (mlir::ArrayRef< mlir::Attribute > attrs)
 Return a brief string representation of the attribute list from a parameterized type.
 
static std::string from (const std::string &base, mlir::ArrayRef< mlir::Attribute > attrs)
 Take an existing name prefix/base that contains N>=0 PLACEHOLDER character(s) and the Attribute list (size>=N) from a parameterized type.
 

Detailed Description

Note: If any symbol refs in an input Type/Attribute use any of the special characters that this class generates, they are not escaped.

That means these string representations are not safe to reverse back into a Type. It's only intended to produce a unique name for instantiated structs that may give some hint when debugging regarding the original struct name and the params used.

Definition at line 36 of file TypeHelper.h.

Member Function Documentation

◆ from() [1/3]

static std::string llzk::BuildShortTypeString::from ( const std::string & base,
mlir::ArrayRef< mlir::Attribute > attrs )
static

Take an existing name prefix/base that contains N>=0 PLACEHOLDER character(s) and the Attribute list (size>=N) from a parameterized type.

The first N elements in the list are formatted and used to replace the PLACEHOLDER character(s) in the base string. The remaining Attribute elements, if any, are formatted and appended to the end. Occurrences of nullptr in the Attribute list are formatted as the PLACEHOLDER character itself to allow for partial instantiation of a parameterized type, preserving the location of attributes that were not available in an earlier instantiation so they can be added by a later instantiation.

◆ from() [2/3]

static std::string llzk::BuildShortTypeString::from ( mlir::ArrayRef< mlir::Attribute > attrs)
inlinestatic

Return a brief string representation of the attribute list from a parameterized type.

Occurrences of nullptr are represented with a PLACEHOLDER character.

Definition at line 58 of file TypeHelper.h.

◆ from() [3/3]

static std::string llzk::BuildShortTypeString::from ( mlir::Type type)
inlinestatic

Return a brief string representation of the given LLZK type.

Definition at line 52 of file TypeHelper.h.


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