@@ -246,7 +246,7 @@ CTerm c_bind_intermediary_result(Emitter* emitter, Printer* p, const Type* t, CT
246246
247247static const Type * get_first_op_scalar_type (Nodes ops ) {
248248 const Type * t = shd_first (ops )-> type ;
249- deconstruct_qualified_type (& t );
249+ shd_deconstruct_qualified_type (& t );
250250 deconstruct_maybe_packed_type (& t );
251251 return t ;
252252}
@@ -495,7 +495,7 @@ static CTerm emit_primop(Emitter* emitter, FnEmitter* fn, Printer* p, const Node
495495 const Node * offset = prim_op -> operands .nodes [1 ];
496496 CValue c_offset = to_cvalue (emitter , c_emit_value (emitter , fn , offset ));
497497 if (emitter -> config .dialect == CDialect_GLSL ) {
498- if (get_unqualified_type (offset -> type )-> payload .int_type .width == IntTy64 )
498+ if (shd_get_unqualified_type (offset -> type )-> payload .int_type .width == IntTy64 )
499499 c_offset = shd_format_string_arena (arena -> arena , "int(%s)" , c_offset );
500500 }
501501 term = term_from_cvalue (shd_format_string_arena (arena -> arena , "(%s %s %s)" , src , prim_op -> op == lshift_op ? "<<" : ">>" , c_offset ));
@@ -527,7 +527,7 @@ static CTerm emit_primop(Emitter* emitter, FnEmitter* fn, Printer* p, const Node
527527 }
528528 case convert_op : {
529529 CTerm src = c_emit_value (emitter , fn , shd_first (prim_op -> operands ));
530- const Type * src_type = get_unqualified_type (shd_first (prim_op -> operands )-> type );
530+ const Type * src_type = shd_get_unqualified_type (shd_first (prim_op -> operands )-> type );
531531 const Type * dst_type = shd_first (prim_op -> type_arguments );
532532 if (emitter -> config .dialect == CDialect_GLSL ) {
533533 if (is_glsl_scalar_type (src_type ) && is_glsl_scalar_type (dst_type )) {
@@ -543,7 +543,7 @@ static CTerm emit_primop(Emitter* emitter, FnEmitter* fn, Printer* p, const Node
543543 }
544544 case reinterpret_op : {
545545 CTerm src_value = c_emit_value (emitter , fn , shd_first (prim_op -> operands ));
546- const Type * src_type = get_unqualified_type (shd_first (prim_op -> operands )-> type );
546+ const Type * src_type = shd_get_unqualified_type (shd_first (prim_op -> operands )-> type );
547547 const Type * dst_type = shd_first (prim_op -> type_arguments );
548548 switch (emitter -> config .dialect ) {
549549 case CDialect_CUDA :
@@ -625,7 +625,7 @@ static CTerm emit_primop(Emitter* emitter, FnEmitter* fn, Printer* p, const Node
625625 term = term_from_cvalue (dst );
626626 }
627627
628- const Type * t = get_unqualified_type (shd_first (prim_op -> operands )-> type );
628+ const Type * t = shd_get_unqualified_type (shd_first (prim_op -> operands )-> type );
629629 for (size_t i = (insert ? 2 : 1 ); i < prim_op -> operands .count ; i ++ ) {
630630 const Node * index = prim_op -> operands .nodes [i ];
631631 const IntLiteral * static_index = shd_resolve_to_int_literal (index );
@@ -678,8 +678,8 @@ static CTerm emit_primop(Emitter* emitter, FnEmitter* fn, Printer* p, const Node
678678 String rhs_e = to_cvalue (emitter , c_emit_value (emitter , fn , prim_op -> operands .nodes [1 ]));
679679 const Type * lhs_t = lhs -> type ;
680680 const Type * rhs_t = rhs -> type ;
681- bool lhs_u = deconstruct_qualified_type (& lhs_t );
682- bool rhs_u = deconstruct_qualified_type (& rhs_t );
681+ bool lhs_u = shd_deconstruct_qualified_type (& lhs_t );
682+ bool rhs_u = shd_deconstruct_qualified_type (& rhs_t );
683683 size_t left_size = lhs_t -> payload .pack_type .width ;
684684 // size_t total_size = lhs_t->payload.pack_type.width + rhs_t->payload.pack_type.width;
685685 String suffixes = "xyzw" ;
@@ -793,13 +793,13 @@ static CTerm emit_ptr_composite_element(Emitter* emitter, FnEmitter* fn, Printer
793793 CTerm acc = c_emit_value (emitter , fn , lea .ptr );
794794
795795 const Type * src_qtype = lea .ptr -> type ;
796- bool uniform = is_qualified_type_uniform (src_qtype );
797- const Type * curr_ptr_type = get_unqualified_type (src_qtype );
796+ bool uniform = shd_is_qualified_type_uniform (src_qtype );
797+ const Type * curr_ptr_type = shd_get_unqualified_type (src_qtype );
798798 assert (curr_ptr_type -> tag == PtrType_TAG );
799799
800- const Type * pointee_type = get_pointee_type (arena , curr_ptr_type );
800+ const Type * pointee_type = shd_get_pointee_type (arena , curr_ptr_type );
801801 const Node * selector = lea .index ;
802- uniform &= is_qualified_type_uniform (selector -> type );
802+ uniform &= shd_is_qualified_type_uniform (selector -> type );
803803 switch (is_type (pointee_type )) {
804804 case ArrType_TAG : {
805805 CTerm index = c_emit_value (emitter , fn , selector );
@@ -859,8 +859,8 @@ static CTerm emit_ptr_array_element_offset(Emitter* emitter, FnEmitter* fn, Prin
859859 CTerm acc = c_emit_value (emitter , fn , lea .ptr );
860860
861861 const Type * src_qtype = lea .ptr -> type ;
862- bool uniform = is_qualified_type_uniform (src_qtype );
863- const Type * curr_ptr_type = get_unqualified_type (src_qtype );
862+ bool uniform = shd_is_qualified_type_uniform (src_qtype );
863+ const Type * curr_ptr_type = shd_get_unqualified_type (src_qtype );
864864 assert (curr_ptr_type -> tag == PtrType_TAG );
865865
866866 const IntLiteral * offset_static_value = shd_resolve_to_int_literal (lea .offset );
@@ -869,9 +869,9 @@ static CTerm emit_ptr_array_element_offset(Emitter* emitter, FnEmitter* fn, Prin
869869 // we sadly need to drop to the value level (aka explicit pointer arithmetic) to do this
870870 // this means such code is never going to be legal in GLSL
871871 // also the cast is to account for our arrays-in-structs hack
872- const Type * pointee_type = get_pointee_type (arena , curr_ptr_type );
872+ const Type * pointee_type = shd_get_pointee_type (arena , curr_ptr_type );
873873 acc = term_from_cvalue (shd_format_string_arena (arena -> arena , "((%s) &(%s)[%s])" , c_emit_type (emitter , curr_ptr_type , NULL ), to_cvalue (emitter , acc ), to_cvalue (emitter , offset )));
874- uniform &= is_qualified_type_uniform (lea .offset -> type );
874+ uniform &= shd_is_qualified_type_uniform (lea .offset -> type );
875875 }
876876
877877 if (emitter -> config .dialect == CDialect_ISPC )
@@ -893,7 +893,7 @@ static CTerm emit_alloca(Emitter* emitter, Printer* p, const Type* instr) {
893893 CTerm variable = (CTerm ) { .value = NULL , .var = variable_name };
894894 c_emit_variable_declaration (emitter , p , get_allocated_type (instr ), variable_name , true, NULL );
895895 if (emitter -> config .dialect == CDialect_ISPC ) {
896- variable = ispc_varying_ptr_helper (emitter , p , get_unqualified_type (instr -> type ), variable );
896+ variable = ispc_varying_ptr_helper (emitter , p , shd_get_unqualified_type (instr -> type ), variable );
897897 }
898898 return variable ;
899899}
@@ -927,8 +927,8 @@ static CTerm emit_instruction(Emitter* emitter, FnEmitter* fn, Printer* p, const
927927 Store payload = instruction -> payload .store ;
928928 c_emit_mem (emitter , fn , payload .mem );
929929 const Type * addr_type = payload .ptr -> type ;
930- bool addr_uniform = deconstruct_qualified_type (& addr_type );
931- bool value_uniform = is_qualified_type_uniform (payload .value -> type );
930+ bool addr_uniform = shd_deconstruct_qualified_type (& addr_type );
931+ bool value_uniform = shd_is_qualified_type_uniform (payload .value -> type );
932932 assert (addr_type -> tag == PtrType_TAG );
933933 CAddr dereferenced = deref_term (emitter , c_emit_value (emitter , fn , payload .ptr ));
934934 CValue cvalue = to_cvalue (emitter , c_emit_value (emitter , fn , payload .value ));
0 commit comments