summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-07-12 08:07:51 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2016-07-12 08:07:51 +0200
commit4740076a6b7844314e4030d034e68e170c3ea2c1 (patch)
tree061ce565f8fa2d2971ee95bff628f156cdc15d79 /src
parent201dc79f005cbf52aa264af9fdab7d10d32e2dd4 (diff)
Update submodule 'libfirm'.
Now the additional properties are directly set when constructing a method type.
Diffstat (limited to 'src')
-rw-r--r--src/firm/ast2firm.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/firm/ast2firm.c b/src/firm/ast2firm.c
index bd05721..c225932 100644
--- a/src/firm/ast2firm.c
+++ b/src/firm/ast2firm.c
@@ -295,10 +295,13 @@ is_cdecl:
break;
}
+ decl_modifiers_t const modifiers = function_type->modifiers;
+ mtp_additional_properties const props = get_additional_type_properties(modifiers);
+
type_t *return_type = skip_typeref(function_type->return_type);
int n_parameters = count_parameters(function_type);
int n_results = is_type_void(return_type) ? 0 : 1;
- ir_type *irtype = new_type_method(n_parameters, n_results, is_variadic, cc);
+ ir_type *irtype = new_type_method(n_parameters, n_results, is_variadic, cc, props);
type_dbg_info *dbgi = get_type_dbg_info_((const type_t*) function_type);
set_type_dbg_info(irtype, dbgi);
@@ -316,10 +319,6 @@ is_cdecl:
++n;
}
- const decl_modifiers_t modifiers = function_type->modifiers;
- const mtp_additional_properties props
- = get_additional_type_properties(modifiers);
- add_method_additional_properties(irtype, props);
return irtype;
}
@@ -1111,12 +1110,11 @@ static ir_node *call_expression_to_firm(const call_expression_t *const call)
/* we need to construct a new method type matching the call
* arguments... */
type_dbg_info *tdbgi = get_type_dbg_info_((const type_t*) function_type);
- int const n_res = get_method_n_ress(ir_method_type);
- unsigned const cc_mask = get_method_calling_convention(ir_method_type);
- new_method_type = new_type_method(n_parameters, n_res, true, cc_mask);
+ int const n_res = get_method_n_ress(ir_method_type);
+ unsigned const cc_mask = get_method_calling_convention(ir_method_type);
+ mtp_additional_properties const props = get_method_additional_properties(ir_method_type);
+ new_method_type = new_type_method(n_parameters, n_res, true, cc_mask, props);
set_type_dbg_info(new_method_type, tdbgi);
- set_method_additional_properties(new_method_type,
- get_method_additional_properties(ir_method_type));
for (int i = 0; i < n_res; ++i) {
set_method_res_type(new_method_type, i,
@@ -2177,7 +2175,7 @@ static ir_node *va_start_expression_to_firm(const va_start_expression_t *const e
if (is_Pointer_type(va_list_type)) {
/* The backend implements va_list as a single pointer. The initial value of
* a va_list is the result of the va_start call. */
- ir_type *const funtype = new_type_method(0, 1, false, cc_cdecl_set);
+ ir_type *const funtype = new_type_method(0, 1, false, cc_cdecl_set, mtp_no_property);
set_method_res_type(funtype, 0, va_list_type);
ir_node *const builtin = new_d_Builtin(dbgi, memory, 0, NULL, ir_bk_va_start, funtype);
@@ -2189,7 +2187,7 @@ static ir_node *va_start_expression_to_firm(const va_start_expression_t *const e
} else if (is_Struct_type(va_list_type)) {
/* The backend implements va_list as a struct. The va_list object is passed
* by reference to va_start, where its fields are initialized. */
- ir_type *const funtype = new_type_method(1, 0, false, cc_cdecl_set);
+ ir_type *const funtype = new_type_method(1, 0, false, cc_cdecl_set, mtp_no_property);
set_method_param_type(funtype, 0, va_list_type);
ir_node *const ap = expression_to_value(expr->ap);
@@ -2226,7 +2224,7 @@ static ir_node *va_arg_expression_to_firm(const va_arg_expression_t *const expr)
ir_node *const memory = get_store();
- ir_type *const funtype = new_type_method(1, 2, false, cc_cdecl_set);
+ ir_type *const funtype = new_type_method(1, 2, false, cc_cdecl_set, mtp_no_property);
set_method_param_type(funtype, 0, aptype);
set_method_res_type(funtype, 0, restype);
set_method_res_type(funtype, 1, aptype);
@@ -2247,7 +2245,7 @@ static ir_node *va_arg_expression_to_firm(const va_arg_expression_t *const expr)
ir_node *const ap = expression_to_value(expr->ap);
ir_node *const memory = get_store();
- ir_type *const funtype = new_type_method(1, 1, false, cc_cdecl_set);
+ ir_type *const funtype = new_type_method(1, 1, false, cc_cdecl_set, mtp_no_property);
set_method_param_type(funtype, 0, aptype);
set_method_res_type(funtype, 0, restype);