irop_flag_highlevel flag added to Confirm and Cast
[libfirm] / ir / ir / irreflect.h
index a7335f8..2f15ace 100644 (file)
@@ -7,8 +7,8 @@
  * $Id$
  */
 
-#ifndef __REFLECT_H
-#define __REFLECT_H
+#ifndef _FIRM_REFLECT_H
+#define _FIRM_REFLECT_H
 
 #include <limits.h>
 #include <stdbool.h>
@@ -93,7 +93,7 @@ int rflct_get_signature_count(opcode opc);
  * @param irn The node.
  * @return The first matching signature or -1, if no signature matches.
  */
-int rflct_get_signature(ir_node *irn);
+int rflct_get_signature(const ir_node *irn);
 
 /**
  * Get the number of in arguments.
@@ -113,6 +113,9 @@ int rflct_get_in_args_count(opcode opc, int sig);
  */
 int rflct_get_out_args_count(opcode opc, int sig);
 
+#define rflct_get_args_count(opc, sig, use) \
+  ((use) ? rflct_get_in_args_count(opc, sig) : rflct_get_out_args_count(opc, sig))
+
 /**
  * Get the array of use args.
  * The array is terminated with an entry for which
@@ -135,6 +138,9 @@ const rflct_arg_t *rflct_get_in_args(opcode opc, int sig);
  */
 const rflct_arg_t *rflct_get_out_args(opcode opc, int sig);
 
+#define rflct_get_args(opc, sig, use) \
+  ((use) ? rflct_get_in_args(opc, sig) : rflct_get_out_args(opc, sig))
+
 /**
  * Make a string representation of a signature of an opcode.
  * @param buf The buffer to put the string to.
@@ -188,7 +194,7 @@ rflct_sig_t *rflct_signature_allocate(int defs, int uses);
  * @param name The name of the argument.
  * @param mc The mode class of the argument.
  * @param is_variadic true, if the argument is variadic.
- * @param mode_equals This variable has following meaning. If the
+ * @param mode_equals This variable has following meaning: If the
  * argument is variadic, a 1 indicates that all operands binding to this
  * argument must have the same mode. A 0 indicates, that their mode must
  * be of the specified mode class but can differ. If the argument is non
@@ -212,4 +218,4 @@ int rflct_signature_set_arg(rflct_sig_t *sig, bool is_use, int num,
 int rflct_signature_get_index(const rflct_sig_t *sig, bool is_use, int num);
 
 
-#endif
+#endif /* _FIRM_REFLECT_H */