a const parameter is enough for get_method_XXX()
authorMatthias Braun <matze@braunis.de>
Mon, 22 Aug 2011 13:24:05 +0000 (15:24 +0200)
committerMatthias Braun <matze@braunis.de>
Mon, 22 Aug 2011 14:27:38 +0000 (16:27 +0200)
include/libfirm/typerep.h
ir/tr/type.c

index 3c52b51..4a0b4c9 100644 (file)
@@ -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. */
index a27ea24..260d7d3 100644 (file)
@@ -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);