From: Matthias Braun Date: Mon, 22 Aug 2011 13:24:05 +0000 (+0200) Subject: a const parameter is enough for get_method_XXX() X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=38929082e12e38372023d3a70652358d3d6e6cf9;p=libfirm a const parameter is enough for get_method_XXX() --- diff --git a/include/libfirm/typerep.h b/include/libfirm/typerep.h index 3c52b51fe..4a0b4c941 100644 --- a/include/libfirm/typerep.h +++ b/include/libfirm/typerep.h @@ -1614,7 +1614,7 @@ FIRM_API ir_type *new_d_type_method(size_t n_param, size_t n_res, FIRM_API size_t get_method_n_params(const ir_type *method); /** Returns the type of the parameter at position pos of a method. */ -FIRM_API ir_type *get_method_param_type(ir_type *method, size_t pos); +FIRM_API ir_type *get_method_param_type(const ir_type *method, size_t pos); /** Sets the type of the parameter at position pos of a method. Also changes the type in the pass-by-value representation by just changing the type of the corresponding entity if the representation is constructed. */ @@ -1622,7 +1622,7 @@ FIRM_API void set_method_param_type(ir_type *method, size_t pos, ir_type *tp); /** Returns the number of results of a method type. */ FIRM_API size_t get_method_n_ress(const ir_type *method); /** Returns the return type of a method type at position pos. */ -FIRM_API ir_type *get_method_res_type(ir_type *method, size_t pos); +FIRM_API ir_type *get_method_res_type(const ir_type *method, size_t pos); /** Sets the type of the result at position pos of a method. Also changes the type in the pass-by-value representation by just changing the type of the corresponding entity if the representation is constructed. */ diff --git a/ir/tr/type.c b/ir/tr/type.c index a27ea240e..260d7d3c5 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -1216,7 +1216,7 @@ size_t (get_method_n_params)(const ir_type *method) return _get_method_n_params(method); } -ir_type *get_method_param_type(ir_type *method, size_t pos) +ir_type *get_method_param_type(const ir_type *method, size_t pos) { ir_type *res; assert(method->type_op == type_method); @@ -1238,7 +1238,7 @@ size_t (get_method_n_ress)(const ir_type *method) return _get_method_n_ress(method); } -ir_type *get_method_res_type(ir_type *method, size_t pos) +ir_type *get_method_res_type(const ir_type *method, size_t pos) { ir_type *res; assert(method->type_op == type_method);