Reuse already fetched values.
[libfirm] / ir / lower / lower_intrinsics.c
index f748f43..98ba0a8 100644 (file)
@@ -173,44 +173,32 @@ struct pass_t {
 static int pass_wrapper(ir_prog *irp, void *context)
 {
        struct pass_t *pass = context;
+       (void) irp; /* TODO: set current irp, or remove parameter */
        lower_intrinsics(pass->list, pass->length, pass->part_block_used);
        /* probably this pass should not run again */
        return 0;
-}  /* pass_wrapper */
+}
 
 /**
  * Creates an ir_prog pass for lower_intrinsics.
  *
  * @param name             the name of this pass or NULL
- * @param verify           should this pass be verified?
- * @param dump             should this pass result be dumped?
  * @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
  */
 ir_prog_pass_t *lower_intrinsics_pass(
        const char *name,
-       int verify,
-       int dump,
        i_record *list, int length, int part_block_used)
 {
        struct pass_t *pass = xmalloc(sizeof(*pass) + (length-1) * sizeof(pass->list[0]));
 
-       memset(&pass->pass, 0, sizeof(pass->pass));
-       pass->pass.kind          = k_ir_prog_pass;
-       pass->pass.run_on_irprog = pass_wrapper;
-       pass->pass.context       = pass;
-       pass->pass.name          = name ? name : "lower_intrinsics";
-       pass->pass.verify        = verify != 0;
-       pass->pass.dump          = dump != 0;
-
-       INIT_LIST_HEAD(&pass->pass.list);
-
        memcpy(pass->list, list, sizeof(list[0]) * length);
        pass->length          = length;
        pass->part_block_used = part_block_used;
 
-       return &pass->pass;
+       return def_prog_pass_constructor(
+               &pass->pass, name ? name : "lower_intrinsics", pass_wrapper);
 }  /* lower_intrinsics_pass*/
 
 /**