Commit b1b4c10d authored by Michael Beck's avatar Michael Beck
Browse files

Added prefix to variadicity

[r1731]
parent 4352072f
......@@ -365,7 +365,7 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
/* Compare arguments of node with those of type */
mt = get_Call_type(n);
if (get_method_variadicity(mt) == variadic) {
if (get_method_variadicity(mt) == variadicity_variadic) {
ASSERT_AND_RET(
get_Call_n_params(n) >= get_method_n_params(mt),
"Number of args for Call doesn't match number of args in variadic type.",
......
......@@ -858,7 +858,7 @@ INLINE type *new_type_method (ident *name, int n_param, int n_res) {
res->attr.ma.n_res = n_res;
res->attr.ma.res_type = (type **) xmalloc (sizeof (type *) * n_res);
res->attr.ma.value_ress = NULL;
res->attr.ma.variadicity = non_variadic;
res->attr.ma.variadicity = variadicity_non_variadic;
return res;
}
......@@ -943,6 +943,19 @@ entity *get_method_value_res_ent(type *method, int pos) {
return get_struct_member(method->attr.ma.value_ress, pos);
}
/* 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));
......
......@@ -554,10 +554,13 @@ entity *get_method_value_res_ent(type *method, int pos);
* non_variadic.
*/
typedef enum variadicity {
non_variadic, /**< non variadic */
variadic /**< variadic */
variadicity_non_variadic, /**< non variadic */
variadicity_variadic /**< variadic */
} variadicity;
/** Returns the null-terminated name of this variadicity. */
const char *get_variadicity_name(variadicity vari);
/** Returns the variadicity of a method. */
variadicity get_method_variadicity(type *method);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment