+/*
+ * 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(const ir_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(ir_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;
+}
+
+unsigned (get_method_additional_properties)(const ir_type *method) {
+ return _get_method_additional_properties(method);
+}
+
+void (set_method_additional_properties)(ir_type *method, unsigned mask) {
+ _set_method_additional_properties(method, mask);
+}
+
+void (set_method_additional_property)(ir_type *method, mtp_additional_property flag) {
+ _set_method_additional_property(method, flag);
+}
+
+/* Returns the calling convention of an entities graph. */
+unsigned (get_method_calling_convention)(const ir_type *method) {
+ return _get_method_calling_convention(method);
+}
+
+/* Sets the calling convention of an entities graph. */
+void (set_method_calling_convention)(ir_type *method, unsigned cc_mask) {
+ _set_method_calling_convention(method, cc_mask);
+}
+
+/* Returns the number of registers parameters, 0 means default. */
+unsigned get_method_n_regparams(ir_type *method) {
+ unsigned cc = get_method_calling_convention(method);
+ assert(IS_FASTCALL(cc));
+
+ return cc & ~cc_bits;
+}
+
+/* Sets the number of registers parameters, 0 means default. */
+void set_method_n_regparams(ir_type *method, unsigned n_regs) {
+ unsigned cc = get_method_calling_convention(method);
+ assert(IS_FASTCALL(cc));
+
+ set_method_calling_convention(method, (cc & cc_bits) | (n_regs & ~cc_bits));
+}
+