Beaver.DSL.Pattern (beaver v0.2.5)
Link to this section Summary
Functions
The difference between a pdl.operation creation in a match body and a rewrite body
generate PDL ops for types and attributes
generate arguments for prototype dispatch
transform a macro's call to PDL operations to match operands, attributes, results. Every Prototype form within the block should be transformed to create a PDL operation.
transform a do block to PDL rewrite operation. Every Prototype form within the block should be transformed to create a PDL operation. The last expression will be replaced by the root op in the match by default. TODO: wrap this function with a macro rewrite/1, so that it could be use in a independent function
Link to this section Functions
create_operation(op_name, prototype, arg)
The difference between a pdl.operation creation in a match body and a rewrite body:
- in a match body, pdl.attribute/pdl.operand/pdl.result will be generated for unbound variables
- in a rewrite body, all variables are considered bound before creation pdl ops
gen_attribute_names(attributes_keys)
gen_pdl(env, type)
generate PDL ops for types and attributes
gen_prototype_args(map_args)
generate arguments for prototype dispatch
gen_prototype_args(kind, map_args)
result(env, v, i)
transform_match(ast)
transform a macro's call to PDL operations to match operands, attributes, results. Every Prototype form within the block should be transformed to create a PDL operation.
transform_rewrite(ast)
transform a do block to PDL rewrite operation. Every Prototype form within the block should be transformed to create a PDL operation. The last expression will be replaced by the root op in the match by default. TODO: wrap this function with a macro rewrite/1, so that it could be use in a independent function