use nitg to bootstrap; drop bootstrap of nitc
[nit.git] / c_src / global___dead_method_removal._sep.c
diff --git a/c_src/global___dead_method_removal._sep.c b/c_src/global___dead_method_removal._sep.c
deleted file mode 100644 (file)
index aefc266..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/* This C file is generated by NIT to compile module global___dead_method_removal. */
-#include "global___dead_method_removal._sep.h"
-static const char LOCATE_global___dead_method_removal___Program___nb_removed_iroutines[] = "dead_method_removal::Program::nb_removed_iroutines";
-val_t global___dead_method_removal___Program___nb_removed_iroutines(val_t p0){
-  struct {struct stack_frame_t me;} fra;
-  val_t REGB0;
-  val_t tmp;
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_global___dead_method_removal;
-  fra.me.line = 23;
-  fra.me.meth = LOCATE_global___dead_method_removal___Program___nb_removed_iroutines;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 1;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  /* global/dead_method_removal.nit:23 */
-  REGB0 = TAG_Bool(ATTR_global___dead_method_removal___Program____nb_removed_iroutines(fra.me.REG[0])!=NIT_NULL);
-  if (UNTAG_Bool(REGB0)) {
-  } else {
-    nit_abort("Uninitialized attribute %s", "_nb_removed_iroutines", LOCATE_global___dead_method_removal, 23);
-  }
-  REGB0 = ATTR_global___dead_method_removal___Program____nb_removed_iroutines(fra.me.REG[0]);
-  stack_frame_head = fra.me.prev;
-  return REGB0;
-}
-static const char LOCATE_global___dead_method_removal___Program___nb_not_removed_iroutines[] = "dead_method_removal::Program::nb_not_removed_iroutines";
-val_t global___dead_method_removal___Program___nb_not_removed_iroutines(val_t p0){
-  struct {struct stack_frame_t me;} fra;
-  val_t REGB0;
-  val_t tmp;
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_global___dead_method_removal;
-  fra.me.line = 24;
-  fra.me.meth = LOCATE_global___dead_method_removal___Program___nb_not_removed_iroutines;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 1;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  /* global/dead_method_removal.nit:24 */
-  REGB0 = TAG_Bool(ATTR_global___dead_method_removal___Program____nb_not_removed_iroutines(fra.me.REG[0])!=NIT_NULL);
-  if (UNTAG_Bool(REGB0)) {
-  } else {
-    nit_abort("Uninitialized attribute %s", "_nb_not_removed_iroutines", LOCATE_global___dead_method_removal, 24);
-  }
-  REGB0 = ATTR_global___dead_method_removal___Program____nb_not_removed_iroutines(fra.me.REG[0]);
-  stack_frame_head = fra.me.prev;
-  return REGB0;
-}
-static const char LOCATE_global___dead_method_removal___Program___optimize_dead_methods[] = "dead_method_removal::Program::optimize_dead_methods";
-void global___dead_method_removal___Program___optimize_dead_methods(val_t p0){
-  struct {struct stack_frame_t me;} fra;
-  val_t tmp;
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_global___dead_method_removal;
-  fra.me.line = 26;
-  fra.me.meth = LOCATE_global___dead_method_removal___Program___optimize_dead_methods;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 1;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  CALL_program___Program___with_each_iroutines(fra.me.REG[0])(fra.me.REG[0], (&(fra.me)), ((fun_t)OC_global___dead_method_removal___Program___optimize_dead_methods_1));
-  stack_frame_head = fra.me.prev;
-  return;
-}
-  void OC_global___dead_method_removal___Program___optimize_dead_methods_1(struct stack_frame_t *closctx, val_t p0, val_t p1){
-    struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
-    val_t REGB0;
-    val_t REGB1;
-    val_t tmp;
-    /* global/dead_method_removal.nit:29 */
-    fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-    fra.me.file = LOCATE_global___dead_method_removal;
-    fra.me.line = 29;
-    fra.me.meth = LOCATE_global___dead_method_removal___Program___optimize_dead_methods;
-    fra.me.has_broke = 0;
-    fra.me.REG_size = 3;
-    fra.me.nitni_local_ref_head = NULL;
-    fra.me.REG[0] = NIT_NULL;
-    fra.me.REG[1] = NIT_NULL;
-    fra.me.REG[2] = NIT_NULL;
-    fra.me.REG[0] = p0;
-    fra.me.REG[1] = p1;
-    /* global/dead_method_removal.nit:30 */
-    fra.me.REG[2] = CALL_global___reachable_method_analysis___Program___rma(closctx->REG[0])(closctx->REG[0]);
-    REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
-    if (UNTAG_Bool(REGB0)) {
-      nit_abort("Reciever is null", NULL, LOCATE_global___dead_method_removal, 30);
-    }
-    REGB0 = CALL_global___reachable_method_analysis___ReachableMethodAnalysis___is_iroutine_reachable(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[0]);
-    REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
-    if (UNTAG_Bool(REGB0)) {
-      /* global/dead_method_removal.nit:31 */
-      CALL_global___dead_method_removal___IRoutine___set_not_reachable(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
-      /* global/dead_method_removal.nit:32 */
-      REGB0 = CALL_global___dead_method_removal___Program___nb_removed_iroutines(closctx->REG[0])(closctx->REG[0]);
-      REGB1 = TAG_Int(1);
-      /* ../lib/standard/kernel.nit:245 */
-      REGB1 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB1));
-      /* global/dead_method_removal.nit:32 */
-      ATTR_global___dead_method_removal___Program____nb_removed_iroutines(closctx->REG[0]) = REGB1;
-    } else {
-      /* global/dead_method_removal.nit:34 */
-      REGB1 = CALL_global___dead_method_removal___Program___nb_not_removed_iroutines(closctx->REG[0])(closctx->REG[0]);
-      REGB0 = TAG_Int(1);
-      /* ../lib/standard/kernel.nit:245 */
-      REGB0 = TAG_Int(UNTAG_Int(REGB1)+UNTAG_Int(REGB0));
-      /* global/dead_method_removal.nit:34 */
-      ATTR_global___dead_method_removal___Program____nb_not_removed_iroutines(closctx->REG[0]) = REGB0;
-    }
-    stack_frame_head = fra.me.prev;
-    return;
-  }
-static const char LOCATE_global___dead_method_removal___Program___dump_dead_method_optimization[] = "dead_method_removal::Program::dump_dead_method_optimization";
-void global___dead_method_removal___Program___dump_dead_method_optimization(val_t p0, val_t p1){
-  struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
-  val_t REGB0;
-  val_t tmp;
-  static val_t once_value_1; /* Once value */
-  static val_t once_value_2; /* Once value */
-  static val_t once_value_3; /* Once value */
-  static val_t once_value_4; /* Once value */
-  static val_t once_value_5; /* Once value */
-  static val_t once_value_6; /* Once value */
-  static val_t once_value_7; /* Once value */
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_global___dead_method_removal;
-  fra.me.line = 39;
-  fra.me.meth = LOCATE_global___dead_method_removal___Program___dump_dead_method_optimization;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 4;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[1] = NIT_NULL;
-  fra.me.REG[2] = NIT_NULL;
-  fra.me.REG[3] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  fra.me.REG[1] = p1;
-  /* global/dead_method_removal.nit:41 */
-  REGB0 = TAG_Int(5);
-  fra.me.REG[2] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
-  if (!once_value_1) {
-    fra.me.REG[3] = BOX_NativeString("");
-    REGB0 = TAG_Int(0);
-    fra.me.REG[3] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[3])(fra.me.REG[3], REGB0);
-    once_value_1 = fra.me.REG[3];
-    register_static_object(&once_value_1);
-  } else fra.me.REG[3] = once_value_1;
-  fra.me.REG[3] = fra.me.REG[3];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
-  if (!once_value_2) {
-    fra.me.REG[1] = BOX_NativeString("/");
-    REGB0 = TAG_Int(1);
-    fra.me.REG[1] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[1])(fra.me.REG[1], REGB0);
-    once_value_2 = fra.me.REG[1];
-    register_static_object(&once_value_2);
-  } else fra.me.REG[1] = once_value_2;
-  fra.me.REG[1] = fra.me.REG[1];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
-  fra.me.REG[1] = CALL_program___Program___main_module(fra.me.REG[0])(fra.me.REG[0]);
-  fra.me.REG[1] = CALL_metamodel___abstractmetamodel___MMModule___name(fra.me.REG[1])(fra.me.REG[1]);
-  fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
-  if (!once_value_3) {
-    fra.me.REG[1] = BOX_NativeString(".dmr_opt.log");
-    REGB0 = TAG_Int(12);
-    fra.me.REG[1] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[1])(fra.me.REG[1], REGB0);
-    once_value_3 = fra.me.REG[1];
-    register_static_object(&once_value_3);
-  } else fra.me.REG[1] = once_value_3;
-  fra.me.REG[1] = fra.me.REG[1];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
-  fra.me.REG[2] = CALL_standard___string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]);
-  fra.me.REG[2] = NEW_OFStream_standard___file___OFStream___open(fra.me.REG[2]);
-  /* global/dead_method_removal.nit:43 */
-  REGB0 = TAG_Int(3);
-  fra.me.REG[1] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
-  if (!once_value_4) {
-    fra.me.REG[3] = BOX_NativeString("Nb. dead iroutines removed: ");
-    REGB0 = TAG_Int(28);
-    fra.me.REG[3] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[3])(fra.me.REG[3], REGB0);
-    once_value_4 = fra.me.REG[3];
-    register_static_object(&once_value_4);
-  } else fra.me.REG[3] = once_value_4;
-  fra.me.REG[3] = fra.me.REG[3];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]);
-  REGB0 = CALL_global___dead_method_removal___Program___nb_removed_iroutines(fra.me.REG[0])(fra.me.REG[0]);
-  fra.me.REG[3] = CALL_standard___string___Object___to_s(REGB0)(REGB0);
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]);
-  if (!once_value_5) {
-    fra.me.REG[3] = BOX_NativeString("\n");
-    REGB0 = TAG_Int(1);
-    fra.me.REG[3] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[3])(fra.me.REG[3], REGB0);
-    once_value_5 = fra.me.REG[3];
-    register_static_object(&once_value_5);
-  } else fra.me.REG[3] = once_value_5;
-  fra.me.REG[3] = fra.me.REG[3];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]);
-  fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
-  CALL_standard___stream___OStream___write(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
-  /* global/dead_method_removal.nit:44 */
-  REGB0 = TAG_Int(3);
-  fra.me.REG[1] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
-  if (!once_value_6) {
-    fra.me.REG[3] = BOX_NativeString("Nb. live iroutines: ");
-    REGB0 = TAG_Int(20);
-    fra.me.REG[3] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[3])(fra.me.REG[3], REGB0);
-    once_value_6 = fra.me.REG[3];
-    register_static_object(&once_value_6);
-  } else fra.me.REG[3] = once_value_6;
-  fra.me.REG[3] = fra.me.REG[3];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]);
-  REGB0 = CALL_global___dead_method_removal___Program___nb_not_removed_iroutines(fra.me.REG[0])(fra.me.REG[0]);
-  fra.me.REG[0] = CALL_standard___string___Object___to_s(REGB0)(REGB0);
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]);
-  if (!once_value_7) {
-    fra.me.REG[0] = BOX_NativeString("\n");
-    REGB0 = TAG_Int(1);
-    fra.me.REG[0] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[0])(fra.me.REG[0], REGB0);
-    once_value_7 = fra.me.REG[0];
-    register_static_object(&once_value_7);
-  } else fra.me.REG[0] = once_value_7;
-  fra.me.REG[0] = fra.me.REG[0];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]);
-  fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
-  CALL_standard___stream___OStream___write(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
-  /* global/dead_method_removal.nit:46 */
-  CALL_standard___stream___IOS___close(fra.me.REG[2])(fra.me.REG[2]);
-  stack_frame_head = fra.me.prev;
-  return;
-}
-static const char LOCATE_global___dead_method_removal___IRoutine___set_not_reachable[] = "dead_method_removal::IRoutine::set_not_reachable";
-void global___dead_method_removal___IRoutine___set_not_reachable(val_t p0, val_t p1){
-  struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
-  val_t REGB0;
-  val_t tmp;
-  static val_t once_value_1; /* Once value */
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_global___dead_method_removal;
-  fra.me.line = 51;
-  fra.me.meth = LOCATE_global___dead_method_removal___IRoutine___set_not_reachable;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 3;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[1] = NIT_NULL;
-  fra.me.REG[2] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  fra.me.REG[1] = p1;
-  /* global/dead_method_removal.nit:53 */
-  fra.me.REG[0] = NEW_ICodeBuilder_icode___icode_builder___ICodeBuilder___init(fra.me.REG[1], fra.me.REG[0]);
-  /* global/dead_method_removal.nit:54 */
-  fra.me.REG[1] = CALL_icode___icode_builder___ICodeBuilder___seq(fra.me.REG[0])(fra.me.REG[0]);
-  fra.me.REG[1] = CALL_icode___icode_base___ISeq___icodes(fra.me.REG[1])(fra.me.REG[1]);
-  CALL_standard___collection___abstract_collection___RemovableCollection___clear(fra.me.REG[1])(fra.me.REG[1]);
-  /* global/dead_method_removal.nit:55 */
-  REGB0 = TAG_Int(0);
-  fra.me.REG[1] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
-  if (!once_value_1) {
-    fra.me.REG[2] = BOX_NativeString("This method should not be called !");
-    REGB0 = TAG_Int(34);
-    fra.me.REG[2] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[2])(fra.me.REG[2], REGB0);
-    once_value_1 = fra.me.REG[2];
-    register_static_object(&once_value_1);
-  } else fra.me.REG[2] = once_value_1;
-  fra.me.REG[2] = fra.me.REG[2];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
-  CALL_icode___icode_builder___ICodeBuilder___add_abort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
-  stack_frame_head = fra.me.prev;
-  return;
-}