+ /* set the result type */
+ method->attr.ma.res_type[pos] = tp;
+ /* If information constructed set pass-by-value representation. */
+ if (method->attr.ma.value_ress) {
+ assert(get_method_n_ress(method) == get_struct_n_members(method->attr.ma.value_ress));
+ set_entity_type(get_struct_member(method->attr.ma.value_ress, pos), tp);
+ }
+}
+
+/* Returns an entity that represents the copied value result. Only necessary
+ for compounds passed by value. */
+entity *get_method_value_res_ent(type *method, int pos) {
+ assert(method && (method->type_op == type_method));
+ assert(pos >= 0 && pos < get_method_n_ress(method));
+ if (!method->attr.ma.value_ress)
+ method->attr.ma.value_ress
+ = build_value_type(mangle_u(get_type_ident(method), value_ress_suffix),
+ get_method_n_ress(method), method->attr.ma.res_type);
+ assert((get_entity_type(get_struct_member(method->attr.ma.value_ress, pos)) != method->attr.ma.value_ress)
+ && "result type not yet set");
+ return get_struct_member(method->attr.ma.value_ress, pos);
+}
+
+/*
+ * Returns a type that represents the copied value results.
+ */
+type *get_method_value_res_type(type *method) {
+ assert(method && (method->type_op == type_method));
+ return method->attr.ma.value_ress;
+}
+
+/* Returns the null-terminated name of this variadicity. */
+const char *get_variadicity_name(variadicity vari)
+{
+#define X(a) case a: return #a
+ switch (vari) {
+ X(variadicity_non_variadic);
+ X(variadicity_variadic);
+ default:
+ return "BAD VALUE";
+ }
+#undef X
+}
+
+variadicity get_method_variadicity(type *method)
+{
+ assert(method && (method->type_op == type_method));
+ return method->attr.ma.variadicity;
+}
+
+void set_method_variadicity(type *method, variadicity vari)
+{
+ assert(method && (method->type_op == type_method));
+ method->attr.ma.variadicity = vari;
+}
+
+/*
+ * Returns the first variadic parameter index of a type.
+ * If this index was NOT set, the index of the last parameter
+ * of the method type plus one is returned for variadic functions.
+ * Non-variadic function types always return -1 here.
+ */
+int get_method_first_variadic_param_index(type *method)
+{
+ assert(method && (method->type_op == type_method));
+
+ if (method->attr.ma.variadicity == variadicity_non_variadic)
+ return -1;
+
+ if (method->attr.ma.first_variadic_param == -1)
+ return get_method_n_params(method);
+ return method->attr.ma.first_variadic_param;
+}
+
+/*
+ * Sets the first variadic parameter index. This allows to specify
+ * a complete call type (containing the type of all parameters)
+ * but still have the knowledge, which parameter must be passed as
+ * variadic one.
+ */
+void set_method_first_variadic_param_index(type *method, int index)
+{
+ assert(method && (method->type_op == type_method));
+ assert(index >= 0 && index <= get_method_n_params(method));
+
+ method->attr.ma.first_variadic_param = index;