X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=testprograms%2Fmemory_example.c;h=1ec5af15bc01293b6f208a1fb76ebc85d61253dc;hb=f34c10e30b6812a53efbb2634c04c3511c75344b;hp=d135625507934ddb8bea5f9b27d9e1e5614b21db;hpb=13588bfa29b57530c70851264dd5ea05184b9486;p=libfirm diff --git a/testprograms/memory_example.c b/testprograms/memory_example.c index d13562550..1ec5af15b 100644 --- a/testprograms/memory_example.c +++ b/testprograms/memory_example.c @@ -1,10 +1,14 @@ -/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe -* All rights reserved. -* -* Authors: Christian Schaefer, Goetz Lindenmaier -* -* testprogram. -*/ +/* + * Project: libFIRM + * File name: testprograms/memory_example.c + * Purpose: Illustrate memory edges. + * Author: Christian Schaefer, Goetz Lindenmaier + * Modified by: + * Created: + * CVS-ID: $Id$ + * Copyright: (c) 1999-2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ # include @@ -83,12 +87,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));