Commit c9fb3f91 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

tr: Factorise code to copy variadicity, calling convention and additional properties.

parent 0f96ee7e
......@@ -197,9 +197,7 @@ bool sparc_variadic_fixups(ir_graph *irg, calling_convention_t *cconv)
}
set_type_dbg_info(new_mtp, dbgi);
set_method_variadicity(new_mtp, get_method_variadicity(mtp));
set_method_calling_convention(new_mtp, get_method_calling_convention(mtp));
set_method_additional_properties(new_mtp, get_method_additional_properties(mtp));
copy_method_properties(new_mtp, mtp);
set_higher_type(new_mtp, mtp);
set_entity_type(entity, new_mtp);
......
......@@ -1638,9 +1638,7 @@ static ir_type *lower_mtp(ir_type *mtp)
set_method_res_type(res, n_res++, tp);
}
set_method_variadicity(res, get_method_variadicity(mtp));
set_method_calling_convention(res, get_method_calling_convention(mtp));
set_method_additional_properties(res, get_method_additional_properties(mtp));
copy_method_properties(res, mtp);
set_higher_type(res, mtp);
set_type_link(res, mtp);
......@@ -2159,9 +2157,7 @@ static ir_type *lower_Builtin_type_high(ir_type *mtp)
set_method_res_type(res, i, tp);
}
set_method_variadicity(res, get_method_variadicity(mtp));
set_method_calling_convention(res, get_method_calling_convention(mtp));
set_method_additional_properties(res, get_method_additional_properties(mtp));
copy_method_properties(res, mtp);
pmap_insert(lowered_builtin_type_high, mtp, res);
return res;
......@@ -2243,9 +2239,7 @@ static ir_type *lower_Builtin_type_low(ir_type *mtp)
set_method_res_type(res, i, tp);
}
set_method_variadicity(res, get_method_variadicity(mtp));
set_method_calling_convention(res, get_method_calling_convention(mtp));
set_method_additional_properties(res, get_method_additional_properties(mtp));
copy_method_properties(res, mtp);
pmap_insert(lowered_builtin_type_low, mtp, res);
return res;
......
......@@ -352,9 +352,7 @@ static ir_type *lower_method_type(ir_type *mtp)
set_method_res_type(res, i, rtp);
}
set_method_variadicity(res, get_method_variadicity(mtp));
set_method_calling_convention(res, get_method_calling_convention(mtp));
set_method_additional_properties(res, get_method_additional_properties(mtp));
copy_method_properties(res, mtp);
set_higher_type(res, mtp);
......
......@@ -412,4 +412,11 @@ static inline bool is_aggregate_type(const ir_type *type)
ir_type *new_type_segment(ident *name, type_flags flags);
static inline void copy_method_properties(ir_type *const dst, ir_type const *const src)
{
set_method_variadicity(dst, get_method_variadicity(src));
set_method_calling_convention(dst, get_method_calling_convention(src));
set_method_additional_properties(dst, get_method_additional_properties(src));
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment