@@ -41,10 +41,10 @@ static const Node* wrap_in_controls(Context* ctx, Controls* controls, const Node
4141 Nodes o_dst_params = get_abstraction_params (dst );
4242 LARRAY (const Node * , new_control_params , o_dst_params .count );
4343 for (size_t j = 0 ; j < o_dst_params .count ; j ++ )
44- new_control_params [j ] = var (a , o_dst_params .nodes [j ]-> payload .var .type , unique_name (a , "v" ));
44+ new_control_params [j ] = param (a , o_dst_params .nodes [j ]-> payload .param .type , unique_name (a , "v" ));
4545 Nodes nparams = nodes (a , o_dst_params .count , new_control_params );
4646 body = let (a , control (a , (Control ) {
47- .yield_types = get_variables_types (a , o_dst_params ),
47+ .yield_types = get_param_types (a , o_dst_params ),
4848 .inside = case_ (a , singleton (token ), body )
4949 }), case_ (a , nparams , jump_helper (a , rewrite_node (& ctx -> rewriter , dst ), nparams )));
5050 }
@@ -66,13 +66,13 @@ bool lexical_scope_is_nested(Nodes scope, Nodes parentMaybe) {
6666
6767bool compare_nodes (Nodes * a , Nodes * b );
6868
69- static Nodes remake_variables (Context * ctx , Nodes old ) {
69+ static Nodes remake_params (Context * ctx , Nodes old ) {
7070 IrArena * a = ctx -> rewriter .dst_arena ;
7171 LARRAY (const Node * , nvars , old .count );
7272 for (size_t i = 0 ; i < old .count ; i ++ ) {
7373 const Node * node = old .nodes [i ];
74- nvars [i ] = var (a , node -> payload .var .type ? qualified_type_helper (rewrite_node (& ctx -> rewriter , node -> payload .var .type ), false) : NULL , node -> payload .var .name );
75- assert (nvars [i ]-> tag == Variable_TAG );
74+ nvars [i ] = param (a , node -> payload .param .type ? qualified_type_helper (rewrite_node (& ctx -> rewriter , node -> payload .param .type ), false) : NULL , node -> payload .param .name );
75+ assert (nvars [i ]-> tag == Param_TAG );
7676 }
7777 return nodes (a , old .count , nvars );
7878}
@@ -81,11 +81,11 @@ static const Node* process_op(Context* ctx, NodeClass op_class, String op_name,
8181 IrArena * a = ctx -> rewriter .dst_arena ;
8282 Rewriter * r = & ctx -> rewriter ;
8383 switch (node -> tag ) {
84- case Variable_TAG : {
85- assert (node -> payload .var .type );
86- if (node -> payload .var .type -> tag == QualifiedType_TAG )
87- return var (a , node -> payload .var .type ? rewrite_node (& ctx -> rewriter , node -> payload .var .type ) : NULL , node -> payload .var .name );
88- return var (a , qualified_type_helper (rewrite_node (& ctx -> rewriter , node -> payload .var .type ), false), node -> payload .var .name );
84+ case Param_TAG : {
85+ assert (node -> payload .param .type );
86+ if (node -> payload .param .type -> tag == QualifiedType_TAG )
87+ return param (a , node -> payload .param .type ? rewrite_node (& ctx -> rewriter , node -> payload .param .type ) : NULL , node -> payload .param .name );
88+ return param (a , qualified_type_helper (rewrite_node (& ctx -> rewriter , node -> payload .param .type ), false), node -> payload .param .name );
8989 }
9090 case Block_TAG : {
9191 Nodes yield_types = rewrite_nodes (r , node -> payload .block .yield_types );
@@ -131,7 +131,7 @@ static const Node* process_op(Context* ctx, NodeClass op_class, String op_name,
131131 fn_ctx .old_fn_or_bb = node ;
132132 Controls controls ;
133133 initialize_controls (ctx , & controls , node );
134- Nodes new_params = recreate_variables (& fn_ctx .rewriter , node -> payload .fun .params );
134+ Nodes new_params = recreate_params (& fn_ctx .rewriter , node -> payload .fun .params );
135135 Nodes old_annotations = node -> payload .fun .annotations ;
136136 ParsedAnnotation * an = find_annotation (ctx -> p , node );
137137 Op primop_intrinsic = PRIMOPS_COUNT ;
@@ -150,7 +150,7 @@ static const Node* process_op(Context* ctx, NodeClass op_class, String op_name,
150150 primop_intrinsic = op ;
151151 } else if (strcmp (get_annotation_name (an -> payload ), "EntryPoint" ) == 0 ) {
152152 for (size_t i = 0 ; i < new_params .count ; i ++ )
153- new_params = change_node_at_index (a , new_params , i , var (a , qualified_type_helper (get_unqualified_type (new_params .nodes [i ]-> payload .var .type ), true), new_params .nodes [i ]-> payload .var .name ));
153+ new_params = change_node_at_index (a , new_params , i , param (a , qualified_type_helper (get_unqualified_type (new_params .nodes [i ]-> payload .param .type ), true), new_params .nodes [i ]-> payload .param .name ));
154154 }
155155 old_annotations = append_nodes (a , old_annotations , an -> payload );
156156 an = an -> next ;
@@ -225,13 +225,13 @@ static const Node* process_op(Context* ctx, NodeClass op_class, String op_name,
225225 }
226226 if (!join_token ) {
227227 const Type * jp_type = join_point_type (a , (JoinPointType ) {
228- .yield_types = get_variables_types (a , get_abstraction_params (dst ))
228+ .yield_types = get_param_types (a , get_abstraction_params (dst ))
229229 });
230- join_token = var (a , qualified_type_helper (jp_type , false), get_abstraction_name (dst ));
230+ join_token = param (a , qualified_type_helper (jp_type , false), get_abstraction_name (dst ));
231231 controls -> tokens = append_nodes (a , controls -> tokens , join_token );
232232 controls -> destinations = append_nodes (a , controls -> destinations , dst );
233233 }
234- Nodes nparams = remake_variables (ctx , get_abstraction_params (dst ));
234+ Nodes nparams = remake_params (ctx , get_abstraction_params (dst ));
235235 //register_processed_list(&ctx->rewriter, get_abstraction_params(dst), nparams);
236236 Node * fn = src ;
237237 if (fn -> tag == BasicBlock_TAG )
@@ -307,7 +307,7 @@ void postprocess(Parser* p, Module* src, Module* dst) {
307307 };
308308
309309 ctx .rewriter .rewrite_op_fn = (RewriteOpFn ) process_op ;
310- ctx .rewriter .config .process_variables = true;
310+ ctx .rewriter .config .process_params = true;
311311 ctx .rewriter .config .search_map = true;
312312 // ctx.rewriter.config.write_map = false;
313313
0 commit comments