the symbol system will allow ops to reference each other via symbolic names, rather than just via their SSA output registers. this will allow for links between ops that are less strict than SSA. the two parts of the system are: - the symbol-table trait. ops with this trait can contain symbol ops. - the symbol interface. ops with this interface have the necessary attributes to be treated as symbols.
22 lines
757 B
C
22 lines
757 B
C
#include <mie/dialect/builtin.h>
|
|
#include <mie/dialect/dialect.h>
|
|
#include <mie/macros.h>
|
|
#include <mie/trait/trait-definition.h>
|
|
#include <mie/trait/trait.h>
|
|
|
|
static enum mie_status validate(
|
|
const struct mie_trait_definition *trait_def,
|
|
const struct mie_trait *trait, const struct mie_trait_target *target)
|
|
{
|
|
return MIE_SUCCESS;
|
|
}
|
|
|
|
/* builtin.isolated-from-above trait:
|
|
* regions of an op that has this trait cannot capture or reference
|
|
* values defined in the enclosing scope. */
|
|
MIE_TRAIT_DEFINITION_BEGIN(mie_builtin_symbol_table, "symbol-table")
|
|
MIE_TRAIT_DEFINITION_TARGETS(MIE_TRAIT_TARGET_OP | MIE_TRAIT_TARGET_TYPE);
|
|
MIE_TRAIT_DEFINITION_STRUCT(struct mie_symbol_table);
|
|
MIE_TRAIT_DEFINITION_VALIDATE(validate);
|
|
MIE_TRAIT_DEFINITION_END()
|