/* 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 */
* 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();
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);
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
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);
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);
*/
owner = get_glob_type();
-#define METHODNAME "main"
+#define METHODNAME "EMPTY_main"
#define NRARGS 0
#define NRES 0
/* The type of the method */
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
* 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
* 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);
init_firm ();
#define CLASSNAME "IF_EXAMPLE"
-#define METHODNAME "main"
+#define METHODNAME "IF_EXAMPLE_main"
#define NRARGS 1
#define NRES 1
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);
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);
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
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);
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"). */
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"). */
* 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");