expose some critical bearch functions for inlining
authorMatthias Braun <matze@braunis.de>
Mon, 26 Nov 2012 18:21:15 +0000 (19:21 +0100)
committerMatthias Braun <matze@braunis.de>
Mon, 26 Nov 2012 18:21:46 +0000 (19:21 +0100)
ir/be/bearch.c
ir/be/bearch.h

index 5cb9937..63ac05d 100644 (file)
@@ -126,21 +126,6 @@ int arch_get_op_estimated_cost(const ir_node *irn)
        }
 }
 
-static reg_out_info_t *get_out_info(const ir_node *node)
-{
-       size_t                pos = 0;
-       const backend_info_t *info;
-       assert(get_irn_mode(node) != mode_T);
-       if (is_Proj(node)) {
-               pos  = get_Proj_proj(node);
-               node = get_Proj_pred(node);
-       }
-
-       info = be_get_info(node);
-       assert(pos < ARR_LEN(info->out_infos));
-       return &info->out_infos[pos];
-}
-
 static reg_out_info_t *get_out_info_n(const ir_node *node, unsigned pos)
 {
        const backend_info_t *info = be_get_info(node);
@@ -182,22 +167,6 @@ void arch_set_irn_register(ir_node *node, const arch_register_t *reg)
        out->reg = reg;
 }
 
-const arch_register_req_t *arch_get_irn_register_req(const ir_node *node)
-{
-       reg_out_info_t *out = get_out_info(node);
-       return out->req;
-}
-
-arch_irn_flags_t arch_get_irn_flags(const ir_node *node)
-{
-       backend_info_t *info;
-       if (is_Proj(node))
-               return arch_irn_flags_not_scheduled;
-
-       info = be_get_info(node);
-       return info->flags;
-}
-
 void arch_set_irn_flags(ir_node *node, arch_irn_flags_t flags)
 {
        backend_info_t *info;
index 490fb0b..c030d94 100644 (file)
@@ -174,14 +174,41 @@ static inline const arch_register_req_t **arch_get_irn_register_reqs_in(
        return info->in_reqs;
 }
 
-const arch_register_req_t *arch_get_irn_register_req(const ir_node *node);
+static inline reg_out_info_t *get_out_info(const ir_node *node)
+{
+       size_t                pos = 0;
+       const backend_info_t *info;
+       assert(get_irn_mode(node) != mode_T);
+       if (is_Proj(node)) {
+               pos  = get_Proj_proj(node);
+               node = get_Proj_pred(node);
+       }
+
+       info = be_get_info(node);
+       assert(pos < ARR_LEN(info->out_infos));
+       return &info->out_infos[pos];
+}
+
+static inline const arch_register_req_t *arch_get_irn_register_req(const ir_node *node)
+{
+       reg_out_info_t *out = get_out_info(node);
+       return out->req;
+}
 
 /**
  * Get the flags of a node.
  * @param irn The node.
  * @return The flags.
  */
-arch_irn_flags_t arch_get_irn_flags(const ir_node *irn);
+static inline arch_irn_flags_t arch_get_irn_flags(const ir_node *node)
+{
+       backend_info_t *info;
+       if (is_Proj(node))
+               return arch_irn_flags_not_scheduled;
+
+       info = be_get_info(node);
+       return info->flags;
+}
 
 void arch_set_irn_flags(ir_node *node, arch_irn_flags_t flags);
 void arch_add_irn_flags(ir_node *node, arch_irn_flags_t flags);