+static ir_node *create_convb(ir_node *node)
+{
+ ir_graph *irg = current_ir_graph;
+ ir_node *block = get_nodes_block(node);
+ ir_node *conv = new_rd_Conv(NULL, irg, block, node, mode_b);
+
+ return conv;
+}
+
+static ir_type *create_lowered_type(void)
+{
+ if(lowered_type == NULL) {
+ lowered_type = new_type_primitive(new_id_from_str("__lowered_mode_b"),
+ lowered_mode);
+ }
+ return lowered_type;
+}
+
+static void adjust_method_type(ir_type *method_type)
+{
+ int i;
+ int n_params;
+ int n_res;
+
+ n_params = get_method_n_params(method_type);
+ for(i = 0; i < n_params; ++i) {
+ ir_type *param = get_method_param_type(method_type, i);
+ if(get_type_mode(param) == mode_b) {
+ set_method_param_type(method_type, i, create_lowered_type());
+ }
+ }
+
+ n_res = get_method_n_ress(method_type);
+ for(i = 0; i < n_res; ++i) {
+ ir_type *res_type = get_method_res_type(method_type, i);
+ if(get_type_mode(res_type) == mode_b) {
+ set_method_res_type(method_type, i, create_lowered_type());
+ }
+ }
+}
+