From 8a828c064c24643f30d68b67808a62e8a7ae1d80 Mon Sep 17 00:00:00 2001 From: Till Riedel Date: Tue, 21 Jan 2003 14:53:24 +0000 Subject: [PATCH] changed so that vcg output is not overwritten [r636] --- testprograms/array-heap_example.c | 4 ++-- testprograms/call_str_example.c | 4 ++-- testprograms/cond_example.c | 1 + testprograms/const_eval_example.c | 1 + testprograms/dead_block_example.c | 2 +- testprograms/empty.c | 2 +- testprograms/global_cse.c | 2 +- testprograms/global_var_example.c | 2 +- testprograms/if_else_example.c | 4 ++-- testprograms/if_example.c | 2 +- testprograms/if_while_example.c | 1 + testprograms/irr_cf_example.c | 2 +- testprograms/irr_loop_example.c | 1 + testprograms/memory_example.c | 1 + testprograms/oo_inline_example.c | 4 ++-- testprograms/oo_program_example.c | 4 ++-- testprograms/three_cfpred_example.c | 2 +- 17 files changed, 22 insertions(+), 17 deletions(-) diff --git a/testprograms/array-heap_example.c b/testprograms/array-heap_example.c index 6acb446fa..c22621229 100644 --- a/testprograms/array-heap_example.c +++ b/testprograms/array-heap_example.c @@ -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 */ diff --git a/testprograms/call_str_example.c b/testprograms/call_str_example.c index b1750e913..ff4f0badd 100644 --- a/testprograms/call_str_example.c +++ b/testprograms/call_str_example.c @@ -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); diff --git a/testprograms/cond_example.c b/testprograms/cond_example.c index 2d9f0a1d7..9dff71c06 100644 --- a/testprograms/cond_example.c +++ b/testprograms/cond_example.c @@ -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 diff --git a/testprograms/const_eval_example.c b/testprograms/const_eval_example.c index 14ac280f3..941620c1c 100644 --- a/testprograms/const_eval_example.c +++ b/testprograms/const_eval_example.c @@ -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); diff --git a/testprograms/dead_block_example.c b/testprograms/dead_block_example.c index bdbe69ad6..e7513b8b4 100644 --- a/testprograms/dead_block_example.c +++ b/testprograms/dead_block_example.c @@ -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); diff --git a/testprograms/empty.c b/testprograms/empty.c index a08b20917..7a26984e7 100644 --- a/testprograms/empty.c +++ b/testprograms/empty.c @@ -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 */ diff --git a/testprograms/global_cse.c b/testprograms/global_cse.c index 025a8e32c..4f2772d21 100644 --- a/testprograms/global_cse.c +++ b/testprograms/global_cse.c @@ -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 diff --git a/testprograms/global_var_example.c b/testprograms/global_var_example.c index 5c8a346e3..d149a1494 100644 --- a/testprograms/global_var_example.c +++ b/testprograms/global_var_example.c @@ -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 diff --git a/testprograms/if_else_example.c b/testprograms/if_else_example.c index 1b4c70bc8..f4f9246e4 100644 --- a/testprograms/if_else_example.c +++ b/testprograms/if_else_example.c @@ -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); diff --git a/testprograms/if_example.c b/testprograms/if_example.c index 86d5e66d1..3758a1d53 100644 --- a/testprograms/if_example.c +++ b/testprograms/if_example.c @@ -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 diff --git a/testprograms/if_while_example.c b/testprograms/if_while_example.c index e5b62bd62..cc3587d6e 100644 --- a/testprograms/if_while_example.c +++ b/testprograms/if_while_example.c @@ -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); diff --git a/testprograms/irr_cf_example.c b/testprograms/irr_cf_example.c index e40d9ace2..722230874 100644 --- a/testprograms/irr_cf_example.c +++ b/testprograms/irr_cf_example.c @@ -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); diff --git a/testprograms/irr_loop_example.c b/testprograms/irr_loop_example.c index 8509c37f8..3129af8b2 100644 --- a/testprograms/irr_loop_example.c +++ b/testprograms/irr_loop_example.c @@ -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 diff --git a/testprograms/memory_example.c b/testprograms/memory_example.c index 00497660e..b6a6e796e 100644 --- a/testprograms/memory_example.c +++ b/testprograms/memory_example.c @@ -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); diff --git a/testprograms/oo_inline_example.c b/testprograms/oo_inline_example.c index 9d4d38079..0c250c41c 100644 --- a/testprograms/oo_inline_example.c +++ b/testprograms/oo_inline_example.c @@ -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"). */ diff --git a/testprograms/oo_program_example.c b/testprograms/oo_program_example.c index e20660ce4..73ae9c907 100644 --- a/testprograms/oo_program_example.c +++ b/testprograms/oo_program_example.c @@ -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"). */ diff --git a/testprograms/three_cfpred_example.c b/testprograms/three_cfpred_example.c index c4618d718..1570e1833 100644 --- a/testprograms/three_cfpred_example.c +++ b/testprograms/three_cfpred_example.c @@ -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"); -- 2.20.1