Refactoring: Deleted unused inlining functionality.
[libfirm] / include / libfirm / lowering.h
index 3ce7e7d..9b49353 100644 (file)
 
 #include "begin.h"
 
+/**
+ * @defgroup ir_lowering  Lowering
+ *
+ * Lowering is the process of transforming a highlevel representation
+ * (a representation closer to the sourcecode) into a lower-level representation
+ * (something closer to the target machine).
+ *
+ * @{
+ */
+
 /**
  * Lower small CopyB nodes to Load/Store nodes, preserve medium-sized CopyB
  * nodes and replace large CopyBs by a call to memcpy, depending on the given
@@ -60,16 +70,14 @@ FIRM_API void lower_CopyB(ir_graph *irg, unsigned max_small_size,
  * @param small_switch  If switch has <= cases then change it to an if-cascade.
  * @param spare_size Allowed spare size for table switches in machine words.
  *                   (Default in edgfe: 128)
- * @param allow_out_of_bounds   backend can handle out-of-bounds values
- *                              (values bigger than minimum and maximum proj
- *                               number)
+ * @param selector_mode mode which must be used for Switch selector
  */
 FIRM_API void lower_switch(ir_graph *irg, unsigned small_switch,
-                           unsigned spare_size, int allow_out_of_bounds);
+                           unsigned spare_size, ir_mode *selector_mode);
 
 /**
  * Replaces SymConsts by a real constant if possible.
- * Replace Sel nodes by address computation.  Also resolves array access.
+ * Replaces Sel nodes by address computation.  Also resolves array access.
  * Handle bit fields by added And/Or calculations.
  *
  * @param irg               the graph to lower
@@ -90,7 +98,7 @@ FIRM_API ir_graph_pass_t *lower_highlevel_graph_pass(const char *name);
 
 /**
  * Replaces SymConsts by a real constant if possible.
- * Replace Sel nodes by address computation.  Also resolves array access.
+ * Replaces Sel nodes by address computation.  Also resolves array access.
  * Handle bit fields by added And/Or calculations.
  * Lowers all graphs.
  *
@@ -155,6 +163,8 @@ FIRM_API ir_graph_pass_t *lower_mux_pass(const char *name,
  */
 typedef int (*i_mapper_func)(ir_node *node, void *ctx);
 
+/** kind of an instruction record
+ * @see #i_record */
 enum ikind {
        INTRINSIC_CALL  = 0,  /**< the record represents an intrinsic call */
        INTRINSIC_INSTR       /**< the record represents an intrinsic instruction */
@@ -186,8 +196,9 @@ typedef struct i_instr_record {
  * An intrinsic record.
  */
 typedef union i_record {
-       i_call_record  i_call;
-       i_instr_record i_instr;
+       enum ikind     kind;     /**< kind of record */
+       i_call_record  i_call;   /**< used for call records */
+       i_instr_record i_instr;  /**< used for isnstruction records */
 } i_record;
 
 /**
@@ -196,8 +207,6 @@ typedef union i_record {
  * Every call or instruction is reported to its mapper function,
  * which is responsible for rebuilding the graph.
  *
- * current_ir_graph is always set.
- *
  * @param list             an array of intrinsic map records
  * @param length           the length of the array
  * @param part_block_used  set to true if part_block() must be using during lowering
@@ -205,7 +214,7 @@ typedef union i_record {
  * @return number of found intrinsics.
  */
 FIRM_API size_t lower_intrinsics(i_record *list, size_t length,
-                                   int part_block_used);
+                                 int part_block_used);
 
 /**
  * Creates an irprog pass for lower_intrinsics.
@@ -262,8 +271,19 @@ FIRM_API int i_mapper_pow(ir_node *call, void *ctx);
  */
 FIRM_API int i_mapper_exp(ir_node *call, void *ctx);
 
-#define i_mapper_exp2   i_mapper_exp
-#define i_mapper_exp10  i_mapper_exp
+/**
+ * A mapper for the floating point exp2(a): floattype exp2(floattype a);
+ *
+ * @return 1 if the exp call was removed, 0 else.
+ */
+FIRM_API int i_mapper_exp2(ir_node *call, void *ctx);
+
+/**
+ * A mapper for the floating point exp10(a): floattype exp10(floattype a);
+ *
+ * @return 1 if the exp call was removed, 0 else.
+ */
+FIRM_API int i_mapper_exp10(ir_node *call, void *ctx);
 
 /**
  * A mapper for the floating point log(a): floattype log(floattype a);
@@ -272,8 +292,19 @@ FIRM_API int i_mapper_exp(ir_node *call, void *ctx);
  */
 FIRM_API int i_mapper_log(ir_node *call, void *ctx);
 
-#define i_mapper_log2   i_mapper_log
-#define i_mapper_log10  i_mapper_log
+/**
+ * A mapper for the floating point log(a): floattype log(floattype a);
+ *
+ * @return 1 if the log call was removed, 0 else.
+ */
+FIRM_API int i_mapper_log2(ir_node *call, void *ctx);
+
+/**
+ * A mapper for the floating point log(a): floattype log(floattype a);
+ *
+ * @return 1 if the log call was removed, 0 else.
+ */
+FIRM_API int i_mapper_log10(ir_node *call, void *ctx);
 
 /**
  * A mapper for the floating point sin(a): floattype sin(floattype a);
@@ -483,6 +514,8 @@ typedef struct runtime_rt {
  */
 FIRM_API int i_mapper_RuntimeCall(ir_node *node, runtime_rt *rt);
 
+/** @} */
+
 #include "end.h"
 
 #endif