summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-05-22 15:04:14 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2016-05-22 15:04:14 +0200
commit2882fc896acd794b9d95a699ec93ede87fe8c3b8 (patch)
treeaf8fb67432cbc8c7a270d3e94932d4ea3e8ddf24 /src
parent2bc782f6f4a5da4ad1b76d7335506ffd359c53bc (diff)
Adapt to API change of 'new_type_method()'.
Diffstat (limited to 'src')
-rw-r--r--src/firm/ast2firm.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/firm/ast2firm.c b/src/firm/ast2firm.c
index 0cc915e..4a442ac 100644
--- a/src/firm/ast2firm.c
+++ b/src/firm/ast2firm.c
@@ -272,8 +272,9 @@ static ir_type *create_method_type(const function_type_t *function_type,
int n_parameters = count_parameters(function_type)
+ (for_closure ? 1 : 0);
int n_results = is_type_void(return_type) ? 0 : 1;
+ bool const is_variadic = function_type->variadic;
type_dbg_info *dbgi = get_type_dbg_info_((const type_t*) function_type);
- ir_type *irtype = new_type_method(n_parameters, n_results);
+ ir_type *irtype = new_type_method(n_parameters, n_results, is_variadic);
set_type_dbg_info(irtype, dbgi);
if (!is_type_void(return_type)) {
@@ -295,10 +296,6 @@ static ir_type *create_method_type(const function_type_t *function_type,
++n;
}
- bool is_variadic = function_type->variadic;
- if (is_variadic)
- set_method_variadic(irtype, true);
-
unsigned cc = get_method_calling_convention(irtype);
switch (function_type->calling_convention) {
case CC_DEFAULT: /* unspecified calling convention, equal to one of the other, typically cdecl */
@@ -1126,13 +1123,12 @@ static ir_node *call_expression_to_firm(const call_expression_t *const call)
* arguments... */
type_dbg_info *tdbgi = get_type_dbg_info_((const type_t*) function_type);
int n_res = get_method_n_ress(ir_method_type);
- new_method_type = new_type_method(n_parameters, n_res);
+ new_method_type = new_type_method(n_parameters, n_res, true);
set_type_dbg_info(new_method_type, tdbgi);
set_method_calling_convention(new_method_type,
get_method_calling_convention(ir_method_type));
set_method_additional_properties(new_method_type,
get_method_additional_properties(ir_method_type));
- set_method_variadic(new_method_type, true);
for (int i = 0; i < n_res; ++i) {
set_method_res_type(new_method_type, i,
@@ -2195,7 +2191,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);
+ ir_type *const funtype = new_type_method(0, 1, false);
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);
@@ -2207,7 +2203,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);
+ ir_type *const funtype = new_type_method(1, 0, false);
set_method_param_type(funtype, 0, va_list_type);
ir_node *const ap = expression_to_value(expr->ap);
@@ -2244,7 +2240,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);
+ ir_type *const funtype = new_type_method(1, 2, false);
set_method_param_type(funtype, 0, aptype);
set_method_res_type(funtype, 0, restype);
set_method_res_type(funtype, 1, aptype);
@@ -2265,7 +2261,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);
+ ir_type *const funtype = new_type_method(1, 1, false);
set_method_param_type(funtype, 0, aptype);
set_method_res_type(funtype, 0, restype);