under this new system, dialects can define their own custom attributes, complete with their own print() and parse() callbacks, which can then be used as values in an op's attribute dictionary. alongside custom dialect attributes, the former int, float, and string constant values have been converted to attributes provided by the arith and builtin dialects respectively. the caches for these attributes have also been moved from mie_ctx to their respective dialect data structures. this system will allow new types of attributes to be implemented, including dictionaries, arrays, and references to types themselves (rather than just particular values of a given type).
10 lines
275 B
C
10 lines
275 B
C
#include <mie/dialect/dialect.h>
|
|
#include <mie/macros.h>
|
|
#include <mie/type/type-definition.h>
|
|
|
|
MIE_DIALECT_BEGIN(mie_ptr, struct mie_dialect, "ptr")
|
|
MIE_DIALECT_ADD_OP(mie_ptr_load);
|
|
MIE_DIALECT_ADD_OP(mie_ptr_store);
|
|
MIE_DIALECT_ADD_TYPE(mie_ptr_ptr);
|
|
MIE_DIALECT_END()
|