move is_liveness_node to irlivechk header and share it with belive
authorMatthias Braun <matze@braunis.de>
Tue, 27 Nov 2012 16:27:10 +0000 (17:27 +0100)
committerMatthias Braun <matze@braunis.de>
Wed, 28 Nov 2012 10:27:13 +0000 (11:27 +0100)
ir/ana/irlivechk.c
ir/ana/irlivechk.h
ir/be/belive.c

index 89b12f1..d4c4efb 100644 (file)
@@ -101,26 +101,6 @@ static bl_info_t *get_block_info(lv_chk_t *lv, const ir_node *block)
        return info;
 }
 
-/**
- * Filter function to select all nodes for which liveness is computed.
- * @param irn A node.
- * @return    1 if the node shall be considered in liveness, 0 if not.
- */
-static inline int is_liveness_node(const ir_node *irn)
-{
-       switch (get_irn_opcode(irn)) {
-       case iro_Block:
-       case iro_Bad:
-       case iro_End:
-       case iro_Anchor:
-               return 0;
-       default:
-               break;
-       }
-
-       return 1;
-}
-
 /**
  * Compute the transitive closure on the reduced graph.
  * The reduced graph is the original graph without back edges.
index ded033b..87405fa 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "irgraph.h"
 #include "irnode.h"
+#include <stdbool.h>
 
 typedef enum {
        lv_chk_state_in  = 1,
@@ -43,6 +44,26 @@ typedef enum {
 
 typedef struct lv_chk_t lv_chk_t;
 
+/**
+ * Filter out some nodes for which we never need liveness.
+ *
+ * @param irn  the node t check
+ * @return 0 if no liveness info is needed, 1 else
+ */
+static inline bool is_liveness_node(const ir_node *irn)
+{
+       switch (get_irn_opcode(irn)) {
+       case iro_Block:
+       case iro_Bad:
+       case iro_End:
+       case iro_Anchor:
+       case iro_NoMem:
+               return 0;
+       default:
+               return 1;
+       }
+}
+
 /**
  * Make a new liveness check environment.
  * @param irg The graph.
index c1123a6..ddabe0e 100644 (file)
@@ -47,26 +47,6 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
 
 #define LV_STD_SIZE             64
 
-/**
- * Filter out some nodes for which we never need liveness.
- *
- * @param irn  the node t check
- * @return 0 if no liveness info is needed, 1 else
- */
-static inline int is_liveness_node(const ir_node *irn)
-{
-       switch (get_irn_opcode(irn)) {
-       case iro_Block:
-       case iro_Bad:
-       case iro_End:
-       case iro_Anchor:
-       case iro_NoMem:
-               return 0;
-       default:
-               return 1;
-       }
-}
-
 int (be_is_live_in)(const be_lv_t *lv, const ir_node *block, const ir_node *irn)
 {
        return _be_is_live_xxx(lv, block, irn, be_lv_state_in);