From a4d44e7824f844bea5ca0e907f628d0caa8f472a Mon Sep 17 00:00:00 2001 From: Till Riedel Date: Tue, 29 Apr 2003 10:56:20 +0000 Subject: [PATCH] got global vars right, hopefully [r1095] --- testprograms/endless_loop.c | 7 +++++-- testprograms/memory_example.c | 16 ++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/testprograms/endless_loop.c b/testprograms/endless_loop.c index 5f2fe4669..58ac48ce0 100644 --- a/testprograms/endless_loop.c +++ b/testprograms/endless_loop.c @@ -104,8 +104,11 @@ main(void) /* set VAR_A to constant value */ set_store (new_Proj (new_Store (get_store (), - new_Const (mode_P, new_tarval_from_str ("VAR_A", 6, mode_P)), /* length 6 because of NULL */ - get_value(1, mode_Is)), + new_simpleSel( + get_store(), + get_irg_globals(irg), + new_entity(get_glob_type(),id_from_str("VAR_A",6),prim_t_int)), + get_value(1, mode_Is)), mode_M, 0)); mature_block (b); diff --git a/testprograms/memory_example.c b/testprograms/memory_example.c index d13562550..d91071d04 100644 --- a/testprograms/memory_example.c +++ b/testprograms/memory_example.c @@ -83,12 +83,16 @@ main(void) /* Generates start and end blocks and nodes and a first, initial block */ irg = new_ir_graph (ent, 4); - /* generate two constant pointers to string constants */ - /* this simulates two global variables, a and b point to these variables */ - a = new_Const (mode_P, new_tarval_from_str ("VAR_A", 6, mode_P)); /* length 6 because of NULL terminator */ - b = new_Const (mode_P, new_tarval_from_str ("VAR_B", 6, mode_P)); - - /* set VAR_A and VAR_B to constant values */ + /* create two global variables, a and b point to these variables */ + a = new_simpleSel( + get_store(), + get_irg_globals(irg), + new_entity(get_glob_type(),id_from_str("VAR_A",6),prim_t_int)); + b = new_simpleSel( + get_store(), + get_irg_globals(irg), + new_entity(get_glob_type(),id_from_str("VAR_B",6),prim_t_int)); + /* set VAR_A and VAR_B to constant values */ set_store (new_Proj (new_Store (get_store (), a, new_Const (mode_Iu, new_tarval_from_long (0, mode_Is))), mode_M, 0)); -- 2.20.1