summaryrefslogtreecommitdiffhomepage
path: root/ir/ir
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-07-08 08:04:53 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2016-07-11 14:40:44 +0200
commitcc80f54ffafd48a98732d0196265bd08ef790703 (patch)
treeea9a0888a735378d20ab45b3bced92d8520368f1 /ir/ir
parent5e8671106a446534bf78dfb79012104f2d77a031 (diff)
Set the calling convention right when construction a method type.
Diffstat (limited to 'ir/ir')
-rw-r--r--ir/ir/irio.c3
-rw-r--r--ir/ir/irprofile.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/ir/ir/irio.c b/ir/ir/irio.c
index cb50085..fd3608a 100644
--- a/ir/ir/irio.c
+++ b/ir/ir/irio.c
@@ -1634,7 +1634,7 @@ static void read_type(read_env_t *env)
size_t const nparams = read_size_t(env);
size_t const nresults = read_size_t(env);
bool const is_variadic = read_long(env);
- type = new_type_method(nparams, nresults, is_variadic);
+ type = new_type_method(nparams, nresults, is_variadic, callingconv);
for (size_t i = 0; i < nparams; i++) {
long ptypenr = read_long(env);
@@ -1649,7 +1649,6 @@ static void read_type(read_env_t *env)
set_method_res_type(type, i, restype);
}
- set_method_calling_convention(type, callingconv);
set_method_additional_properties(type, addprops);
goto finish_type;
}
diff --git a/ir/ir/irprofile.c b/ir/ir/irprofile.c
index da0de17..05535b5 100644
--- a/ir/ir/irprofile.c
+++ b/ir/ir/irprofile.c
@@ -152,7 +152,7 @@ static void add_constructor(ir_entity *method)
static ir_entity *get_init_firmprof_ref(void)
{
ident *const init_name = new_id_from_str("__init_firmprof");
- ir_type *const init_type = new_type_method(3, 0, false);
+ ir_type *const init_type = new_type_method(3, 0, false, cc_cdecl_set);
ir_type *const uint = get_type_for_mode(mode_Iu);
ir_type *const uintptr = new_type_pointer(uint);
ir_type *const string = new_type_pointer(get_type_for_mode(mode_Bs));
@@ -177,7 +177,7 @@ static ir_graph *gen_initializer_irg(ir_entity *ent_filename, ir_entity *bblock_
{
ident *const name = new_id_from_str("__firmprof_initializer");
ir_type *const owner = get_glob_type();
- ir_type *const type = new_type_method(0, 0, false);
+ ir_type *const type = new_type_method(0, 0, false, cc_cdecl_set);
ir_entity *const ent = new_global_entity(owner, name, type, ir_visibility_local, IR_LINKAGE_DEFAULT);
ir_graph *const irg = new_ir_graph(ent, 0);