X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=testprograms%2Fglobal_var_example.c;h=d149a1494e87c4971b25b5a0df2db3075dcdd061;hb=191ffc9153ebeb4a57a8bfa0c0d124081738f939;hp=15d208d3e84f95b357f5032078bb755409fc970e;hpb=328ae18da3e796f4f9fda2aba629cc34e2849ed7;p=libfirm diff --git a/testprograms/global_var_example.c b/testprograms/global_var_example.c index 15d208d3e..d149a1494 100644 --- a/testprograms/global_var_example.c +++ b/testprograms/global_var_example.c @@ -1,14 +1,16 @@ /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe -** All rights reserved. -** -** Authors: Goetz Lindenmaier -** -** testprogram. -** +* All rights reserved. +* +* Authors: Goetz Lindenmaier +* +* testprogram. +* */ -#include +# include +# include +# include "irvrfy.h" # include "irdump.h" # include "firm.h" @@ -17,15 +19,15 @@ */ /** -*** This program shows how to build ir for global variables. -*** It constructs the ir for the following pseudo-program: -*** -*** int i; -*** -*** main() { -*** i = 2; -*** return; -*** } +* This program shows how to build ir for global variables. +* It constructs the ir for the following pseudo-program: +* +* int i; +* +* main() { +* i = 2; +* return; +* } **/ int main(int argc, char **argv) @@ -48,14 +50,14 @@ int main(int argc, char **argv) This is the modeling appropriate for other languages. Mode_i says that all integers shall be implemented as a 32 bit integer value. */ - prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_i); + prim_t_int = new_type_primitive(id_from_str ("int", 3), mode_Is); /* FIRM was designed for oo languages where all methods belong to a class. * For imperative languages like C we view a file or compilation unit as * 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 @@ -88,7 +90,7 @@ int main(int argc, char **argv) i_ptr = new_simpleSel(get_store(), get_irg_globals(irg), i_ent); store = new_Store (get_store(), i_ptr, - new_Const(mode_i, tarval_from_long (mode_i, 2))); + new_Const(mode_Is, tarval_from_long (mode_Is, 2))); set_store(new_Proj(store, mode_M, 0)); {