changed so that vcg output is not overwritten
authorTill Riedel <till@ipd.info.uni-karlsruhe.de>
Tue, 21 Jan 2003 14:53:24 +0000 (14:53 +0000)
committerTill Riedel <till@ipd.info.uni-karlsruhe.de>
Tue, 21 Jan 2003 14:53:24 +0000 (14:53 +0000)
[r636]

17 files changed:
testprograms/array-heap_example.c
testprograms/call_str_example.c
testprograms/cond_example.c
testprograms/const_eval_example.c
testprograms/dead_block_example.c
testprograms/empty.c
testprograms/global_cse.c
testprograms/global_var_example.c
testprograms/if_else_example.c
testprograms/if_example.c
testprograms/if_while_example.c
testprograms/irr_cf_example.c
testprograms/irr_loop_example.c
testprograms/memory_example.c
testprograms/oo_inline_example.c
testprograms/oo_program_example.c
testprograms/three_cfpred_example.c

index 6acb446..c226212 100644 (file)
@@ -82,9 +82,9 @@ main(void)
 
   /* first build procedure main */
   owner = get_glob_type();
-  proc_main = new_type_method(id_from_str("main", 4), 0, 1);
+  proc_main = new_type_method(id_from_str("ARRAY-HEAP_EXAMPLE_main", 23), 0, 1);
   set_method_res_type(proc_main, 0, (type *)prim_t_int);
-  proc_main_e = new_entity ((type*)owner, id_from_str ("main", 4), (type *)proc_main);
+  proc_main_e = new_entity ((type*)owner, id_from_str ("ARRAY-HEAP_EXAMPLE_main", 23), (type *)proc_main);
   main_irg = new_ir_graph (proc_main_e, 4);
 
   /* make type information for the array and set the bounds */
index b1750e9..ff4f0ba 100644 (file)
@@ -48,7 +48,7 @@ int main(int argc, char **argv)
    * automatically generated.
    * We use the same name for the method type as for the method entity.
    */
-#define METHODNAME "main"
+#define METHODNAME "CALL_STR_EXAMPLE_main"
 #define NRARGS 0
 #define NRES 0
   owner = get_glob_type();
@@ -66,7 +66,7 @@ int main(int argc, char **argv)
   set_method_param_type(proc_called, 0, string_ptr);
 
   /* Make the entity for main needed for a correct  ir_graph.  */
-#define ENTITYNAME "main"
+#define ENTITYNAME "CALL_STR_EXAMPLE_main"
   ent = new_entity (owner, id_from_str (ENTITYNAME, strlen(ENTITYNAME)),
                     proc_main);
 
index 2d9f0a1..9dff71c 100644 (file)
@@ -54,6 +54,7 @@ int main(int argc, char **argv)
   set_method_param_type(method, 0, prim_t_int);
   set_method_res_type(method, 0, prim_t_int);
   ent = new_entity (owner, id_from_str (ENTITYNAME, strlen(ENTITYNAME)), method);
+  get_entity_ld_name(ent);
 
 
   /* Generates the basic graph for the method represented by entity ent, that
index 14ac280..941620c 100644 (file)
@@ -53,6 +53,7 @@ main(void)
   set_method_res_type(method, 0, prim_t_int);
   set_method_res_type(method, 1, prim_t_int);
   ent = new_entity (owner, id_from_str ("main", 4), method);
+  get_entity_ld_name(ent);
 
   irg = new_ir_graph (ent, 4);
 
index bdbe69a..e7513b8 100644 (file)
@@ -79,7 +79,7 @@ int main(int argc, char **argv)
   ent = new_entity (owner,
                     id_from_str (METHODNAME, strlen(METHODNAME)),
                     proc_main);
-
+  get_entity_ld_name(ent); /* To enforce name mangling for vcg graph name */
 #define NUM_OF_LOCAL_VARS 1
 
   irg = new_ir_graph (ent, NUM_OF_LOCAL_VARS);
index a08b209..7a26984 100644 (file)
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
    */
   owner = get_glob_type();
 
-#define METHODNAME "main"
+#define METHODNAME "EMPTY_main"
 #define NRARGS 0
 #define NRES 0
   /* The type of the method */
index 025a8e3..4f2772d 100644 (file)
@@ -52,7 +52,7 @@ main(void)
   set_opt_dead_node_elimination (1);
 
 #define CLASSNAME "GLOBAL_CSE_EXAMPLE"
-#define METHODNAME "main"
+#define METHODNAME "GLOBAL_CSE_EXAMPLE_main"
 #define NRARGS 1
 #define NRES 1
 
index 5c8a346..d149a14 100644 (file)
@@ -57,7 +57,7 @@ int main(int argc, char **argv)
    * a large class containing all functions as methods in this file.
    * This class is automatically generated and can be obtained by get_glob_type().
    */
-#define METHODNAME "main"
+#define METHODNAME "GLOBAL_VAR_main"
 #define NRARGS 0
 #define NRES 0
 
index 1b4c70b..f4f9246 100644 (file)
@@ -55,10 +55,10 @@ int main(int argc, char **argv)
    * Therefore we define a class "IF_ELSE_EXAMPLE" with a method main as an
    * entity.
    */
-#define ENTITYNAME "main"
+#define ENTITYNAME "IF_ELSE_EXAMPLE_main"
 
   owner = get_glob_type();
-  method = new_type_method (id_from_str("main", 4), 0, 2);
+  method = new_type_method (id_from_str(ENTITYNAME, strlen(ENTITYNAME)), 0, 2);
   set_method_res_type(method, 0, prim_t_int);
   set_method_res_type(method, 1, prim_t_int);
 
index 86d5e66..3758a1d 100644 (file)
@@ -41,7 +41,7 @@ main(void)
   init_firm ();
 
 #define CLASSNAME "IF_EXAMPLE"
-#define METHODNAME "main"
+#define METHODNAME "IF_EXAMPLE_main"
 #define NRARGS 1
 #define NRES 1
 
index e5b62bd..cc3587d 100644 (file)
@@ -67,6 +67,7 @@ main(void)
   set_method_res_type(proc_main, 0, prim_t_int);
   owner = new_type_class (id_from_str ("IF_WHILE_EXAMPLE", 16));
   ent = new_entity (owner, id_from_str ("main", 4), proc_main);
+  get_entity_ld_name(ent);
 
   /* Generates start and end blocks and nodes and a first, initial block */
   irg = new_ir_graph (ent, 4);
index e40d9ac..7222308 100644 (file)
@@ -76,7 +76,7 @@ int main(int argc, char **argv)
   ent = new_entity ((type *)owner,
                     id_from_str (METHODNAME, strlen(METHODNAME)),
                     (type *)proc_main);
-
+  get_entity_ld_name(ent);
 #define NUM_OF_LOCAL_VARS 0
 
   irg = new_ir_graph (ent, NUM_OF_LOCAL_VARS);
index 8509c37..3129af8 100644 (file)
@@ -70,6 +70,7 @@ int main(int argc, char **argv)
   ent = new_entity (owner,
                     id_from_str (METHODNAME, strlen(METHODNAME)),
                     proc_main);
+  get_entity_ld_name(ent); /* To enforce name mangling for vcg graph name */
 
 #define NUM_OF_LOCAL_VARS 0
 
index 0049766..b6a6e79 100644 (file)
@@ -78,6 +78,7 @@ main(void)
   method = new_type_method (id_from_str("main", 4), 0, 1);
   set_method_res_type(method, 0, prim_t_int);
   ent = new_entity (owner, id_from_str ("main", 4), method);
+  get_entity_ld_name(ent); /* To enforce name mangling for vcg graph name */
 
   /* Generates start and end blocks and nodes and a first, initial block */
   irg = new_ir_graph (ent, 4);
index 9d4d380..0c250c4 100644 (file)
@@ -99,12 +99,12 @@ main(void)
      owner is the global type. */
   owner = get_glob_type();
   /* Main has zero parameters and one result. */
-  proc_main = new_type_method(id_from_str("main", 4), 0, 1);
+  proc_main = new_type_method(id_from_str("OO_INLINE_EXAMPLE_main", 22), 0, 1);
   /* The result type is int. */
   set_method_res_type(proc_main, 0, prim_t_int);
 
   /* The entity for main. */
-  proc_main_e = new_entity (owner, id_from_str ("main", 4), proc_main);
+  proc_main_e = new_entity (owner, id_from_str ("OO_INLINE_EXAMPLE_main", 22), proc_main);
 
   /** Build code for procedure main. **/
   /* We need one local variable (for "o"). */
index e20660c..73ae9c9 100644 (file)
@@ -94,12 +94,12 @@ main(void)
      owner is the global type. */
   owner = get_glob_type();
   /* Main has zero parameters and one result. */
-  proc_main = new_type_method(id_from_str("main", 4), 0, 1);
+  proc_main = new_type_method(id_from_str("OO_PROGRAM_EXAMPLE_main", 23), 0, 1);
   /* The result type is int. */
   set_method_res_type(proc_main, 0, prim_t_int);
 
   /* The entity for main. */
-  proc_main_e = new_entity (owner, id_from_str ("main", 4), proc_main);
+  proc_main_e = new_entity (owner, id_from_str ("OO_PROGRAM_EXAMPLE_main", 23), proc_main);
 
   /** Build code for procedure main. **/
   /* We need one local variable (for "o"). */
index c4618d7..1570e18 100644 (file)
@@ -71,7 +71,7 @@ int main(int argc, char **argv)
    * all functions as methods in this file.
    * This class now is automatically generated.
    */
-#define METHODNAME "main"
+#define METHODNAME "THREE_CFPRED_EXAMPLE_main"
 #define NRARGS 1
 #define NRES 1
   printf("\nCreating an IR graph: ...\n");