Added prefix to variadicity
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 20 Aug 2003 12:47:48 +0000 (12:47 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 20 Aug 2003 12:47:48 +0000 (12:47 +0000)
[r1731]

ir/ir/irvrfy.c
ir/tr/type.c
ir/tr/type.h

index beeb0c0..3359106 100644 (file)
@@ -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.",
index 916dad3..865e855 100644 (file)
@@ -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));
index b8d0fd6..3b3b33a 100644 (file)
@@ -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);