From 5c27107154d63252e27639ebb34e98022f9b3358 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6tz=20Lindenmaier?= Date: Fri, 5 Jul 2002 09:48:45 +0000 Subject: [PATCH] Code review to compile with -ansi [r432] --- acconfig.h | 3 + config.h.in | 3 + configure | 125 ++-- configure.in | 8 + ir/adt/pdeq.c | 13 +- ir/adt/set.c | 17 +- ir/ana/cgana.c | 11 +- ir/ana/irdom.c | 21 +- ir/ana/irouts.c | 15 +- ir/ana/irouts.h | 6 +- ir/common/common.h | 6 + ir/common/common_t.h | 3 +- ir/common/xoprintf.c | 2 + ir/debug/dbginfo.c | 8 +- ir/debug/dbginfo.h | 5 +- ir/ident/ident.c | 6 +- ir/ident/ident.h | 7 +- ir/ir/ircgcons.c | 8 +- ir/ir/ircons.c | 269 ++++----- ir/ir/ircons.h | 2 +- ir/ir/irdump.c | 10 +- ir/ir/irflag.c | 35 +- ir/ir/irflag.h | 12 +- ir/ir/irgmod.c | 2 +- ir/ir/irgmod.h | 2 +- ir/ir/irgopt.c | 12 +- ir/ir/irgraph.c | 2 +- ir/ir/irgraph_t.h | 2 +- ir/ir/irmode.c | 20 +- ir/ir/irnode.c | 941 ++++++++++++++++--------------- ir/ir/irnode.h | 522 ++++++++--------- ir/ir/irnode_t.h | 10 +- ir/ir/iropt.c | 14 +- ir/ir/irprog.c | 2 +- ir/ir/irvrfy.c | 249 ++++---- ir/st/exc.c | 28 +- ir/st/exc.h | 12 +- ir/st/st.c | 85 +-- ir/st/st.h | 20 +- ir/tr/entity.c | 83 ++- ir/tr/entity.h | 2 +- ir/tr/type.c | 26 +- ir/tr/type.h | 4 +- ir/tr/type_t.h | 18 +- ir/tr/typegmod.c | 4 +- ir/tr/typegmod.h | 4 +- ir/tv/tv.c | 13 +- testprograms/oo_inline_example.c | 2 +- 48 files changed, 1370 insertions(+), 1304 deletions(-) diff --git a/acconfig.h b/acconfig.h index 31620d304..f5026c292 100644 --- a/acconfig.h +++ b/acconfig.h @@ -9,3 +9,6 @@ /* Define to disable assertion checking. */ #undef NDEBUG + +/* Define to value "inline" for gcc inlineing. */ +#undef USE_GCC_INLINE diff --git a/config.h.in b/config.h.in index 79c27b2f7..33854b8f6 100644 --- a/config.h.in +++ b/config.h.in @@ -9,6 +9,9 @@ /* Define to disable assertion checking. */ #undef NDEBUG +/* Define to value "inline" for gcc inlineing. */ +#undef USE_GCC_INLINE + /* Define if you have the header file. */ #undef HAVE_GMP_H diff --git a/configure b/configure index 5fce3ef17..627f9e727 100755 --- a/configure +++ b/configure @@ -25,6 +25,8 @@ ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --enable-debug enable assertions and additional debugging routines" +ac_help="$ac_help + --enable-gcc_inline enable gcc inline C-extension" ac_help="$ac_help --enable-profile enable profiling" ac_help="$ac_help @@ -589,6 +591,20 @@ fi +# Check whether --enable-use_gcc_inline or --disable-use_gcc_inline was given. +if test "${enable_use_gcc_inline+set}" = set; then + enableval="$enable_use_gcc_inline" + if test "$enableval" = yes; then + cat >> confdefs.h <<\EOF +#define USE_GCC_INLINE 1 +EOF + +fi +fi + + + + # Check whether --enable-profile or --disable-profile was given. if test "${enable_profile+set}" = set; then enableval="$enable_profile" @@ -618,7 +634,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:622: checking for $ac_word" >&5 +echo "configure:638: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -648,7 +664,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:652: checking for $ac_word" >&5 +echo "configure:668: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -699,7 +715,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:703: checking for $ac_word" >&5 +echo "configure:719: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -731,7 +747,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:735: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:751: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -742,12 +758,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 746 "configure" +#line 762 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -773,12 +789,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:777: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:793: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:782: checking whether we are using GNU C" >&5 +echo "configure:798: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -787,7 +803,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -806,7 +822,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:810: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:826: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -845,7 +861,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:849: checking host system type" >&5 +echo "configure:865: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -866,7 +882,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:870: checking build system type" >&5 +echo "configure:886: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -893,7 +909,7 @@ if test -z "$LD" && test "$GCC" = yes; then # Extract the first word of "${ac_tool_prefix}gld", so it can be a program name with args. set dummy ${ac_tool_prefix}gld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:897: checking for $ac_word" >&5 +echo "configure:913: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -925,7 +941,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "gld", so it can be a program name with args. set dummy gld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:929: checking for $ac_word" >&5 +echo "configure:945: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -962,7 +978,7 @@ if test -z "$LD"; then # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. set dummy ${ac_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:966: checking for $ac_word" >&5 +echo "configure:982: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -994,7 +1010,7 @@ fi fi echo $ac_n "checking whether $LD accepts -r""... $ac_c" 1>&6 -echo "configure:998: checking whether $LD accepts -r" >&5 +echo "configure:1014: checking whether $LD accepts -r" >&5 if eval "test \"`echo '$''{'libfirm_cv_prog_ld_r'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1028,7 +1044,7 @@ fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1032: checking for $ac_word" >&5 +echo "configure:1048: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1062,7 +1078,7 @@ fi # Extract the first word of "tar", so it can be a program name with args. set dummy tar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1066: checking for $ac_word" >&5 +echo "configure:1082: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1097,7 +1113,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1101: checking for $ac_word" >&5 +echo "configure:1117: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1137,7 +1153,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1141: checking for a BSD compatible install" >&5 +echo "configure:1157: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1191,7 +1207,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1195: checking whether ln -s works" >&5 +echo "configure:1211: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1216,7 +1232,7 @@ if test "$enable_auto_documentation" = yes; then # Extract the first word of "robodoc", so it can be a program name with args. set dummy robodoc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1220: checking for $ac_word" >&5 +echo "configure:1236: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ROBODOC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1250,7 +1266,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1254: checking how to run the C preprocessor" >&5 +echo "configure:1270: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1265,13 +1281,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1282,13 +1298,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1299,13 +1315,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1330,12 +1346,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1334: checking for ANSI C header files" >&5 +echo "configure:1350: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1343,7 +1359,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1363: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1360,7 +1376,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1378,7 +1394,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1399,7 +1415,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1410,7 +1426,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1439,17 +1455,17 @@ for ac_hdr in math.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1443: checking for $ac_hdr" >&5 +echo "configure:1459: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1453: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1486,17 +1502,17 @@ for ac_hdr in gmp.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1490: checking for $ac_hdr" >&5 +echo "configure:1506: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1516: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1533,17 +1549,17 @@ for ac_hdr in obstack.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1537: checking for $ac_hdr" >&5 +echo "configure:1553: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1578,7 +1594,7 @@ fi echo $ac_n "checking for main in -lgmp""... $ac_c" 1>&6 -echo "configure:1582: checking for main in -lgmp" >&5 +echo "configure:1598: checking for main in -lgmp" >&5 ac_lib_var=`echo gmp'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1586,14 +1602,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lgmp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1620,7 +1636,7 @@ fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:1624: checking for main in -lm" >&5 +echo "configure:1640: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1628,14 +1644,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1666,12 +1682,12 @@ fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:1670: checking for strerror" >&5 +echo "configure:1686: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else @@ -1854,6 +1870,7 @@ s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@libfirm_conf_env@%$libfirm_conf_env%g s%@enable_debug_libfirm@%$enable_debug_libfirm%g +s%@enable_gcc_inline@%$enable_gcc_inline%g s%@enable_profile_libfirm@%$enable_profile_libfirm%g s%@enable_auto_documentation@%$enable_auto_documentation%g s%@CC@%$CC%g diff --git a/configure.in b/configure.in index 0ed63b23d..4aef11fb9 100644 --- a/configure.in +++ b/configure.in @@ -37,6 +37,14 @@ fi]) AC_SUBST(enable_debug_libfirm) +AC_ARG_ENABLE(use_gcc_inline, +[ --enable-gcc_inline enable gcc inline C-extension], +[if test "$enableval" = yes; then + AC_DEFINE(USE_GCC_INLINE) +fi]) +AC_SUBST(enable_gcc_inline) + + dnl set profiling dnl ------------- AC_ARG_ENABLE(profile, diff --git a/ir/adt/pdeq.c b/ir/adt/pdeq.c index 2eb2f6dff..7428d6ec7 100644 --- a/ir/adt/pdeq.c +++ b/ir/adt/pdeq.c @@ -19,6 +19,15 @@ #include "malloc.h" #include "pdeq.h" + +#ifndef INLINE +#ifdef USE_GCC_INLINE +#define INLINE inline +#else +#define INLINE +#endif +#endif + /* # of data items in block */ #define NDATA ((int)((PREF_MALLOC_SIZE - offsetof (pdeq, data)) / sizeof (void *))) @@ -47,7 +56,7 @@ pdeq *pdeq_block_cache[TUNE_NSAVED_PDEQS+1]; unsigned pdeqs_cached; /* # pdeqs in pdeq_store */ -static inline void +static INLINE void free_pdeq_block (pdeq *p) { #ifndef NDEBUG @@ -63,7 +72,7 @@ free_pdeq_block (pdeq *p) } -static inline pdeq * +static INLINE pdeq * alloc_pdeq_block (void) { pdeq *p; diff --git a/ir/adt/set.c b/ir/adt/set.c index cf5e7f272..d1a2d0074 100644 --- a/ir/adt/set.c +++ b/ir/adt/set.c @@ -27,6 +27,15 @@ # include #endif +#ifdef USE_GCC_INLINE +#define INLINE inline +#else +#define INLINE +#endif + +/* bcopy is not ISO C */ +#define bcopy(X, Y, Z) memcpy((Y), (X), (Z)) + #ifdef PSET # define SET pset # define PMANGLE(pre) pre##_pset @@ -107,7 +116,7 @@ MANGLEP(stats) (SET *table) table->naccess, table->ncollision, table->nkey, table->ndups, table->max_chain_len, nfree); } -static inline void +static INLINE void stat_chain_len (SET *table, int chain_len) { table->ncollision += chain_len; @@ -209,7 +218,7 @@ PMANGLE(del) (SET *table) } -static inline int +static INLINE int iter_step (SET *table) { if (++table->iter_j >= SEGMENT_SIZE) { @@ -261,7 +270,7 @@ MANGLEP(break) (SET *table) } -static inline unsigned +static INLINE unsigned Hash (SET *table, unsigned h) { unsigned address; @@ -273,7 +282,7 @@ Hash (SET *table, unsigned h) } -static inline int +static INLINE int loaded (SET *table) { return ( ++table->nkey diff --git a/ir/ana/cgana.c b/ir/ana/cgana.c index 34fc09563..e3e82075b 100644 --- a/ir/ana/cgana.c +++ b/ir/ana/cgana.c @@ -86,8 +86,8 @@ void collect_impls(entity *method, eset *set, int *size, bool *open) { if (!eset_contains(set, method)) { eset_insert(set, method); ++(*size); - //printf("Adding existent method %d ", *size); DDME(method); - //printf(" with owner "); DDMT(get_entity_owner(method)); + /* printf("Adding existent method %d ", *size); DDME(method); + printf(" with owner "); DDMT(get_entity_owner(method)); */ } } } @@ -102,8 +102,8 @@ void collect_impls(entity *method, eset *set, int *size, bool *open) { if (!eset_contains(set, impl_ent)) { eset_insert(set, impl_ent); ++(*size); - // printf("Adding inherited method %d ", *size); DDME(impl_ent); - //printf(" with owner "); DDMT(get_entity_owner(impl_ent)); + /* printf("Adding inherited method %d ", *size); DDME(impl_ent); + printf(" with owner "); DDMT(get_entity_owner(impl_ent)); */ } } } @@ -129,9 +129,6 @@ static entity ** get_impl_methods(entity * method) { /** Collect all method entities that can be called here **/ collect_impls(method, set, &size, &open); - - //printf("Size is %d \n\n", size); - /** Gefunden Entitaeten in ein Feld kopieren, ev. Unbekannten Vorgaenger einfuegen. **/ if (size == 0 && !open) { diff --git a/ir/ana/irdom.c b/ir/ana/irdom.c index ff524abc0..7fc31fee6 100644 --- a/ir/ana/irdom.c +++ b/ir/ana/irdom.c @@ -118,8 +118,6 @@ void init_tmp_dom_info(ir_node *bl, tmp_dom_info *parent, mark_Block_block_visited(bl); set_Block_pre_num(bl, *used); - //printf(" used: %d ", *used); DDMN(bl); - tdi = &tdi_list[*used]; ++(*used); @@ -154,7 +152,7 @@ dom_compress (tmp_dom_info *v) /* if V is a root, return v, else return the vertex u, not being the root, with minimum u->semi on the path from v to its root. */ -inline static tmp_dom_info* +INLINE static tmp_dom_info* dom_eval (tmp_dom_info *v) { if (!v->ancestor) return v; @@ -163,7 +161,7 @@ dom_eval (tmp_dom_info *v) } /* make V W's ancestor */ -inline static void +INLINE static void dom_link (tmp_dom_info *v, tmp_dom_info *w) { w->ancestor = v; @@ -187,8 +185,6 @@ void compute_doms(ir_graph *irg) { n_blocks = 0; irg_block_walk(get_irg_end(current_ir_graph), count_and_init_blocks, NULL, &n_blocks); - //printf("n_blocks is %d\n", n_blocks); - /* Memory for temporary information. */ tdi_list = (tmp_dom_info *) calloc(n_blocks, sizeof(tmp_dom_info)); @@ -203,25 +199,22 @@ void compute_doms(ir_graph *irg) { inc_irg_block_visited(current_ir_graph); init_tmp_dom_info(get_irg_start_block(current_ir_graph), NULL, tdi_list, &used); /* If not all blocks are reachable from Start by out edges this assertion - fails. */ - //assert(used == n_blocks && "Precondition for dom construction violated"); + fails. + assert(used == n_blocks && "Precondition for dom construction violated"); */ n_blocks = used; - //printf("used is %d\n", used); - for (i = n_blocks-1; i > 0; i--) { /* Don't iterate the root, it's done. */ tmp_dom_info *w = &tdi_list[i]; tmp_dom_info *v; - //printf(" cfgpreds: %d ", get_Block_n_cfgpreds(w->block)); DDMN(w->block); - /* Step 2 */ for (j = 0; j < get_irn_arity(w->block); j++) { ir_node *pred = get_nodes_Block(get_Block_cfgpred(w->block, j)); tmp_dom_info *u; - if ((is_Bad(get_Block_cfgpred(w->block, j))) || (get_Block_pre_num (pred) == -1)) + if ((is_Bad(get_Block_cfgpred(w->block, j))) || + (get_Block_pre_num (pred) == -1)) continue; /* control-dead */ u = dom_eval (&tdi_list[get_Block_pre_num(pred)]); @@ -262,7 +255,7 @@ void compute_doms(ir_graph *irg) { } /* clean up */ - // free(tdi_list); + /* free(tdi_list); @@@ doew not work !!?? */ current_ir_graph = rem; } diff --git a/ir/ana/irouts.c b/ir/ana/irouts.c index 087bae208..05dd0ba5f 100644 --- a/ir/ana/irouts.c +++ b/ir/ana/irouts.c @@ -20,25 +20,25 @@ /**********************************************************************/ /* returns the number of successors of the node: */ -inline int get_irn_n_outs (ir_node *node) { +INLINE int get_irn_n_outs (ir_node *node) { return (int)(node->out[0]); } /* Access successor n */ -inline ir_node *get_irn_out (ir_node *node, int pos) { +INLINE ir_node *get_irn_out (ir_node *node, int pos) { assert(node); assert(pos >= 0 && pos < get_irn_n_outs(node)); return node->out[pos+1]; } -inline void set_irn_out (ir_node *node, int pos, ir_node *out) { +INLINE void set_irn_out (ir_node *node, int pos, ir_node *out) { assert(node && out); assert(pos >= 0 && pos < get_irn_n_outs(node)); node->out[pos+1] = out; } -inline int get_Block_n_cfg_outs (ir_node *bl) { +INLINE int get_Block_n_cfg_outs (ir_node *bl) { int i, n_cfg_outs = 0; assert(bl && (get_irn_op(bl) == op_Block)); for (i = 0; i < (int)bl->out[0]; i++) @@ -48,7 +48,7 @@ inline int get_Block_n_cfg_outs (ir_node *bl) { } -inline ir_node *get_Block_cfg_out (ir_node *bl, int pos) { +INLINE ir_node *get_Block_cfg_out (ir_node *bl, int pos) { int i, out_pos = 0; assert(bl && (get_irn_op(bl) == op_Block)); for (i = 0; i < (int)bl->out[0]; i++) @@ -69,8 +69,6 @@ void irg_out_walk_2(ir_node *node, void (pre)(ir_node*, void*), int i; ir_node *succ; - //printf("++ in walker (%d outs) ", get_irn_n_outs(node)); DDMSG2(node); - assert(node); assert(get_irn_visited(node) < get_irg_visited(current_ir_graph)); @@ -86,7 +84,6 @@ void irg_out_walk_2(ir_node *node, void (pre)(ir_node*, void*), if (post) post(node, env); - //printf("++ done walking "); DDMSG2(node); return; } @@ -217,7 +214,7 @@ ir_node **set_out_edges(ir_node *n, ir_node **free) { return free; } -inline void fix_start_proj(ir_graph *irg) { +INLINE void fix_start_proj(ir_graph *irg) { ir_node *proj = NULL, *startbl; int i; if (get_Block_n_cfg_outs(get_irg_start_block(irg))) { diff --git a/ir/ana/irouts.h b/ir/ana/irouts.h index e1f648d35..96685087f 100644 --- a/ir/ana/irouts.h +++ b/ir/ana/irouts.h @@ -28,14 +28,14 @@ /* returns the number of successors of the node: */ int get_irn_n_outs (ir_node *node); /* Access predecessor n */ -inline ir_node *get_irn_out (ir_node *node, int pos); -inline void set_irn_out (ir_node *node, int pos, ir_node *out); +INLINE ir_node *get_irn_out (ir_node *node, int pos); +INLINE void set_irn_out (ir_node *node, int pos, ir_node *out); /* Methods to iterate through the control flow graph. Iterate from 0 to i < get_Block_cfg_outs(block). No order of successors guaranteed. */ int get_Block_n_cfg_outs (ir_node *node); /* Access predecessor n. */ -inline ir_node *get_Block_cfg_out (ir_node *node, int pos); +INLINE ir_node *get_Block_cfg_out (ir_node *node, int pos); /* Walks over the graph starting at node. Walks also if graph is in state diff --git a/ir/common/common.h b/ir/common/common.h index 5af6fce32..13e7f7115 100644 --- a/ir/common/common.h +++ b/ir/common/common.h @@ -12,7 +12,13 @@ # ifndef _COMMON_H_ # define _COMMON_H_ +#ifndef INLINE +#ifdef USE_GCC_INLINE #define INLINE inline +#else +#define INLINE +#endif +#endif /* a list of firm kinds */ typedef enum { diff --git a/ir/common/common_t.h b/ir/common/common_t.h index 6051f88c4..cf975eb9e 100644 --- a/ir/common/common_t.h +++ b/ir/common/common_t.h @@ -20,7 +20,6 @@ operation is executed. Else it uses the values valid at the end of the block with the fragile operation. */ #define PRECISE_EXC_CONTEXT 1 -// #define PRECISE_EXC_CONTEXT 0 /* There are two implementations of the Phi node construction. The first is faster, but does not work for blocks with more than 2 predecessors. @@ -33,7 +32,7 @@ If the following flag is set, new_r_Phi_in uses an explicit stack for allocating and deallocating Phi nodes. Else it uses the obstack as a stack! */ -#define USE_EXPLICIT_PHI_IN_STACK 1 +#define USE_EXPLICIT_PHI_IN_STACK 0 /* * If this is defined debuging aids are created, e.g. a field in diff --git a/ir/common/xoprintf.c b/ir/common/xoprintf.c index e473653de..cefd4242d 100644 --- a/ir/common/xoprintf.c +++ b/ir/common/xoprintf.c @@ -14,6 +14,8 @@ #include #include "xprintf.h" +/* bcopy is not ISO C */ +#define bcopy(X, Y, Z) memcpy((Y), (X), (Z)) static int xoprinter (void *obst, const char *data, size_t len) diff --git a/ir/debug/dbginfo.c b/ir/debug/dbginfo.c index ab6a2140f..cc6975969 100644 --- a/ir/debug/dbginfo.c +++ b/ir/debug/dbginfo.c @@ -21,12 +21,12 @@ #include "irnode_t.h" -inline void +INLINE void dbg_info_merge_pair(ir_node *nw, ir_node *old, dbg_action info) { set_irn_dbg_info(nw, get_irn_dbg_info(old)); } -inline void +INLINE void dbg_info_merge_sets(ir_node **new_nodes, int n_new_nodes, ir_node **old_nodes, int n_old_nodes, dbg_action info) { @@ -52,12 +52,12 @@ void dbg_init( void (merge_pair)(ir_node *nw, ir_node *old, dbg_action info) , } -inline void +INLINE void set_irn_dbg_info(ir_node *n, struct dbg_info* db) { n->dbi = db; } -inline struct dbg_info * +INLINE struct dbg_info * get_irn_dbg_info(ir_node *n) { return n->dbi; } diff --git a/ir/debug/dbginfo.h b/ir/debug/dbginfo.h index 6164a07c0..96b3a3234 100644 --- a/ir/debug/dbginfo.h +++ b/ir/debug/dbginfo.h @@ -42,8 +42,8 @@ typedef struct ir_node ir_node; typedef struct dbg_info dbg_info; /* Routines to access the field of an ir node containing the debugging information. */ -inline void set_irn_dbg_info(ir_node *n, dbg_info* db); -inline dbg_info *get_irn_dbg_info(ir_node *n); +INLINE void set_irn_dbg_info(ir_node *n, dbg_info* db); +INLINE dbg_info *get_irn_dbg_info(ir_node *n); /*****/ /****s* dbginfo/dbg_action @@ -93,7 +93,6 @@ static const char* dbg_action_2_str(dbg_action a) { return "dbg_algebraic_simplification"; break; case dbg_write_after_write: return "dbg_write_after_write"; break; case dbg_write_after_read: return "dbg_write_after_read"; break; -//case dbg_: return "dbg_"; break; default: if (a <= dbg_max) return "string conversion not implemented"; diff --git a/ir/ident/ident.c b/ir/ident/ident.c index 071b3a3f2..17ba8ac68 100644 --- a/ir/ident/ident.c +++ b/ir/ident/ident.c @@ -98,7 +98,7 @@ id_init (void) #if 1 -inline ident *id_from_str (const char *str, int len) { +INLINE ident *id_from_str (const char *str, int len) { assert (len > 0); return (const set_entry *) set_hinsert (id_set, (str), @@ -106,11 +106,11 @@ inline ident *id_from_str (const char *str, int len) { ID_HASH ((str), (len))); } -inline const char *id_to_str (ident *id) { +INLINE const char *id_to_str (ident *id) { return ((const char *)&(id)->dptr[0]); } -inline int id_to_strlen(ident *id) { +INLINE int id_to_strlen(ident *id) { return ((id)->size); } #endif diff --git a/ir/ident/ident.h b/ir/ident/ident.h index cf13d2f8a..9f4efee79 100644 --- a/ir/ident/ident.h +++ b/ir/ident/ident.h @@ -13,6 +13,7 @@ # define _IDENT_H_ # include "assert.h" +# include "common.h" /****h* libfirm/ident * @@ -52,7 +53,7 @@ typedef const struct set_entry ident; * id_to_str, id_to_strlen *** */ -inline ident *id_from_str (const char *str, int len); +INLINE ident *id_from_str (const char *str, int len); /****f* ident/id_to_str * @@ -71,7 +72,7 @@ inline ident *id_from_str (const char *str, int len); * id_from_str, id_to_strlen *** */ -inline const char *id_to_str (ident *id); +INLINE const char *id_to_str (ident *id); /****f* ident/id_to_strlen * @@ -89,7 +90,7 @@ inline const char *id_to_str (ident *id); * id_from_str, id_to_str *** */ -inline int id_to_strlen(ident *id); +INLINE int id_to_strlen(ident *id); /****f* ident/id_is_suffix * diff --git a/ir/ir/ircgcons.c b/ir/ir/ircgcons.c index 1df14228a..af162c27c 100644 --- a/ir/ir/ircgcons.c +++ b/ir/ir/ircgcons.c @@ -66,17 +66,17 @@ static void caller_init(int arr_length, entity ** free_methods) { } -static void clear_link(ir_node * node, void * env) { +static INLINE void clear_link(ir_node * node, void * env) { set_irn_link(node, NULL); } - -static inline ir_node * tail(ir_node * node) { +/* +static INLINE ir_node * tail(ir_node * node) { ir_node * link; for (; (link = get_irn_link(node)); node = link) ; return node; } - +*/ /* Call-Operationen an die "link"-Liste von "call_tail" anhängen (und * "call_tail" aktualisieren), Proj-Operationen in die Liste ihrer Definition diff --git a/ir/ir/ircons.c b/ir/ir/ircons.c index 987b76485..33c63c88d 100644 --- a/ir/ir/ircons.c +++ b/ir/ir/ircons.c @@ -46,7 +46,7 @@ typedef struct Phi_in_stack Phi_in_stack; /* Constructs a Block with a fixed number of predecessors. Does not set current_block. Can not be used with automatic Phi node construction. */ -inline ir_node * +INLINE ir_node * new_rd_Block (dbg_info* db, ir_graph *irg, int arity, ir_node **in) { ir_node *res; @@ -63,7 +63,7 @@ new_rd_Block (dbg_info* db, ir_graph *irg, int arity, ir_node **in) return res; } -ir_node * +INLINE ir_node * new_rd_Start (dbg_info* db, ir_graph *irg, ir_node *block) { ir_node *res; @@ -74,7 +74,7 @@ new_rd_Start (dbg_info* db, ir_graph *irg, ir_node *block) return res; } -ir_node * +INLINE ir_node * new_rd_End (dbg_info* db, ir_graph *irg, ir_node *block) { ir_node *res; @@ -87,7 +87,7 @@ new_rd_End (dbg_info* db, ir_graph *irg, ir_node *block) /* Creates a Phi node with all predecessors. Calling this constructor is only allowed if the corresponding block is mature. */ -ir_node * +INLINE ir_node * new_rd_Phi (dbg_info* db, ir_graph *irg, ir_node *block, int arity, ir_node **in, ir_mode *mode) { ir_node *res; @@ -107,7 +107,7 @@ new_rd_Phi (dbg_info* db, ir_graph *irg, ir_node *block, int arity, ir_node **in return res; } -ir_node * +INLINE ir_node * new_rd_Const (dbg_info* db, ir_graph *irg, ir_node *block, ir_mode *mode, tarval *con) { ir_node *res; @@ -123,7 +123,7 @@ new_rd_Const (dbg_info* db, ir_graph *irg, ir_node *block, ir_mode *mode, tarval return res; } -ir_node * +INLINE ir_node * new_rd_Id (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *val, ir_mode *mode) { ir_node *in[1] = {val}; @@ -134,7 +134,7 @@ new_rd_Id (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *val, ir_mode *m return res; } -ir_node * +INLINE ir_node * new_rd_Proj (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *arg, ir_mode *mode, long proj) { @@ -154,7 +154,7 @@ new_rd_Proj (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *arg, ir_mode } -ir_node * +INLINE ir_node * new_rd_defaultProj (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *arg, long max_proj) { @@ -166,7 +166,7 @@ new_rd_defaultProj (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *arg, return res; } -ir_node * +INLINE ir_node * new_rd_Conv (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op, ir_mode *mode) { ir_node *in[1] = {op}; @@ -178,7 +178,7 @@ new_rd_Conv (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op, ir_mode * } -ir_node * +INLINE ir_node * new_rd_Tuple (dbg_info* db, ir_graph *irg, ir_node *block, int arity, ir_node **in) { ir_node *res; @@ -189,7 +189,7 @@ new_rd_Tuple (dbg_info* db, ir_graph *irg, ir_node *block, int arity, ir_node ** return res; } -inline ir_node * +INLINE ir_node * new_rd_Add (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { @@ -201,7 +201,7 @@ new_rd_Add (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Sub (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { @@ -213,7 +213,7 @@ new_rd_Sub (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Minus (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op, ir_mode *mode) { @@ -225,7 +225,7 @@ new_rd_Minus (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Mul (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { @@ -237,7 +237,7 @@ new_rd_Mul (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Quot (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2) { @@ -249,7 +249,7 @@ new_rd_Quot (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_DivMod (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2) { @@ -261,7 +261,7 @@ new_rd_DivMod (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Div (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2) { @@ -273,7 +273,7 @@ new_rd_Div (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Mod (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2) { @@ -285,7 +285,7 @@ new_rd_Mod (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_And (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { @@ -297,7 +297,7 @@ new_rd_And (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Or (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { @@ -309,7 +309,7 @@ new_rd_Or (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Eor (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { @@ -321,7 +321,7 @@ new_rd_Eor (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Not (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op, ir_mode *mode) { @@ -333,7 +333,7 @@ new_rd_Not (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Shl (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op, ir_node *k, ir_mode *mode) { @@ -345,7 +345,7 @@ new_rd_Shl (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Shr (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op, ir_node *k, ir_mode *mode) { @@ -357,7 +357,7 @@ new_rd_Shr (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Shrs (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op, ir_node *k, ir_mode *mode) { @@ -369,7 +369,7 @@ new_rd_Shrs (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Rot (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op, ir_node *k, ir_mode *mode) { @@ -381,7 +381,7 @@ new_rd_Rot (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Abs (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op, ir_mode *mode) { @@ -393,7 +393,7 @@ new_rd_Abs (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Cmp (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2) { @@ -405,7 +405,7 @@ new_rd_Cmp (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Jmp (dbg_info* db, ir_graph *irg, ir_node *block) { ir_node *in[0] = {}; @@ -416,7 +416,7 @@ new_rd_Jmp (dbg_info* db, ir_graph *irg, ir_node *block) return res; } -inline ir_node * +INLINE ir_node * new_rd_Cond (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *c) { ir_node *in[1] = {c}; @@ -471,7 +471,7 @@ new_rd_Return (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Raise (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, ir_node *obj) { ir_node *in[2] = {store, obj}; @@ -482,7 +482,7 @@ new_rd_Raise (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, ir_no return res; } -inline ir_node * +INLINE ir_node * new_rd_Load (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, ir_node *adr) { @@ -495,7 +495,7 @@ new_rd_Load (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Store (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, ir_node *adr, ir_node *val) { @@ -509,7 +509,7 @@ new_rd_Store (dbg_info* db, ir_graph *irg, ir_node *block, return res; } -inline ir_node * +INLINE ir_node * new_rd_Alloc (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, ir_node *size, type *alloc_type, where_alloc where) { @@ -525,7 +525,7 @@ new_rd_Alloc (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, return res; } -inline ir_node * +INLINE ir_node * new_rd_Free (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, ir_node *ptr, ir_node *size, type *free_type) { @@ -540,7 +540,7 @@ new_rd_Free (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, return res; } -inline ir_node * +ir_node * new_rd_Sel (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, ir_node *objptr, int arity, ir_node **in, entity *ent) { @@ -549,7 +549,7 @@ new_rd_Sel (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, ir_node int r_arity; r_arity = arity + 2; - NEW_ARR_A (ir_node *, r_in, r_arity); + NEW_ARR_A (ir_node *, r_in, r_arity); /* uses alloca */ r_in[0] = store; r_in[1] = objptr; memcpy (&r_in[2], in, sizeof (ir_node *) * arity); @@ -564,7 +564,8 @@ new_rd_Sel (dbg_info* db, ir_graph *irg, ir_node *block, ir_node *store, ir_node } ir_node * -new_rd_InstOf (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store, ir_node *objptr, type *ent) +new_rd_InstOf (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store, + ir_node *objptr, type *ent) { ir_node **r_in; ir_node *res; @@ -579,12 +580,12 @@ new_rd_InstOf (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *store, ir_n res->attr.io.ent = ent; - // res = optimize (res); - // irn_vrfy (res); + /* res = optimize (res); + ** irn_vrfy (res); */ return (res); } -inline ir_node * +INLINE ir_node * new_rd_SymConst (dbg_info* db, ir_graph *irg, ir_node *block, type_or_id_p value, symconst_kind symkind) { @@ -611,7 +612,7 @@ new_rd_SymConst (dbg_info* db, ir_graph *irg, ir_node *block, type_or_id_p value return res; } -ir_node * +INLINE ir_node * new_rd_Sync (dbg_info* db, ir_graph *irg, ir_node *block, int arity, ir_node **in) { ir_node *res; @@ -623,19 +624,19 @@ new_rd_Sync (dbg_info* db, ir_graph *irg, ir_node *block, int arity, ir_node **i return res; } -ir_node * +INLINE ir_node * new_rd_Bad () { return current_ir_graph->bad; } -ir_node * +INLINE ir_node * new_rd_Unknown () { return current_ir_graph->unknown; } -ir_node * +INLINE ir_node * new_rd_CallBegin (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *call) { ir_node *in[1] = { get_Call_ptr(call) }; @@ -648,7 +649,7 @@ new_rd_CallBegin (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *call) return res; } -ir_node * +INLINE ir_node * new_rd_EndReg (dbg_info *db, ir_graph *irg, ir_node *block) { ir_node *res; @@ -660,7 +661,7 @@ new_rd_EndReg (dbg_info *db, ir_graph *irg, ir_node *block) return res; } -ir_node * +INLINE ir_node * new_rd_EndExcept (dbg_info *db, ir_graph *irg, ir_node *block) { ir_node *res; @@ -672,7 +673,7 @@ new_rd_EndExcept (dbg_info *db, ir_graph *irg, ir_node *block) return res; } -inline ir_node * +INLINE ir_node * new_rd_Break (dbg_info *db, ir_graph *irg, ir_node *block) { ir_node *in[0] = {}; @@ -683,7 +684,7 @@ new_rd_Break (dbg_info *db, ir_graph *irg, ir_node *block) return res; } -ir_node * +INLINE ir_node * new_rd_Filter (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg, ir_mode *mode, long proj) { @@ -704,185 +705,185 @@ new_rd_Filter (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg, ir_mod } -ir_node *new_r_Block (ir_graph *irg, int arity, ir_node **in) { +INLINE ir_node *new_r_Block (ir_graph *irg, int arity, ir_node **in) { return new_rd_Block(NULL, irg, arity, in); } -ir_node *new_r_Start (ir_graph *irg, ir_node *block) { +INLINE ir_node *new_r_Start (ir_graph *irg, ir_node *block) { return new_rd_Start(NULL, irg, block); } -ir_node *new_r_End (ir_graph *irg, ir_node *block) { +INLINE ir_node *new_r_End (ir_graph *irg, ir_node *block) { return new_rd_End(NULL, irg, block); } -ir_node *new_r_Jmp (ir_graph *irg, ir_node *block) { +INLINE ir_node *new_r_Jmp (ir_graph *irg, ir_node *block) { return new_rd_Jmp(NULL, irg, block); } -ir_node *new_r_Cond (ir_graph *irg, ir_node *block, ir_node *c) { +INLINE ir_node *new_r_Cond (ir_graph *irg, ir_node *block, ir_node *c) { return new_rd_Cond(NULL, irg, block, c); } -ir_node *new_r_Return (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Return (ir_graph *irg, ir_node *block, ir_node *store, int arity, ir_node **in) { return new_rd_Return(NULL, irg, block, store, arity, in); } -ir_node *new_r_Raise (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Raise (ir_graph *irg, ir_node *block, ir_node *store, ir_node *obj) { return new_rd_Raise(NULL, irg, block, store, obj); } -ir_node *new_r_Const (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Const (ir_graph *irg, ir_node *block, ir_mode *mode, tarval *con) { return new_rd_Const(NULL, irg, block, mode, con); } -ir_node *new_r_SymConst (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_SymConst (ir_graph *irg, ir_node *block, type_or_id_p value, symconst_kind symkind) { return new_rd_SymConst(NULL, irg, block, value, symkind); } -ir_node *new_r_Sel (ir_graph *irg, ir_node *block, ir_node *store, +INLINE ir_node *new_r_Sel (ir_graph *irg, ir_node *block, ir_node *store, ir_node *objptr, int n_index, ir_node **index, entity *ent) { return new_rd_Sel(NULL, irg, block, store, objptr, n_index, index, ent); } -ir_node *new_r_InstOf (ir_graph *irg, ir_node *block, ir_node *store, ir_node *objptr, +INLINE ir_node *new_r_InstOf (ir_graph *irg, ir_node *block, ir_node *store, ir_node *objptr, type *ent) { return (new_rd_InstOf (NULL, irg, block, store, objptr, ent)); } -ir_node *new_r_Call (ir_graph *irg, ir_node *block, ir_node *store, +INLINE ir_node *new_r_Call (ir_graph *irg, ir_node *block, ir_node *store, ir_node *callee, int arity, ir_node **in, type *type) { return new_rd_Call(NULL, irg, block, store, callee, arity, in, type); } -ir_node *new_r_Add (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Add (ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { return new_rd_Add(NULL, irg, block, op1, op2, mode); } -ir_node *new_r_Sub (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Sub (ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { return new_rd_Sub(NULL, irg, block, op1, op2, mode); } -ir_node *new_r_Minus (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Minus (ir_graph *irg, ir_node *block, ir_node *op, ir_mode *mode) { return new_rd_Minus(NULL, irg, block, op, mode); } -ir_node *new_r_Mul (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Mul (ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { return new_rd_Mul(NULL, irg, block, op1, op2, mode); } -ir_node *new_r_Quot (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Quot (ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2) { return new_rd_Quot(NULL, irg, block, memop, op1, op2); } -ir_node *new_r_DivMod (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_DivMod (ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2) { return new_rd_DivMod(NULL, irg, block, memop, op1, op2); } -ir_node *new_r_Div (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Div (ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2) { return new_rd_Div(NULL, irg, block, memop, op1, op2); } -ir_node *new_r_Mod (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Mod (ir_graph *irg, ir_node *block, ir_node *memop, ir_node *op1, ir_node *op2) { return new_rd_Mod(NULL, irg, block, memop, op1, op2); } -ir_node *new_r_Abs (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Abs (ir_graph *irg, ir_node *block, ir_node *op, ir_mode *mode) { return new_rd_Abs(NULL, irg, block, op, mode); } -ir_node *new_r_And (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_And (ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { return new_rd_And(NULL, irg, block, op1, op2, mode); } -ir_node *new_r_Or (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Or (ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { return new_rd_Or(NULL, irg, block, op1, op2, mode); } -ir_node *new_r_Eor (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Eor (ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2, ir_mode *mode) { return new_rd_Eor(NULL, irg, block, op1, op2, mode); } -ir_node *new_r_Not (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Not (ir_graph *irg, ir_node *block, ir_node *op, ir_mode *mode) { return new_rd_Not(NULL, irg, block, op, mode); } -ir_node *new_r_Cmp (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Cmp (ir_graph *irg, ir_node *block, ir_node *op1, ir_node *op2) { return new_rd_Cmp(NULL, irg, block, op1, op2); } -ir_node *new_r_Shl (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Shl (ir_graph *irg, ir_node *block, ir_node *op, ir_node *k, ir_mode *mode) { return new_rd_Shl(NULL, irg, block, op, k, mode); } -ir_node *new_r_Shr (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Shr (ir_graph *irg, ir_node *block, ir_node *op, ir_node *k, ir_mode *mode) { return new_rd_Shr(NULL, irg, block, op, k, mode); } -ir_node *new_r_Shrs (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Shrs (ir_graph *irg, ir_node *block, ir_node *op, ir_node *k, ir_mode *mode) { return new_rd_Shrs(NULL, irg, block, op, k, mode); } -ir_node *new_r_Rot (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Rot (ir_graph *irg, ir_node *block, ir_node *op, ir_node *k, ir_mode *mode) { return new_rd_Rot(NULL, irg, block, op, k, mode); } -ir_node *new_r_Conv (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Conv (ir_graph *irg, ir_node *block, ir_node *op, ir_mode *mode) { return new_rd_Conv(NULL, irg, block, op, mode); } -ir_node *new_r_Phi (ir_graph *irg, ir_node *block, int arity, +INLINE ir_node *new_r_Phi (ir_graph *irg, ir_node *block, int arity, ir_node **in, ir_mode *mode) { return new_rd_Phi(NULL, irg, block, arity, in, mode); } -ir_node *new_r_Load (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Load (ir_graph *irg, ir_node *block, ir_node *store, ir_node *adr) { return new_rd_Load(NULL, irg, block, store, adr); } -ir_node *new_r_Store (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Store (ir_graph *irg, ir_node *block, ir_node *store, ir_node *adr, ir_node *val) { return new_rd_Store(NULL, irg, block, store, adr, val); } -ir_node *new_r_Alloc (ir_graph *irg, ir_node *block, ir_node *store, +INLINE ir_node *new_r_Alloc (ir_graph *irg, ir_node *block, ir_node *store, ir_node *size, type *alloc_type, where_alloc where) { return new_rd_Alloc(NULL, irg, block, store, size, alloc_type, where); } -ir_node *new_r_Free (ir_graph *irg, ir_node *block, ir_node *store, +INLINE ir_node *new_r_Free (ir_graph *irg, ir_node *block, ir_node *store, ir_node *ptr, ir_node *size, type *free_type) { return new_rd_Free(NULL, irg, block, store, ptr, size, free_type); } -ir_node *new_r_Sync (ir_graph *irg, ir_node *block, int arity, ir_node **in) { +INLINE ir_node *new_r_Sync (ir_graph *irg, ir_node *block, int arity, ir_node **in) { return new_rd_Sync(NULL, irg, block, arity, in); } -ir_node *new_r_Proj (ir_graph *irg, ir_node *block, ir_node *arg, +INLINE ir_node *new_r_Proj (ir_graph *irg, ir_node *block, ir_node *arg, ir_mode *mode, long proj) { return new_rd_Proj(NULL, irg, block, arg, mode, proj); } -ir_node *new_r_defaultProj (ir_graph *irg, ir_node *block, ir_node *arg, +INLINE ir_node *new_r_defaultProj (ir_graph *irg, ir_node *block, ir_node *arg, long max_proj) { return new_rd_defaultProj(NULL, irg, block, arg, max_proj); } -ir_node *new_r_Tuple (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Tuple (ir_graph *irg, ir_node *block, int arity, ir_node **in) { return new_rd_Tuple(NULL, irg, block, arity, in ); } -ir_node *new_r_Id (ir_graph *irg, ir_node *block, +INLINE ir_node *new_r_Id (ir_graph *irg, ir_node *block, ir_node *val, ir_mode *mode) { return new_rd_Id(NULL, irg, block, val, mode); } -ir_node *new_r_Bad () { +INLINE ir_node *new_r_Bad () { return new_rd_Bad(); } -ir_node *new_r_Unknown () { +INLINE ir_node *new_r_Unknown () { return new_rd_Unknown(); } -ir_node *new_r_CallBegin (ir_graph *irg, ir_node *block, ir_node *callee) { +INLINE ir_node *new_r_CallBegin (ir_graph *irg, ir_node *block, ir_node *callee) { return new_rd_CallBegin(NULL, irg, block, callee); } -ir_node *new_r_EndReg (ir_graph *irg, ir_node *block) { +INLINE ir_node *new_r_EndReg (ir_graph *irg, ir_node *block) { return new_rd_EndReg(NULL, irg, block); } -ir_node *new_r_EndExcept (ir_graph *irg, ir_node *block) { +INLINE ir_node *new_r_EndExcept (ir_graph *irg, ir_node *block) { return new_rd_EndExcept(NULL, irg, block); } -ir_node *new_r_Break (ir_graph *irg, ir_node *block) { +INLINE ir_node *new_r_Break (ir_graph *irg, ir_node *block) { return new_rd_Break(NULL, irg, block); } -ir_node *new_r_Filter (ir_graph *irg, ir_node *block, ir_node *arg, +INLINE ir_node *new_r_Filter (ir_graph *irg, ir_node *block, ir_node *arg, ir_mode *mode, long proj) { return new_rd_Filter(NULL, irg, block, arg, mode, proj); } @@ -981,7 +982,7 @@ new_d_Block (dbg_info* db, int arity, ir_node **in) * *************************************************************************** */ /* Creates a Phi node with 0 predecessors */ -inline ir_node * +static INLINE ir_node * new_rd_Phi0 (ir_graph *irg, ir_node *block, ir_mode *mode) { ir_node *res; @@ -1003,7 +1004,7 @@ new_rd_Phi0 (ir_graph *irg, ir_node *block, ir_mode *mode) to model this stack, now it is explicit. This reduces side effects. */ #if USE_EXPLICIT_PHI_IN_STACK -Phi_in_stack * +INLINE Phi_in_stack * new_Phi_in_stack() { Phi_in_stack *res; @@ -1015,13 +1016,13 @@ new_Phi_in_stack() { return res; } -void +INLINE void free_Phi_in_stack(Phi_in_stack *s) { DEL_ARR_F(s->stack); free(s); } - -void free_to_Phi_in_stack(ir_node *phi) { +static INLINE void +free_to_Phi_in_stack(ir_node *phi) { assert(get_irn_opcode(phi) == iro_Phi); if (ARR_LEN(current_ir_graph->Phi_in_stack->stack) == @@ -1033,7 +1034,7 @@ void free_to_Phi_in_stack(ir_node *phi) { (current_ir_graph->Phi_in_stack->pos)++; } -ir_node * +static INLINE ir_node * alloc_or_pop_from_Phi_in_stack(ir_graph *irg, ir_node *block, ir_mode *mode, int arity, ir_node **in) { ir_node *res; @@ -1083,7 +1084,7 @@ alloc_or_pop_from_Phi_in_stack(ir_graph *irg, ir_node *block, ir_mode *mode, finds a pointer to itself and, when this routine is called again, eliminates itself. */ -inline ir_node * +static INLINE ir_node * new_rd_Phi_in (ir_graph *irg, ir_node *block, ir_mode *mode, ir_node **in, int ins) { @@ -1142,7 +1143,7 @@ new_rd_Phi_in (ir_graph *irg, ir_node *block, ir_mode *mode, return res; } -inline ir_node * +static ir_node * get_r_value_internal (ir_node *block, int pos, ir_mode *mode); /** This function computes the predecessors for a real Phi node, and then @@ -1150,7 +1151,7 @@ get_r_value_internal (ir_node *block, int pos, ir_mode *mode); node might optimize it away and return a real value, or even a pointer to a deallocated Phi node on top of the obstack! This function is called with an in-array of proper size. **/ -static inline ir_node * +static ir_node * phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins) { ir_node *prevBlock, *res; @@ -1202,7 +1203,7 @@ phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins) this variable was last defined in a previous block, Phi nodes are inserted. If the part of the firm graph containing the definition is not yet constructed, a dummy Phi node is returned. */ -inline ir_node * +static ir_node * get_r_value_internal (ir_node *block, int pos, ir_mode *mode) { ir_node *res; @@ -1312,11 +1313,11 @@ get_r_value_internal (ir_node *block, int pos, ir_mode *mode) #if USE_EXPLICIT_PHI_IN_STACK /* Just dummies */ -Phi_in_stack * new_Phi_in_stack() { return NULL; } -void free_Phi_in_stack(Phi_in_stack *s) { } +static INLINE Phi_in_stack * new_Phi_in_stack() { return NULL; } +static INLINE void free_Phi_in_stack(Phi_in_stack *s) { } #endif -inline ir_node * +static INLINE ir_node * new_rd_Phi_in (ir_graph *irg, ir_node *block, ir_mode *mode, ir_node **in, int ins) { @@ -1365,14 +1366,14 @@ new_rd_Phi_in (ir_graph *irg, ir_node *block, ir_mode *mode, return res; } -inline ir_node * +static ir_node * get_r_value_internal (ir_node *block, int pos, ir_mode *mode); #if PRECISE_EXC_CONTEXT -static inline ir_node * +static ir_node * phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins); -ir_node ** +static INLINE ir_node ** new_frag_arr (ir_node *n) { ir_node **arr; int opt; @@ -1392,7 +1393,7 @@ new_frag_arr (ir_node *n) { return arr; } -inline ir_node ** +static INLINE ir_node ** get_frag_arr (ir_node *n) { if (get_irn_op(n) == op_Call) { return n->attr.call.frag_arr; @@ -1403,14 +1404,14 @@ get_frag_arr (ir_node *n) { } } -void +static void set_frag_value(ir_node **frag_arr, int pos, ir_node *val) { if (!frag_arr[pos]) frag_arr[pos] = val; if (frag_arr[current_ir_graph->n_loc - 1]) set_frag_value (get_frag_arr(frag_arr[current_ir_graph->n_loc - 1]), pos, val); } -inline ir_node * +static ir_node * get_r_frag_value_internal (ir_node *block, ir_node *cfOp, int pos, ir_mode *mode) { ir_node *res; ir_node **frag_arr; @@ -1452,8 +1453,8 @@ get_r_frag_value_internal (ir_node *block, ir_node *cfOp, int pos, ir_mode *mode computes the predecessors for the real phi node, and then allocates and returns this node. The routine called to allocate the node might optimize it away and return a real value. - This function is called with an in-array of proper size. **/ -static inline ir_node * + This function must be called with an in-array of proper size. **/ +static ir_node * phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins) { ir_node *prevBlock, *prevCfOp, *res, *phi0; @@ -1480,15 +1481,15 @@ phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins) if (block == get_irg_start_block(current_ir_graph)) { block->attr.block.graph_arr[pos] = new_Const(mode, tarval_bad); /* We don't need to care about exception ops in the start block. - There are none by definition. */ + There are none by definition. */ return block->attr.block.graph_arr[pos]; } else { phi0 = new_rd_Phi0(current_ir_graph, block, mode); block->attr.block.graph_arr[pos] = phi0; #if PRECISE_EXC_CONTEXT /* Set graph_arr for fragile ops. Also here we should break recursion. - We could choose a cyclic path through an cfop. But the recursion would - break at some point. */ + We could choose a cyclic path through an cfop. But the recursion would + break at some point. */ set_frag_value(block->attr.block.graph_arr, pos, phi0); #endif } @@ -1502,7 +1503,7 @@ phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins) assert (prevCfOp); if (is_Bad(prevCfOp)) { /* In case a Cond has been optimized we would get right to the start block - with an invalid definition. */ + with an invalid definition. */ nin[i-1] = new_Bad(); continue; } @@ -1511,11 +1512,11 @@ phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins) if (!is_Bad(prevBlock)) { #if PRECISE_EXC_CONTEXT if (is_fragile_op(prevCfOp) && (get_irn_op (prevCfOp) != op_Bad)) { - assert(get_r_frag_value_internal (prevBlock, prevCfOp, pos, mode)); - nin[i-1] = get_r_frag_value_internal (prevBlock, prevCfOp, pos, mode); + assert(get_r_frag_value_internal (prevBlock, prevCfOp, pos, mode)); + nin[i-1] = get_r_frag_value_internal (prevBlock, prevCfOp, pos, mode); } else #endif - nin[i-1] = get_r_value_internal (prevBlock, pos, mode); + nin[i-1] = get_r_value_internal (prevBlock, pos, mode); } else { nin[i-1] = new_Bad(); } @@ -1543,7 +1544,7 @@ phi_merge (ir_node *block, int pos, ir_mode *mode, ir_node **nin, int ins) this variable was last defined in a previous block, Phi nodes are inserted. If the part of the firm graph containing the definition is not yet constructed, a dummy Phi node is returned. */ -inline ir_node * +static ir_node * get_r_value_internal (ir_node *block, int pos, ir_mode *mode) { ir_node *res; @@ -1648,14 +1649,14 @@ mature_block (ir_node *block) ir_node *next; assert (get_irn_opcode(block) == iro_Block); - // assert (!get_Block_matured(block) && "Block already matured"); + /* @@@ should be commented in + assert (!get_Block_matured(block) && "Block already matured"); */ if (!get_Block_matured(block)) { /* An array for building the Phi nodes. */ ins = ARR_LEN (block->in)-1; NEW_ARR_A (ir_node *, nin, ins); - /* shouldn't we delete this array at the end of the procedure? @@@ memory leak? */ /* Traverse a chain of Phi nodes attached to this block and mature these, too. **/ @@ -2104,7 +2105,7 @@ ir_node *new_d_immBlock (dbg_info* db) { return res; } -inline ir_node * +INLINE ir_node * new_immBlock () { return new_d_immBlock(NULL); } @@ -2142,14 +2143,14 @@ get_d_value (dbg_info* db, int pos, ir_mode *mode) return get_r_value_internal (current_ir_graph->current_block, pos + 1, mode); } /* get a value from the parameter array from the current block by its index */ -inline ir_node * +INLINE ir_node * get_value (int pos, ir_mode *mode) { return get_d_value(NULL, pos, mode); } /* set a value at position pos in the parameter array from the current block */ -inline void +INLINE void set_value (int pos, ir_node *value) { assert(get_irg_phase_state (current_ir_graph) == phase_building); @@ -2157,7 +2158,7 @@ set_value (int pos, ir_node *value) } /* get the current store */ -inline ir_node * +INLINE ir_node * get_store (void) { assert(get_irg_phase_state (current_ir_graph) == phase_building); @@ -2167,7 +2168,7 @@ get_store (void) } /* set the current store */ -inline void +INLINE void set_store (ir_node *store) { assert(get_irg_phase_state (current_ir_graph) == phase_building); @@ -2175,7 +2176,7 @@ set_store (ir_node *store) current_ir_graph->current_block->attr.block.graph_arr[0] = store; } -inline void +void keep_alive (ir_node *ka) { add_End_keepalive(current_ir_graph->end, ka); diff --git a/ir/ir/ircons.h b/ir/ir/ircons.h index 6d19acf48..5d90e01e3 100644 --- a/ir/ir/ircons.h +++ b/ir/ir/ircons.h @@ -1436,7 +1436,7 @@ ir_node *get_store (void); void set_store (ir_node *store); /* keep this node alive even if End is not control-reachable from it */ -inline void keep_alive (ir_node *ka); +void keep_alive (ir_node *ka); /** Useful access routines **/ /* Returns the current block of the current graph. To set the current diff --git a/ir/ir/irdump.c b/ir/ir/irdump.c index 91bf36b09..af3680d2f 100644 --- a/ir/ir/irdump.c +++ b/ir/ir/irdump.c @@ -102,7 +102,7 @@ void dump_whole_node (ir_node *n, void* env); -inline void +INLINE void dump_node_opcode (ir_node *n) { assert(n && n->op); @@ -136,7 +136,7 @@ dump_node_opcode (ir_node *n) } } -inline void +INLINE void dump_node_mode (ir_node *n) { switch (n->op->code) { @@ -163,7 +163,7 @@ dump_node_mode (ir_node *n) } } -inline void +INLINE void dump_node_nodeattr (ir_node *n) { switch (n->op->code) { @@ -185,7 +185,7 @@ dump_node_nodeattr (ir_node *n) } /* end switch */ } -inline void +INLINE void dump_node_vcgattr (ir_node *n) { switch (n->op->code) { @@ -1274,7 +1274,7 @@ static void clear_link(ir_node * node, void * env) { } -static inline bool is_Block(ir_node * node) { +static INLINE bool is_Block(ir_node * node) { return !is_no_Block(node); } diff --git a/ir/ir/irflag.c b/ir/ir/irflag.c index 18619b277..4e95b08dd 100644 --- a/ir/ir/irflag.c +++ b/ir/ir/irflag.c @@ -12,6 +12,9 @@ # include #endif +#include "irflag.h" +#include "common.h" + /* 0 - don't do this optimization 1 - lets see, if there is a better graph */ @@ -28,13 +31,13 @@ int opt_reassociation = 1; /* Reassociate nodes */ int opt_inline = 1; /* Do inlining transformation */ /* set the flags with set_flagname, get the flag with get_flagname */ -inline void +INLINE void set_opt_cse (int value) { opt_cse = value; } -inline int +INLINE int get_opt_cse (void) { return opt_cse; @@ -50,79 +53,79 @@ int get_opt_global_cse (void) return opt_global_cse; } -inline void +INLINE void set_opt_constant_folding (int value) { opt_constant_folding=value; } -inline int +INLINE int get_opt_constant_folding (void) { return opt_constant_folding; } -inline void +INLINE void set_opt_unreachable_code(int value) { opt_unreachable_code = value; } -inline int +INLINE int get_opt_unreachable_code(void) { return opt_unreachable_code; } -inline void set_opt_control_flow(int value) { +INLINE void set_opt_control_flow(int value) { opt_control_flow = value; } -inline int get_opt_control_flow(void) { +INLINE int get_opt_control_flow(void) { return opt_control_flow; } -inline void +INLINE void set_opt_reassociation(int value) { opt_reassociation = value; } -inline int +INLINE int get_opt_reassociation(void) { return opt_reassociation; } -inline void +INLINE void set_opt_dead_node_elimination (int value) { opt_dead_node_elimination = value; } -inline int +INLINE int get_opt_dead_node_elimination (void) { return opt_dead_node_elimination; } -inline void +INLINE void set_optimize (int value) { optimized = value; } -inline int +INLINE int get_optimize (void) { return optimized; } -void set_opt_inline (int value) { +INLINE void set_opt_inline (int value) { opt_inline = value; } -int get_opt_inline (void) { +INLINE int get_opt_inline (void) { return opt_inline; } diff --git a/ir/ir/irflag.h b/ir/ir/irflag.h index 349e2b03e..35d92778a 100644 --- a/ir/ir/irflag.h +++ b/ir/ir/irflag.h @@ -44,17 +44,17 @@ int get_opt_global_cse (void); /* If opt_unreachable_code == 1 replace nodes (except Block, Phi and Tuple) with a Bad predecessor by the Bad node. Default: opt_unreachable_code == 1. */ -inline void set_opt_unreachable_code(int value); -inline int get_opt_unreachable_code(void); +void set_opt_unreachable_code(int value); +int get_opt_unreachable_code(void); /* Performs Straightening, if simplifications and loop simplifications. */ -inline void set_opt_control_flow(int value); -inline int get_opt_control_flow(void); +void set_opt_control_flow(int value); +int get_opt_control_flow(void); /* If opt_reassociation == 1 reassociation is performed. Default: opt_reassociation == 1. */ -inline void set_opt_reassociation(int value); -inline int get_opt_reassociation(void); +void set_opt_reassociation(int value); +int get_opt_reassociation(void); /* If opt_dead_node_elimination == 1 deallocate all dead nodes by copying the firm graph. diff --git a/ir/ir/irgmod.c b/ir/ir/irgmod.c index 7aeb5edea..e6fdbb7e3 100644 --- a/ir/ir/irgmod.c +++ b/ir/ir/irgmod.c @@ -44,7 +44,7 @@ turn_into_tuple (ir_node *node, int arity) /* Insert irnode `new' in place of irnode `old' Since `new' may be bigger than `old' replace `old' by an op_Id which is smaller than everything */ -inline void +INLINE void exchange (ir_node *old, ir_node *nw) { ir_node *block = old->in[0]; diff --git a/ir/ir/irgmod.h b/ir/ir/irgmod.h index 3f4d20256..b30f6e735 100644 --- a/ir/ir/irgmod.h +++ b/ir/ir/irgmod.h @@ -16,7 +16,7 @@ /* Exchanges two nodes by conserving edges leaving old (i.e., pointers pointing to old). Turns the old node into an Id. Requires that current_ir_graph is set properly. */ -inline void exchange (ir_node *old, ir_node *nw); +INLINE void exchange (ir_node *old, ir_node *nw); /* Turns a node into a "useless" Tuple. The Tuple node just forms a tuple from several inputs. The predecessors of the tuple have to be diff --git a/ir/ir/irgopt.c b/ir/ir/irgopt.c index 7bdee89b8..c987158d2 100644 --- a/ir/ir/irgopt.c +++ b/ir/ir/irgopt.c @@ -87,14 +87,14 @@ local_optimize_graph (ir_graph *irg) { /********************************************************************/ /* Remeber the new node in the old node by using a field all nodes have. */ -inline void +INLINE void set_new_node (ir_node *old, ir_node *new) { old->link = new; } /* Get this new node, before the old node is forgotton.*/ -inline ir_node * +INLINE ir_node * get_new_node (ir_node * n) { return n->link; @@ -106,7 +106,7 @@ get_new_node (ir_node * n) Remembering the arity is useful, as it saves a lot of pointer accesses. This function is called for all Phi and Block nodes in a Block. */ -inline int +INLINE int compute_new_arity(ir_node *b) { int i, res; int irg_v, block_v; @@ -817,7 +817,7 @@ place_floats_early (ir_node *n) Start, Call and end at pinned nodes as Store, Call. Place_early places all floating nodes reachable from its argument through floating nodes and adds all beginnings at pinned nodes to the worklist. */ -inline void place_early () { +INLINE void place_early () { assert(worklist); inc_irg_visited(current_ir_graph); @@ -952,7 +952,7 @@ place_floats_late (ir_node *n) } } -inline void place_late() { +INLINE void place_late() { assert(worklist); inc_irg_visited(current_ir_graph); @@ -1263,8 +1263,6 @@ void optimize_cf(ir_graph *irg) { if (get_irg_dom_state(current_ir_graph) == dom_consistent) set_irg_dom_inconsistent(current_ir_graph); - //DDME(get_irg_ent(irg)); - /* Use block visited flag to mark non-empty blocks. */ inc_irg_block_visited(irg); irg_walk(end, merge_blocks, collect_nodes, NULL); diff --git a/ir/ir/irgraph.c b/ir/ir/irgraph.c index 7d67269ce..687c80aa1 100644 --- a/ir/ir/irgraph.c +++ b/ir/ir/irgraph.c @@ -408,7 +408,7 @@ void set_irg_dom_inconsistent(ir_graph *irg) { irg->dom_state = dom_inconsistent; } -inline void +INLINE void set_irg_pinned (ir_graph *irg, op_pinned p) { irg->pinned = p; diff --git a/ir/ir/irgraph_t.h b/ir/ir/irgraph_t.h index 4578c05df..83ca3238e 100644 --- a/ir/ir/irgraph_t.h +++ b/ir/ir/irgraph_t.h @@ -71,7 +71,7 @@ struct ir_graph { Must look like a correct irg, spare everything else. */ ir_graph *new_const_code_irg(); -inline void +INLINE void set_irg_pinned (ir_graph *irg, op_pinned p); # endif /* _IRGRAPH_T_H_ */ diff --git a/ir/ir/irmode.c b/ir/ir/irmode.c index 241858918..2efc4220d 100644 --- a/ir/ir/irmode.c +++ b/ir/ir/irmode.c @@ -242,7 +242,7 @@ get_mode_modecode (ir_mode *mode) } /* -inline void +INLINE void set_mode_modecode (ir_mode *mode, modecode code) { mode->code = code; @@ -256,14 +256,14 @@ get_mode_ident (ir_mode *mode) } /* -inline void +INLINE void set_mode_ident (ir_mode *mode, ident *name) { mode->name = name; } */ -inline const char * +INLINE const char * get_mode_name (ir_mode *mode) { assert(mode); return id_to_str(mode->name); @@ -276,7 +276,7 @@ get_mode_size (ir_mode *mode) return mode->size; } /* -inline void +INLINE void set_mode_size (ir_mode *mode, int size) { mode->size = size; @@ -290,7 +290,7 @@ get_mode_ld_align (ir_mode *mode) } /* -inline void +INLINE void set_mode_ld_align (ir_mode *mode, int ld_align) { mode->ld_align = ld_align; @@ -304,7 +304,7 @@ get_mode_min (ir_mode *mode) } /* -inline void +INLINE void set_mode_min (ir_mode *mode, tarval *min) { mode->min = min; @@ -318,7 +318,7 @@ get_mode_max (ir_mode *mode) } /* -inline void +INLINE void set_mode_max (ir_mode *mode, tarval *max) { mode->max = max; @@ -332,7 +332,7 @@ get_mode_null (ir_mode *mode) } /* -inline void +INLINE void set_mode_null (ir_mode *mode, tarval *null) { mode->null = null; @@ -346,7 +346,7 @@ get_mode_fsigned (ir_mode *mode) } /* -inline voida +INLINE voida set_mode_fsigned (ir_mode *mode, unsigned fsigned) { mode->fsigned = fsigned; @@ -360,7 +360,7 @@ get_mode_ffloat (ir_mode *mode) } /* -inline void +INLINE void set_mode_ffloat (ir_mode *mode, unsigned ffloat) { mode->ffloat = ffloat; diff --git a/ir/ir/irnode.c b/ir/ir/irnode.c index 0f7c65b75..fff28310a 100644 --- a/ir/ir/irnode.c +++ b/ir/ir/irnode.c @@ -30,12 +30,24 @@ #define RETURN_RESULT_OFFSET 1 /* mem is not a result */ #define END_KEEPALIVE_OFFSET 0 +/* Declarations for INLINEing */ +INLINE ir_node ** get_irn_in (ir_node *node); +INLINE ir_mode *get_irn_mode (ir_node *node); +INLINE ir_op *get_irn_op (ir_node *node); +INLINE opcode get_irn_opcode (ir_node *node); +INLINE ident *get_irn_opident (ir_node *node); +INLINE type *get_SymConst_type (ir_node *node); +INLINE ir_node *skip_nop (ir_node *node); +INLINE ir_node *skip_nop (ir_node *node); +INLINE int is_Proj (ir_node *node); + + static char *pnc_name_arr [] = {"False", "Eq", "Lt", "Le", "Gt", "Ge", "Lg", "Leg", "Uo", "Ue", "Ul", "Ule", "Ug", "Uge", "Ne", "True" }; -inline char *get_pnc_string(int pnc) { +INLINE char *get_pnc_string(int pnc) { return pnc_name_arr[pnc]; } @@ -77,7 +89,7 @@ init_irnode (void) /* create a new irnode in irg, with an op, mode, arity and */ /* some incoming irnodes */ /* this constructor is used in every specified irnode constructor */ -inline ir_node * +INLINE ir_node * new_ir_node (dbg_info *db, ir_graph *irg, ir_node *block, ir_op *op, ir_mode *mode, int arity, ir_node **in) { @@ -112,7 +124,7 @@ new_ir_node (dbg_info *db, ir_graph *irg, ir_node *block, ir_op *op, ir_mode *mo Assumes both have the same opcode and sufficient size. */ void copy_attrs (ir_node *old, ir_node *new) { - assert (get_irn_opcode(old) == get_irn_opcode(new)); + assert (get_irn_op(old) == get_irn_op(new)); memcpy (&new->attr, &old->attr, get_op_attr_size(get_irn_op(old))); } @@ -137,7 +149,7 @@ ir_node_print (XP_PAR1, const xprintf_info *info ATTRIBUTE((unused)), XP_PARN) XPF1 ("%v", get_irn_const_attr); break; case iro_Proj: - if (get_irn_modecode (np) == irm_b) { + if (get_irn_mode (np) == mode_b) { XPC (" "); XP (pnc_name_arr[get_irn_proj_attr(np)]); } else if (get_irn_opcode (get_irn_in (np)[1]) == iro_Start) { @@ -177,7 +189,7 @@ ir_node_print (XP_PAR1, const xprintf_info *info ATTRIBUTE((unused)), XP_PARN) /** getting some parameters from ir_nodes **/ /* returns the number of predecessors without the block predecessor. */ -inline int +INLINE int get_irn_arity (ir_node *node) { assert(node); if (interprocedural_view) { /* handle Filter and Block specially */ @@ -198,7 +210,7 @@ get_irn_arity (ir_node *node) { The order of the predecessors in this array is not guaranteed, except that lists of operands as predecessors of Block or arguments of a Call are consecutive. */ -inline ir_node ** +INLINE ir_node ** get_irn_in (ir_node *node) { assert(node); if (interprocedural_view) { /* handle Filter and Block specially */ @@ -213,7 +225,7 @@ get_irn_in (ir_node *node) { return node->in; } -inline void +INLINE void set_irn_in (ir_node *node, int arity, ir_node **in) { ir_node *** arr; assert(node); @@ -242,7 +254,7 @@ set_irn_in (ir_node *node, int arity, ir_node **in) { to iterate includind the Block predecessor iterate from i = -1 to i < get_irn_arity. If it is a block, the entry -1 is NULL. */ -inline ir_node * +INLINE ir_node * get_irn_n (ir_node *node, int n) { assert(node && -1 <= n && n < get_irn_arity(node)); if (interprocedural_view) { /* handle Filter and Block specially */ @@ -257,7 +269,7 @@ get_irn_n (ir_node *node, int n) { return (node->in[n + 1] = skip_nop(node->in[n + 1])); } -inline void +INLINE void set_irn_n (ir_node *node, int n, ir_node *in) { assert(node && -1 <= n && n < get_irn_arity(node)); if ((n == -1) && (get_irn_opcode(node) == iro_Filter)) { @@ -281,14 +293,14 @@ set_irn_n (ir_node *node, int n, ir_node *in) { node->in[n + 1] = in; } -inline ir_mode * +INLINE ir_mode * get_irn_mode (ir_node *node) { assert (node); return node->mode; } -inline modecode +INLINE modecode get_irn_modecode (ir_node *node) { assert (node); @@ -296,14 +308,14 @@ get_irn_modecode (ir_node *node) } -inline ident * +INLINE ident * get_irn_modeident (ir_node *node) { assert(node); return node->mode->name; } -inline ir_op * +INLINE ir_op * get_irn_op (ir_node *node) { assert (node); @@ -311,74 +323,74 @@ get_irn_op (ir_node *node) } /* should be private to the library: */ -inline void +INLINE void set_irn_op (ir_node *node, ir_op *op) { assert (node); node->op = op; } -inline opcode +INLINE opcode get_irn_opcode (ir_node *node) { assert (node); return node->op->code; } -inline const char * +INLINE const char * get_irn_opname (ir_node *node) { assert(node); return id_to_str(node->op->name); } -inline ident * +INLINE ident * get_irn_opident (ir_node *node) { assert(node); return node->op->name; } -inline unsigned long +INLINE unsigned long get_irn_visited (ir_node *node) { assert (node); return node->visited; } -inline void +INLINE void set_irn_visited (ir_node *node, unsigned long visited) { assert (node); node->visited = visited; } -inline void +INLINE void mark_irn_visited (ir_node *node) { assert (node); node->visited = current_ir_graph->visited; } -inline int +INLINE int irn_not_visited (ir_node *node) { assert (node); return (node->visited < current_ir_graph->visited); } -inline void +INLINE void set_irn_link (ir_node *node, ir_node *link) { assert (node); node->link = link; } -inline ir_node * +INLINE ir_node * get_irn_link (ir_node *node) { assert (node); return node->link; } /* Outputs a unique number for this node */ -inline long +INLINE long get_irn_node_nr(ir_node *node) { assert(node); #ifdef DEBUG_libfirm @@ -388,63 +400,63 @@ get_irn_node_nr(ir_node *node) { #endif } -inline tarval * +INLINE tarval * get_irn_const_attr (ir_node *node) { assert (node->op == op_Const); return node->attr.con; } -inline long +INLINE long get_irn_proj_attr (ir_node *node) { assert (node->op == op_Proj); return node->attr.proj; } -inline alloc_attr +INLINE alloc_attr get_irn_alloc_attr (ir_node *node) { assert (node->op == op_Alloc); return node->attr.a; } -inline type * +INLINE type * get_irn_free_attr (ir_node *node) { assert (node->op == op_Free); return node->attr.f = skip_tid(node->attr.f); } -inline symconst_attr +INLINE symconst_attr get_irn_symconst_attr (ir_node *node) { assert (node->op == op_SymConst); return node->attr.i; } -inline type * +INLINE type * get_irn_call_attr (ir_node *node) { assert (node->op == op_Call); return node->attr.call.cld_tp = skip_tid(node->attr.call.cld_tp); } -inline sel_attr +INLINE sel_attr get_irn_sel_attr (ir_node *node) { assert (node->op == op_Sel); return node->attr.s; } -inline int +INLINE int get_irn_phi_attr (ir_node *node) { assert (node->op == op_Phi); return node->attr.phi0_pos; } -inline block_attr +INLINE block_attr get_irn_block_attr (ir_node *node) { assert (node->op == op_Block); @@ -460,7 +472,7 @@ get_nodes_Block (ir_node *node) { return get_irn_n(node, -1); } -inline void +INLINE void set_nodes_Block (ir_node *node, ir_node *block) { assert (!(node->op == op_Block)); set_irn_n(node, -1, block); @@ -470,7 +482,7 @@ set_nodes_Block (ir_node *node, ir_node *block) { the implementation of the graph datastructure this can be a copy of the internal representation of predecessors as well as the internal array itself. Therefore writing to this array might obstruct the ir. */ -inline ir_node ** +INLINE ir_node ** get_Block_cfgpred_arr (ir_node *node) { assert ((node->op == op_Block)); @@ -478,72 +490,72 @@ get_Block_cfgpred_arr (ir_node *node) } -inline int +INLINE int get_Block_n_cfgpreds (ir_node *node) { assert ((node->op == op_Block)); return (get_irn_arity(node)); } /* -inline void +INLINE void set_Block_n_cfgpreds (ir_node *node, int n_preds) { assert ((node->op == op_Block)); } */ -inline ir_node * +INLINE ir_node * get_Block_cfgpred (ir_node *node, int pos) { assert (node->op == op_Block); return get_irn_n(node, pos); } -inline void +INLINE void set_Block_cfgpred (ir_node *node, int pos, ir_node *pred) { assert (node->op == op_Block); set_irn_n(node, pos, pred); } -inline bool +INLINE bool get_Block_matured (ir_node *node) { assert (node->op == op_Block); return node->attr.block.matured; } -inline void +INLINE void set_Block_matured (ir_node *node, bool matured) { assert (node->op == op_Block); node->attr.block.matured = matured; } -inline unsigned long +INLINE unsigned long get_Block_block_visited (ir_node *node) { assert (node->op == op_Block); return node->attr.block.block_visited; } -inline void +INLINE void set_Block_block_visited (ir_node *node, unsigned long visit) { assert (node->op == op_Block); node->attr.block.block_visited = visit; } /* For this current_ir_graph must be set. */ -inline void mark_Block_block_visited (ir_node *node) { +INLINE void mark_Block_block_visited (ir_node *node) { assert (node->op == op_Block); node->attr.block.block_visited = get_irg_block_visited(current_ir_graph); } -inline int Block_not_block_visited(ir_node *node) { +INLINE int Block_not_block_visited(ir_node *node) { assert (node->op == op_Block); return (node->attr.block.block_visited < get_irg_block_visited(current_ir_graph)); } -inline ir_node * +INLINE ir_node * get_Block_graph_arr (ir_node *node, int pos) { assert (node->op == op_Block); return node->attr.block.graph_arr[pos+1]; } -inline void +INLINE void set_Block_graph_arr (ir_node *node, int pos, ir_node *value) { assert (node->op == op_Block); node->attr.block.graph_arr[pos+1] = value; @@ -633,31 +645,31 @@ void remove_Block_cg_cfgpred_arr(ir_node * node) { node->attr.block.in_cg = NULL; } -inline int +INLINE int get_End_n_keepalives(ir_node *end) { assert (end->op == op_End); return (get_irn_arity(end) - END_KEEPALIVE_OFFSET); } -inline ir_node * +INLINE ir_node * get_End_keepalive(ir_node *end, int pos) { assert (end->op == op_End); return get_irn_n(end, pos + END_KEEPALIVE_OFFSET); } -inline void +INLINE void add_End_keepalive (ir_node *end, ir_node *ka) { assert (end->op == op_End); ARR_APP1 (ir_node *, end->in, ka); } -inline void +INLINE void set_End_keepalive(ir_node *end, int pos, ir_node *ka) { assert (end->op == op_End); set_irn_n(end, pos + END_KEEPALIVE_OFFSET, ka); } -inline void +INLINE void free_End (ir_node *end) { /* DEL_ARR_F(end->in); GL @@@ tut nicht ! */ end->in = NULL; /* @@@ make sure we get an error if we use the in array afterwards ... */ @@ -694,43 +706,49 @@ I don't want to choose 3) as 2a) seems to have advantages for dataflow analysis and 3) does not allow to convert the representation to 2a). */ -inline ir_node * +INLINE ir_node * get_Cond_selector (ir_node *node) { assert (node->op == op_Cond); return get_irn_n(node, 0); } -inline void +INLINE void set_Cond_selector (ir_node *node, ir_node *selector) { assert (node->op == op_Cond); set_irn_n(node, 0, selector); } -inline cond_kind +INLINE cond_kind get_Cond_kind (ir_node *node) { assert (node->op == op_Cond); return node->attr.c.kind; } -inline void +INLINE void set_Cond_kind (ir_node *node, cond_kind kind) { assert (node->op == op_Cond); node->attr.c.kind = kind; } -inline ir_node * +INLINE ir_node * get_Return_mem (ir_node *node) { assert (node->op == op_Return); return get_irn_n(node, 0); } -inline void +INLINE void set_Return_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Return); set_irn_n(node, 0, mem); } -inline ir_node ** +INLINE int +get_Return_n_res (ir_node *node) { + assert (node->op == op_Return); + return (get_irn_arity(node) - RETURN_RESULT_OFFSET); +} + +INLINE ir_node ** get_Return_res_arr (ir_node *node) { assert ((node->op == op_Return)); @@ -740,80 +758,74 @@ get_Return_res_arr (ir_node *node) return NULL; } -inline int -get_Return_n_res (ir_node *node) { - assert (node->op == op_Return); - return (get_irn_arity(node) - RETURN_RESULT_OFFSET); -} - /* -inline void +INLINE void set_Return_n_res (ir_node *node, int results) { assert (node->op == op_Return); } */ -inline ir_node * +INLINE ir_node * get_Return_res (ir_node *node, int pos) { assert (node->op == op_Return); assert (get_Return_n_res(node) > pos); return get_irn_n(node, pos + RETURN_RESULT_OFFSET); } -inline void +INLINE void set_Return_res (ir_node *node, int pos, ir_node *res){ assert (node->op == op_Return); set_irn_n(node, pos + RETURN_RESULT_OFFSET, res); } -inline ir_node * +INLINE ir_node * get_Raise_mem (ir_node *node) { assert (node->op == op_Return); return get_irn_n(node, 0); } -inline void +INLINE void set_Raise_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Raise); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_Raise_exo_ptr (ir_node *node) { assert (node->op == op_Raise); return get_irn_n(node, 1); } -inline void +INLINE void set_Raise_exo_ptr (ir_node *node, ir_node *exo_ptr) { assert (node->op == op_Raise); set_irn_n(node, 1, exo_ptr); } -inline tarval *get_Const_tarval (ir_node *node) { +INLINE tarval *get_Const_tarval (ir_node *node) { assert (node->op == op_Const); return get_irn_const_attr(node); } -inline void +INLINE void set_Const_tarval (ir_node *node, tarval *con) { assert (node->op == op_Const); node->attr.con = con; } -inline symconst_kind +INLINE symconst_kind get_SymConst_kind (ir_node *node) { assert (node->op == op_SymConst); return node->attr.i.num; } -inline void +INLINE void set_SymConst_kind (ir_node *node, symconst_kind num) { assert (node->op == op_SymConst); node->attr.i.num = num; } -inline type * +INLINE type * get_SymConst_type (ir_node *node) { assert ( (node->op == op_SymConst) && ( get_SymConst_kind(node) == type_tag @@ -821,7 +833,7 @@ get_SymConst_type (ir_node *node) { return node->attr.i.tori.typ = skip_tid(node->attr.i.tori.typ); } -inline void +INLINE void set_SymConst_type (ir_node *node, type *type) { assert ( (node->op == op_SymConst) && ( get_SymConst_kind(node) == type_tag @@ -829,57 +841,63 @@ set_SymConst_type (ir_node *node, type *type) { node->attr.i.tori.typ = type; } -inline ident * +INLINE ident * get_SymConst_ptrinfo (ir_node *node) { assert ( (node->op == op_SymConst) && (get_SymConst_kind(node) == linkage_ptr_info)); return node->attr.i.tori.ptrinfo; } -inline void +INLINE void set_SymConst_ptrinfo (ir_node *node, ident *ptrinfo) { assert ( (node->op == op_SymConst) && (get_SymConst_kind(node) == linkage_ptr_info)); node->attr.i.tori.ptrinfo = ptrinfo; } -inline type_or_id_p +INLINE type_or_id_p get_SymConst_type_or_id (ir_node *node) { assert (node->op == op_SymConst); return &(node->attr.i.tori); } -inline void +INLINE void set_SymConst_type_or_id (ir_node *node, type_or_id_p tori) { assert (node->op == op_SymConst); memcpy (&(node->attr.i.tori), tori, sizeof(type_or_id)); } -inline ir_node * +INLINE ir_node * get_Sel_mem (ir_node *node) { assert (node->op == op_Sel); return get_irn_n(node, 0); } -inline void +INLINE void set_Sel_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Sel); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_Sel_ptr (ir_node *node) { assert (node->op == op_Sel); return get_irn_n(node, 1); } -inline void +INLINE void set_Sel_ptr (ir_node *node, ir_node *ptr) { assert (node->op == op_Sel); set_irn_n(node, 1, ptr); } -inline ir_node ** +INLINE int +get_Sel_n_index (ir_node *node) { + assert (node->op == op_Sel); + return (get_irn_arity(node) - SEL_INDEX_OFFSET); +} + +INLINE ir_node ** get_Sel_index_arr (ir_node *node) { assert ((node->op == op_Sel)); @@ -889,50 +907,44 @@ get_Sel_index_arr (ir_node *node) return NULL; } -inline int -get_Sel_n_index (ir_node *node) { - assert (node->op == op_Sel); - return (get_irn_arity(node) - SEL_INDEX_OFFSET); -} - /* -inline void +INLINE void set_Sel_n_index (ir_node *node, int n_index) { assert (node->op == op_Sel); } */ -inline ir_node * +INLINE ir_node * get_Sel_index (ir_node *node, int pos) { assert (node->op == op_Sel); return get_irn_n(node, pos + SEL_INDEX_OFFSET); } -inline void +INLINE void set_Sel_index (ir_node *node, int pos, ir_node *index) { assert (node->op == op_Sel); set_irn_n(node, pos + SEL_INDEX_OFFSET, index); } -inline entity * +INLINE entity * get_Sel_entity (ir_node *node) { assert (node->op == op_Sel); return node->attr.s.ent; } -inline void +INLINE void set_Sel_entity (ir_node *node, entity *ent) { assert (node->op == op_Sel); node->attr.s.ent = ent; } -inline linkage_type +INLINE linkage_type get_Sel_linkage_type (ir_node *node) { assert (node->op == op_Sel); return node->attr.s.ltyp; } -inline void +INLINE void set_Sel_linkage_type (ir_node *node, linkage_type lt) { assert (node->op == op_Sel); node->attr.s.ltyp = lt; @@ -974,73 +986,82 @@ set_InstOf_obj (ir_node *node, ir_node *obj) { set_irn_n (node, 1, obj); } -inline ir_node * + +/* For unary and binary arithmetic operations the access to the + operands can be factored out. Left is the first, right the + second arithmetic value as listed in tech report 0999-33. + unops are: Minus, Abs, Not, Conv + binops are: Add, Sub, Mul, Quot, DivMod, Div, Mod, And, Or, Eor, Shl, + Shr, Shrs, Rotate, Cmp */ + + +INLINE ir_node * get_Call_mem (ir_node *node) { assert (node->op == op_Call); return get_irn_n(node, 0); } -inline void +INLINE void set_Call_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Call); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_Call_ptr (ir_node *node) { assert (node->op == op_Call); return get_irn_n(node, 1); } -inline void +INLINE void set_Call_ptr (ir_node *node, ir_node *ptr) { assert (node->op == op_Call); set_irn_n(node, 1, ptr); } -inline ir_node ** +INLINE ir_node ** get_Call_param_arr (ir_node *node) { assert (node->op == op_Call); return (ir_node **)&get_irn_in(node)[CALL_PARAM_OFFSET + 1]; } -inline int +INLINE int get_Call_n_params (ir_node *node) { assert (node->op == op_Call); return (get_irn_arity(node) - CALL_PARAM_OFFSET); } -inline int +INLINE int get_Call_arity (ir_node *node) { assert (node->op == op_Call); return get_Call_n_params(node); } -/* inline void +/* INLINE void set_Call_arity (ir_node *node, ir_node *arity) { assert (node->op == op_Call); } */ -inline ir_node * +INLINE ir_node * get_Call_param (ir_node *node, int pos) { assert (node->op == op_Call); return get_irn_n(node, pos + CALL_PARAM_OFFSET); } -inline void +INLINE void set_Call_param (ir_node *node, int pos, ir_node *param) { assert (node->op == op_Call); set_irn_n(node, pos + CALL_PARAM_OFFSET, param); } -inline type * +INLINE type * get_Call_type (ir_node *node) { assert (node->op == op_Call); return node->attr.call.cld_tp = skip_tid(node->attr.call.cld_tp); } -inline void +INLINE void set_Call_type (ir_node *node, type *type) { assert (node->op == op_Call); assert (is_method_type(type)); @@ -1070,915 +1091,911 @@ void remove_Call_callee_arr(ir_node * node) { node->attr.call.callee_arr = NULL; } -/* For unary and binary arithmetic operations the access to the - operands can be factored out. Left is the first, right the - second arithmetic value as listed in tech report 0999-33. - unops are: Minus, Abs, Not, Conv - binops are: Add, Sub, Mul, Quot, DivMod, Div, Mod, And, Or, Eor, Shl, - Shr, Shrs, Rotate, Cmp */ - -int -is_unop (ir_node *node) { - return ( node->op == op_Minus || - node->op == op_Abs || - node->op == op_Not || - node->op == op_Conv ); -} - -inline ir_node * -get_unop_op (ir_node *node) { - assert ( node->op == op_Minus || - node->op == op_Abs || - node->op == op_Not || - node->op == op_Conv ); - switch (get_irn_opcode (node)) { - case iro_Minus: return get_Minus_op(node); break; - case iro_Abs: return get_Abs_op(node); break; - case iro_Not: return get_Not_op(node); break; - case iro_Conv: return get_Conv_op(node); break; - default: return NULL; - } -} - -inline void -set_unop_op (ir_node *node, ir_node *op) { - assert (node->op == op_Minus || - node->op == op_Abs || - node->op == op_Not || - node->op == op_Conv ); - switch (get_irn_opcode (node)) { - case iro_Minus: set_Minus_op(node, op); break; - case iro_Abs: set_Abs_op(node, op); break; - case iro_Not: set_Not_op(node, op); break; - case iro_Conv: set_Conv_op(node, op); break; - default: ; - } - -} - -int -is_binop (ir_node *node) { - return (node->op == op_Add || - node->op == op_Sub || - node->op == op_Mul || - node->op == op_Quot || - node->op == op_DivMod || - node->op == op_Div || - node->op == op_Mod || - node->op == op_And || - node->op == op_Or || - node->op == op_Eor || - node->op == op_Shl || - node->op == op_Shr || - node->op == op_Shrs || - node->op == op_Rot || - node->op == op_Cmp ); -} - -inline ir_node * -get_binop_left (ir_node *node) { - assert (node->op == op_Add || - node->op == op_Sub || - node->op == op_Mul || - node->op == op_Quot || - node->op == op_DivMod || - node->op == op_Div || - node->op == op_Mod || - node->op == op_And || - node->op == op_Or || - node->op == op_Eor || - node->op == op_Shl || - node->op == op_Shr || - node->op == op_Shrs || - node->op == op_Rot || - node->op == op_Cmp ); - - switch (get_irn_opcode (node)) { - case iro_Add : return get_Add_left(node); break; - case iro_Sub : return get_Sub_left(node); break; - case iro_Mul : return get_Mul_left(node); break; - case iro_Quot : return get_Quot_left(node); break; - case iro_DivMod: return get_DivMod_left(node); break; - case iro_Div : return get_Div_left(node); break; - case iro_Mod : return get_Mod_left(node); break; - case iro_And : return get_And_left(node); break; - case iro_Or : return get_Or_left(node); break; - case iro_Eor : return get_Eor_left(node); break; - case iro_Shl : return get_Shl_left(node); break; - case iro_Shr : return get_Shr_left(node); break; - case iro_Shrs : return get_Shrs_left(node); break; - case iro_Rot : return get_Rot_left(node); break; - case iro_Cmp : return get_Cmp_left(node); break; - default: return NULL; - }; -} - -inline void -set_binop_left (ir_node *node, ir_node *left) { - assert (node->op == op_Add || - node->op == op_Sub || - node->op == op_Mul || - node->op == op_Quot || - node->op == op_DivMod || - node->op == op_Div || - node->op == op_Mod || - node->op == op_And || - node->op == op_Or || - node->op == op_Eor || - node->op == op_Shl || - node->op == op_Shr || - node->op == op_Shrs || - node->op == op_Rot || - node->op == op_Cmp ); - - switch (get_irn_opcode (node)) { - case iro_Add : set_Add_left(node, left); break; - case iro_Sub : set_Sub_left(node, left); break; - case iro_Mul : set_Mul_left(node, left); break; - case iro_Quot : set_Quot_left(node, left); break; - case iro_DivMod: set_DivMod_left(node, left); break; - case iro_Div : set_Div_left(node, left); break; - case iro_Mod : set_Mod_left(node, left); break; - case iro_And : set_And_left(node, left); break; - case iro_Or : set_Or_left(node, left); break; - case iro_Eor : set_Eor_left(node, left); break; - case iro_Shl : set_Shl_left(node, left); break; - case iro_Shr : set_Shr_left(node, left); break; - case iro_Shrs : set_Shrs_left(node, left); break; - case iro_Rot : set_Rot_left(node, left); break; - case iro_Cmp : set_Cmp_left(node, left); break; - default: ; - }; -} - -inline ir_node * -get_binop_right (ir_node *node) { - assert (node->op == op_Add || - node->op == op_Sub || - node->op == op_Mul || - node->op == op_Quot || - node->op == op_DivMod || - node->op == op_Div || - node->op == op_Mod || - node->op == op_And || - node->op == op_Or || - node->op == op_Eor || - node->op == op_Shl || - node->op == op_Shr || - node->op == op_Shrs || - node->op == op_Rot || - node->op == op_Cmp ); - - switch (get_irn_opcode (node)) { - case iro_Add : return get_Add_right(node); break; - case iro_Sub : return get_Sub_right(node); break; - case iro_Mul : return get_Mul_right(node); break; - case iro_Quot : return get_Quot_right(node); break; - case iro_DivMod: return get_DivMod_right(node); break; - case iro_Div : return get_Div_right(node); break; - case iro_Mod : return get_Mod_right(node); break; - case iro_And : return get_And_right(node); break; - case iro_Or : return get_Or_right(node); break; - case iro_Eor : return get_Eor_right(node); break; - case iro_Shl : return get_Shl_right(node); break; - case iro_Shr : return get_Shr_right(node); break; - case iro_Shrs : return get_Shrs_right(node); break; - case iro_Rot : return get_Rot_right(node); break; - case iro_Cmp : return get_Cmp_right(node); break; - default: return NULL; - }; -} - -inline void -set_binop_right (ir_node *node, ir_node *right) { - assert (node->op == op_Add || - node->op == op_Sub || - node->op == op_Mul || - node->op == op_Quot || - node->op == op_DivMod || - node->op == op_Div || - node->op == op_Mod || - node->op == op_And || - node->op == op_Or || - node->op == op_Eor || - node->op == op_Shl || - node->op == op_Shr || - node->op == op_Shrs || - node->op == op_Rot || - node->op == op_Cmp ); - - switch (get_irn_opcode (node)) { - case iro_Add : set_Add_right(node, right); break; - case iro_Sub : set_Sub_right(node, right); break; - case iro_Mul : set_Mul_right(node, right); break; - case iro_Quot : set_Quot_right(node, right); break; - case iro_DivMod: set_DivMod_right(node, right); break; - case iro_Div : set_Div_right(node, right); break; - case iro_Mod : set_Mod_right(node, right); break; - case iro_And : set_And_right(node, right); break; - case iro_Or : set_Or_right(node, right); break; - case iro_Eor : set_Eor_right(node, right); break; - case iro_Shl : set_Shl_right(node, right); break; - case iro_Shr : set_Shr_right(node, right); break; - case iro_Shrs : set_Shrs_right(node, right); break; - case iro_Rot : set_Rot_right(node, right); break; - case iro_Cmp : set_Cmp_right(node, right); break; - default: ; - }; -} - -inline ir_node * +INLINE ir_node * get_Add_left (ir_node *node) { assert (node->op == op_Add); return get_irn_n(node, 0); } -inline void +INLINE void set_Add_left (ir_node *node, ir_node *left) { assert (node->op == op_Add); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_Add_right (ir_node *node) { assert (node->op == op_Add); return get_irn_n(node, 1); } -inline void +INLINE void set_Add_right (ir_node *node, ir_node *right) { assert (node->op == op_Add); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Sub_left (ir_node *node) { assert (node->op == op_Sub); return get_irn_n(node, 0); } -inline void +INLINE void set_Sub_left (ir_node *node, ir_node *left) { assert (node->op == op_Sub); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_Sub_right (ir_node *node) { assert (node->op == op_Sub); return get_irn_n(node, 1); } -inline void +INLINE void set_Sub_right (ir_node *node, ir_node *right) { assert (node->op == op_Sub); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Minus_op (ir_node *node) { assert (node->op == op_Minus); return get_irn_n(node, 0); } -inline void +INLINE void set_Minus_op (ir_node *node, ir_node *op) { assert (node->op == op_Minus); set_irn_n(node, 0, op); } -inline ir_node * +INLINE ir_node * get_Mul_left (ir_node *node) { assert (node->op == op_Mul); return get_irn_n(node, 0); } -inline void +INLINE void set_Mul_left (ir_node *node, ir_node *left) { assert (node->op == op_Mul); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_Mul_right (ir_node *node) { assert (node->op == op_Mul); return get_irn_n(node, 1); } -inline void +INLINE void set_Mul_right (ir_node *node, ir_node *right) { assert (node->op == op_Mul); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Quot_left (ir_node *node) { assert (node->op == op_Quot); return get_irn_n(node, 1); } -inline void +INLINE void set_Quot_left (ir_node *node, ir_node *left) { assert (node->op == op_Quot); set_irn_n(node, 1, left); } -inline ir_node * +INLINE ir_node * get_Quot_right (ir_node *node) { assert (node->op == op_Quot); return get_irn_n(node, 2); } -inline void +INLINE void set_Quot_right (ir_node *node, ir_node *right) { assert (node->op == op_Quot); set_irn_n(node, 2, right); } -inline ir_node * +INLINE ir_node * get_Quot_mem (ir_node *node) { assert (node->op == op_Quot); return get_irn_n(node, 0); } -inline void +INLINE void set_Quot_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Quot); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_DivMod_left (ir_node *node) { assert (node->op == op_DivMod); return get_irn_n(node, 1); } -inline void +INLINE void set_DivMod_left (ir_node *node, ir_node *left) { assert (node->op == op_DivMod); set_irn_n(node, 1, left); } -inline ir_node * +INLINE ir_node * get_DivMod_right (ir_node *node) { assert (node->op == op_DivMod); return get_irn_n(node, 2); } -inline void +INLINE void set_DivMod_right (ir_node *node, ir_node *right) { assert (node->op == op_DivMod); set_irn_n(node, 2, right); } -inline ir_node * +INLINE ir_node * get_DivMod_mem (ir_node *node) { assert (node->op == op_DivMod); return get_irn_n(node, 0); } -inline void +INLINE void set_DivMod_mem (ir_node *node, ir_node *mem) { assert (node->op == op_DivMod); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_Div_left (ir_node *node) { assert (node->op == op_Div); return get_irn_n(node, 1); } -inline void +INLINE void set_Div_left (ir_node *node, ir_node *left) { assert (node->op == op_Div); set_irn_n(node, 1, left); } -inline ir_node * +INLINE ir_node * get_Div_right (ir_node *node) { assert (node->op == op_Div); return get_irn_n(node, 2); } -inline void +INLINE void set_Div_right (ir_node *node, ir_node *right) { assert (node->op == op_Div); set_irn_n(node, 2, right); } -inline ir_node * +INLINE ir_node * get_Div_mem (ir_node *node) { assert (node->op == op_Div); return get_irn_n(node, 0); } -inline void +INLINE void set_Div_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Div); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_Mod_left (ir_node *node) { assert (node->op == op_Mod); return get_irn_n(node, 1); } -inline void +INLINE void set_Mod_left (ir_node *node, ir_node *left) { assert (node->op == op_Mod); set_irn_n(node, 1, left); } -inline ir_node * +INLINE ir_node * get_Mod_right (ir_node *node) { assert (node->op == op_Mod); return get_irn_n(node, 2); } -inline void +INLINE void set_Mod_right (ir_node *node, ir_node *right) { assert (node->op == op_Mod); set_irn_n(node, 2, right); } -inline ir_node * +INLINE ir_node * get_Mod_mem (ir_node *node) { assert (node->op == op_Mod); return get_irn_n(node, 0); } -inline void +INLINE void set_Mod_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Mod); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_Abs_op (ir_node *node) { assert (node->op == op_Abs); return get_irn_n(node, 0); } -inline void +INLINE void set_Abs_op (ir_node *node, ir_node *op) { assert (node->op == op_Abs); set_irn_n(node, 0, op); } -inline ir_node * +INLINE ir_node * get_And_left (ir_node *node) { assert (node->op == op_And); return get_irn_n(node, 0); } -inline void +INLINE void set_And_left (ir_node *node, ir_node *left) { assert (node->op == op_And); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_And_right (ir_node *node) { assert (node->op == op_And); return get_irn_n(node, 1); } -inline void +INLINE void set_And_right (ir_node *node, ir_node *right) { assert (node->op == op_And); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Or_left (ir_node *node) { assert (node->op == op_Or); return get_irn_n(node, 0); } -inline void +INLINE void set_Or_left (ir_node *node, ir_node *left) { assert (node->op == op_Or); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_Or_right (ir_node *node) { assert (node->op == op_Or); return get_irn_n(node, 1); } -inline void +INLINE void set_Or_right (ir_node *node, ir_node *right) { assert (node->op == op_Or); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Eor_left (ir_node *node) { assert (node->op == op_Eor); return get_irn_n(node, 0); } -inline void +INLINE void set_Eor_left (ir_node *node, ir_node *left) { assert (node->op == op_Eor); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_Eor_right (ir_node *node) { assert (node->op == op_Eor); return get_irn_n(node, 1); } -inline void +INLINE void set_Eor_right (ir_node *node, ir_node *right) { assert (node->op == op_Eor); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Not_op (ir_node *node) { assert (node->op == op_Not); return get_irn_n(node, 0); } -inline void +INLINE void set_Not_op (ir_node *node, ir_node *op) { assert (node->op == op_Not); set_irn_n(node, 0, op); } -inline ir_node * +INLINE ir_node * get_Shl_left (ir_node *node) { assert (node->op == op_Shl); return get_irn_n(node, 0); } -inline void +INLINE void set_Shl_left (ir_node *node, ir_node *left) { assert (node->op == op_Shl); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_Shl_right (ir_node *node) { assert (node->op == op_Shl); return get_irn_n(node, 1); } -inline void +INLINE void set_Shl_right (ir_node *node, ir_node *right) { assert (node->op == op_Shl); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Shr_left (ir_node *node) { assert (node->op == op_Shr); return get_irn_n(node, 0); } -inline void +INLINE void set_Shr_left (ir_node *node, ir_node *left) { assert (node->op == op_Shr); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_Shr_right (ir_node *node) { assert (node->op == op_Shr); return get_irn_n(node, 1); } -inline void +INLINE void set_Shr_right (ir_node *node, ir_node *right) { assert (node->op == op_Shr); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Shrs_left (ir_node *node) { assert (node->op == op_Shrs); return get_irn_n(node, 0); } -inline void +INLINE void set_Shrs_left (ir_node *node, ir_node *left) { assert (node->op == op_Shrs); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_Shrs_right (ir_node *node) { assert (node->op == op_Shrs); return get_irn_n(node, 1); } -inline void +INLINE void set_Shrs_right (ir_node *node, ir_node *right) { assert (node->op == op_Shrs); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Rot_left (ir_node *node) { assert (node->op == op_Rot); return get_irn_n(node, 0); } -inline void +INLINE void set_Rot_left (ir_node *node, ir_node *left) { assert (node->op == op_Rot); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_Rot_right (ir_node *node) { assert (node->op == op_Rot); return get_irn_n(node, 1); } -inline void +INLINE void set_Rot_right (ir_node *node, ir_node *right) { assert (node->op == op_Rot); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Cmp_left (ir_node *node) { assert (node->op == op_Cmp); return get_irn_n(node, 0); } -inline void +INLINE void set_Cmp_left (ir_node *node, ir_node *left) { assert (node->op == op_Cmp); set_irn_n(node, 0, left); } -inline ir_node * +INLINE ir_node * get_Cmp_right (ir_node *node) { assert (node->op == op_Cmp); return get_irn_n(node, 1); } -inline void +INLINE void set_Cmp_right (ir_node *node, ir_node *right) { assert (node->op == op_Cmp); set_irn_n(node, 1, right); } -inline ir_node * +INLINE ir_node * get_Conv_op (ir_node *node) { assert (node->op == op_Conv); return get_irn_n(node, 0); } -inline void +INLINE void set_Conv_op (ir_node *node, ir_node *op) { assert (node->op == op_Conv); set_irn_n(node, 0, op); } -inline ir_node ** + + +int +is_unop (ir_node *node) { + return ( node->op == op_Minus || + node->op == op_Abs || + node->op == op_Not || + node->op == op_Conv ); +} + +INLINE ir_node * +get_unop_op (ir_node *node) { + assert ( node->op == op_Minus || + node->op == op_Abs || + node->op == op_Not || + node->op == op_Conv ); + switch (get_irn_opcode (node)) { + case iro_Minus: return get_Minus_op(node); break; + case iro_Abs: return get_Abs_op(node); break; + case iro_Not: return get_Not_op(node); break; + case iro_Conv: return get_Conv_op(node); break; + default: return NULL; + } +} + +INLINE void +set_unop_op (ir_node *node, ir_node *op) { + assert (node->op == op_Minus || + node->op == op_Abs || + node->op == op_Not || + node->op == op_Conv ); + switch (get_irn_opcode (node)) { + case iro_Minus: set_Minus_op(node, op); break; + case iro_Abs: set_Abs_op(node, op); break; + case iro_Not: set_Not_op(node, op); break; + case iro_Conv: set_Conv_op(node, op); break; + default: ; + } + +} + +int +is_binop (ir_node *node) { + return (node->op == op_Add || + node->op == op_Sub || + node->op == op_Mul || + node->op == op_Quot || + node->op == op_DivMod || + node->op == op_Div || + node->op == op_Mod || + node->op == op_And || + node->op == op_Or || + node->op == op_Eor || + node->op == op_Shl || + node->op == op_Shr || + node->op == op_Shrs || + node->op == op_Rot || + node->op == op_Cmp ); +} + +INLINE ir_node * +get_binop_left (ir_node *node) { + assert (node->op == op_Add || + node->op == op_Sub || + node->op == op_Mul || + node->op == op_Quot || + node->op == op_DivMod || + node->op == op_Div || + node->op == op_Mod || + node->op == op_And || + node->op == op_Or || + node->op == op_Eor || + node->op == op_Shl || + node->op == op_Shr || + node->op == op_Shrs || + node->op == op_Rot || + node->op == op_Cmp ); + + switch (get_irn_opcode (node)) { + case iro_Add : return get_Add_left(node); break; + case iro_Sub : return get_Sub_left(node); break; + case iro_Mul : return get_Mul_left(node); break; + case iro_Quot : return get_Quot_left(node); break; + case iro_DivMod: return get_DivMod_left(node); break; + case iro_Div : return get_Div_left(node); break; + case iro_Mod : return get_Mod_left(node); break; + case iro_And : return get_And_left(node); break; + case iro_Or : return get_Or_left(node); break; + case iro_Eor : return get_Eor_left(node); break; + case iro_Shl : return get_Shl_left(node); break; + case iro_Shr : return get_Shr_left(node); break; + case iro_Shrs : return get_Shrs_left(node); break; + case iro_Rot : return get_Rot_left(node); break; + case iro_Cmp : return get_Cmp_left(node); break; + default: return NULL; + }; +} + +INLINE void +set_binop_left (ir_node *node, ir_node *left) { + assert (node->op == op_Add || + node->op == op_Sub || + node->op == op_Mul || + node->op == op_Quot || + node->op == op_DivMod || + node->op == op_Div || + node->op == op_Mod || + node->op == op_And || + node->op == op_Or || + node->op == op_Eor || + node->op == op_Shl || + node->op == op_Shr || + node->op == op_Shrs || + node->op == op_Rot || + node->op == op_Cmp ); + + switch (get_irn_opcode (node)) { + case iro_Add : set_Add_left(node, left); break; + case iro_Sub : set_Sub_left(node, left); break; + case iro_Mul : set_Mul_left(node, left); break; + case iro_Quot : set_Quot_left(node, left); break; + case iro_DivMod: set_DivMod_left(node, left); break; + case iro_Div : set_Div_left(node, left); break; + case iro_Mod : set_Mod_left(node, left); break; + case iro_And : set_And_left(node, left); break; + case iro_Or : set_Or_left(node, left); break; + case iro_Eor : set_Eor_left(node, left); break; + case iro_Shl : set_Shl_left(node, left); break; + case iro_Shr : set_Shr_left(node, left); break; + case iro_Shrs : set_Shrs_left(node, left); break; + case iro_Rot : set_Rot_left(node, left); break; + case iro_Cmp : set_Cmp_left(node, left); break; + default: ; + }; +} + +INLINE ir_node * +get_binop_right (ir_node *node) { + assert (node->op == op_Add || + node->op == op_Sub || + node->op == op_Mul || + node->op == op_Quot || + node->op == op_DivMod || + node->op == op_Div || + node->op == op_Mod || + node->op == op_And || + node->op == op_Or || + node->op == op_Eor || + node->op == op_Shl || + node->op == op_Shr || + node->op == op_Shrs || + node->op == op_Rot || + node->op == op_Cmp ); + + switch (get_irn_opcode (node)) { + case iro_Add : return get_Add_right(node); break; + case iro_Sub : return get_Sub_right(node); break; + case iro_Mul : return get_Mul_right(node); break; + case iro_Quot : return get_Quot_right(node); break; + case iro_DivMod: return get_DivMod_right(node); break; + case iro_Div : return get_Div_right(node); break; + case iro_Mod : return get_Mod_right(node); break; + case iro_And : return get_And_right(node); break; + case iro_Or : return get_Or_right(node); break; + case iro_Eor : return get_Eor_right(node); break; + case iro_Shl : return get_Shl_right(node); break; + case iro_Shr : return get_Shr_right(node); break; + case iro_Shrs : return get_Shrs_right(node); break; + case iro_Rot : return get_Rot_right(node); break; + case iro_Cmp : return get_Cmp_right(node); break; + default: return NULL; + }; +} + +INLINE void +set_binop_right (ir_node *node, ir_node *right) { + assert (node->op == op_Add || + node->op == op_Sub || + node->op == op_Mul || + node->op == op_Quot || + node->op == op_DivMod || + node->op == op_Div || + node->op == op_Mod || + node->op == op_And || + node->op == op_Or || + node->op == op_Eor || + node->op == op_Shl || + node->op == op_Shr || + node->op == op_Shrs || + node->op == op_Rot || + node->op == op_Cmp ); + + switch (get_irn_opcode (node)) { + case iro_Add : set_Add_right(node, right); break; + case iro_Sub : set_Sub_right(node, right); break; + case iro_Mul : set_Mul_right(node, right); break; + case iro_Quot : set_Quot_right(node, right); break; + case iro_DivMod: set_DivMod_right(node, right); break; + case iro_Div : set_Div_right(node, right); break; + case iro_Mod : set_Mod_right(node, right); break; + case iro_And : set_And_right(node, right); break; + case iro_Or : set_Or_right(node, right); break; + case iro_Eor : set_Eor_right(node, right); break; + case iro_Shl : set_Shl_right(node, right); break; + case iro_Shr : set_Shr_right(node, right); break; + case iro_Shrs : set_Shrs_right(node, right); break; + case iro_Rot : set_Rot_right(node, right); break; + case iro_Cmp : set_Cmp_right(node, right); break; + default: ; + }; +} + + +INLINE ir_node ** get_Phi_preds_arr (ir_node *node) { assert (node->op == op_Phi); return (ir_node **)&(get_irn_in(node)[1]); } -inline int +INLINE int get_Phi_n_preds (ir_node *node) { assert (node->op == op_Phi); return (get_irn_arity(node)); } /* -inline void set_Phi_n_preds (ir_node *node, int n_preds) { +INLINE void set_Phi_n_preds (ir_node *node, int n_preds) { assert (node->op == op_Phi); } */ -inline ir_node * +INLINE ir_node * get_Phi_pred (ir_node *node, int pos) { assert (node->op == op_Phi); return get_irn_n(node, pos); } -inline void +INLINE void set_Phi_pred (ir_node *node, int pos, ir_node *pred) { assert (node->op == op_Phi); set_irn_n(node, pos, pred); } -inline ir_node * +INLINE ir_node * get_Load_mem (ir_node *node) { assert (node->op == op_Load); return get_irn_n(node, 0); } -inline void +INLINE void set_Load_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Load); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_Load_ptr (ir_node *node) { assert (node->op == op_Load); return get_irn_n(node, 1); } -inline void +INLINE void set_Load_ptr (ir_node *node, ir_node *ptr) { assert (node->op == op_Load); set_irn_n(node, 1, ptr); } -inline +INLINE ir_node * get_Store_mem (ir_node *node) { assert (node->op == op_Store); return get_irn_n(node, 0); } -inline void +INLINE void set_Store_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Store); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_Store_ptr (ir_node *node) { assert (node->op == op_Store); return get_irn_n(node, 1); } -inline void +INLINE void set_Store_ptr (ir_node *node, ir_node *ptr) { assert (node->op == op_Store); set_irn_n(node, 1, ptr); } -inline ir_node * +INLINE ir_node * get_Store_value (ir_node *node) { assert (node->op == op_Store); return get_irn_n(node, 2); } -inline void +INLINE void set_Store_value (ir_node *node, ir_node *value) { assert (node->op == op_Store); set_irn_n(node, 2, value); } -inline ir_node * +INLINE ir_node * get_Alloc_mem (ir_node *node) { assert (node->op == op_Alloc); return get_irn_n(node, 0); } -inline void +INLINE void set_Alloc_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Alloc); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_Alloc_size (ir_node *node) { assert (node->op == op_Alloc); return get_irn_n(node, 1); } -inline void +INLINE void set_Alloc_size (ir_node *node, ir_node *size) { assert (node->op == op_Alloc); set_irn_n(node, 1, size); } -inline type * +INLINE type * get_Alloc_type (ir_node *node) { assert (node->op == op_Alloc); return node->attr.a.type = skip_tid(node->attr.a.type); } -inline void +INLINE void set_Alloc_type (ir_node *node, type *type) { assert (node->op == op_Alloc); node->attr.a.type = type; } -inline where_alloc +INLINE where_alloc get_Alloc_where (ir_node *node) { assert (node->op == op_Alloc); return node->attr.a.where; } -inline void +INLINE void set_Alloc_where (ir_node *node, where_alloc where) { assert (node->op == op_Alloc); node->attr.a.where = where; } -inline ir_node * +INLINE ir_node * get_Free_mem (ir_node *node) { assert (node->op == op_Free); return get_irn_n(node, 0); } -inline void +INLINE void set_Free_mem (ir_node *node, ir_node *mem) { assert (node->op == op_Free); set_irn_n(node, 0, mem); } -inline ir_node * +INLINE ir_node * get_Free_ptr (ir_node *node) { assert (node->op == op_Free); return get_irn_n(node, 1); } -inline void +INLINE void set_Free_ptr (ir_node *node, ir_node *ptr) { assert (node->op == op_Free); set_irn_n(node, 1, ptr); } -inline ir_node * +INLINE ir_node * get_Free_size (ir_node *node) { assert (node->op == op_Free); return get_irn_n(node, 2); } -inline void +INLINE void set_Free_size (ir_node *node, ir_node *size) { assert (node->op == op_Free); set_irn_n(node, 2, size); } -inline type * +INLINE type * get_Free_type (ir_node *node) { assert (node->op == op_Free); return node->attr.f = skip_tid(node->attr.f); } -inline void +INLINE void set_Free_type (ir_node *node, type *type) { assert (node->op == op_Free); node->attr.f = type; } -inline ir_node ** +INLINE ir_node ** get_Sync_preds_arr (ir_node *node) { assert (node->op == op_Sync); return (ir_node **)&(get_irn_in(node)[1]); } -inline int +INLINE int get_Sync_n_preds (ir_node *node) { assert (node->op == op_Sync); return (get_irn_arity(node)); } /* -inline void +INLINE void set_Sync_n_preds (ir_node *node, int n_preds) { assert (node->op == op_Sync); } */ -inline ir_node * +INLINE ir_node * get_Sync_pred (ir_node *node, int pos) { assert (node->op == op_Sync); return get_irn_n(node, pos); } -inline void +INLINE void set_Sync_pred (ir_node *node, int pos, ir_node *pred) { assert (node->op == op_Sync); set_irn_n(node, pos, pred); } -inline ir_node * +INLINE ir_node * get_Proj_pred (ir_node *node) { assert (is_Proj(node)); return get_irn_n(node, 0); } -inline void +INLINE void set_Proj_pred (ir_node *node, ir_node *pred) { assert (is_Proj(node)); set_irn_n(node, 0, pred); } -inline long +INLINE long get_Proj_proj (ir_node *node) { assert (is_Proj(node)); if (get_irn_opcode(node) == iro_Proj) { @@ -1989,63 +2006,63 @@ get_Proj_proj (ir_node *node) { } } -inline void +INLINE void set_Proj_proj (ir_node *node, long proj) { assert (node->op == op_Proj); node->attr.proj = proj; } -inline ir_node ** +INLINE ir_node ** get_Tuple_preds_arr (ir_node *node) { assert (node->op == op_Tuple); return (ir_node **)&(get_irn_in(node)[1]); } -inline int +INLINE int get_Tuple_n_preds (ir_node *node) { assert (node->op == op_Tuple); return (get_irn_arity(node)); } /* -inline void +INLINE void set_Tuple_n_preds (ir_node *node, int n_preds) { assert (node->op == op_Tuple); } */ -inline ir_node * +INLINE ir_node * get_Tuple_pred (ir_node *node, int pos) { assert (node->op == op_Tuple); return get_irn_n(node, pos); } -inline void +INLINE void set_Tuple_pred (ir_node *node, int pos, ir_node *pred) { assert (node->op == op_Tuple); set_irn_n(node, pos, pred); } -inline ir_node * +INLINE ir_node * get_Id_pred (ir_node *node) { assert (node->op == op_Id); return get_irn_n(node, 0); } -inline void +INLINE void set_Id_pred (ir_node *node, ir_node *pred) { assert (node->op == op_Id); set_irn_n(node, 0, pred); } -inline ir_node * +INLINE ir_node * get_Filter_pred(ir_node *node) { assert(node->op == op_Filter); return node->in[1]; } -inline long +INLINE long get_Filter_proj(ir_node *node) { assert(node->op == op_Filter); return node->attr.filter.proj; @@ -2066,7 +2083,7 @@ void set_Filter_cg_pred(ir_node * node, int pos, ir_node * pred) { } -inline ir_graph * +INLINE ir_graph * get_irn_irg(ir_node *node) { if (get_irn_op(node) == op_CallBegin) { return node->attr.callbegin.irg; @@ -2082,7 +2099,7 @@ get_irn_irg(ir_node *node) { /* Auxiliary routines */ /******************************************************************/ -inline ir_node * +INLINE ir_node * skip_Proj (ir_node *node) { /* don't assert node !!! */ if (node && is_Proj(node)) { @@ -2092,7 +2109,7 @@ skip_Proj (ir_node *node) { } } -inline ir_node * +INLINE ir_node * skip_Tuple (ir_node *node) { ir_node *pred; @@ -2107,7 +2124,7 @@ skip_Tuple (ir_node *node) { return node; } -inline ir_node * +INLINE ir_node * skip_nop (ir_node *node) { /* don't assert node !!! */ @@ -2121,12 +2138,12 @@ skip_nop (ir_node *node) { } } -inline ir_node * +INLINE ir_node * skip_Id (ir_node *node) { return skip_nop(node); } -inline int +INLINE int is_Bad (ir_node *node) { assert(node); if ((node) && get_irn_opcode(node) == iro_Bad) @@ -2134,13 +2151,13 @@ is_Bad (ir_node *node) { return 0; } -inline int +INLINE int is_no_Block (ir_node *node) { assert(node); return (get_irn_opcode(node) != iro_Block); } -inline int +INLINE int is_Proj (ir_node *node) { assert(node); return node->op == op_Proj diff --git a/ir/ir/irnode.h b/ir/ir/irnode.h index c6fc38336..52967aca9 100644 --- a/ir/ir/irnode.h +++ b/ir/ir/irnode.h @@ -58,14 +58,14 @@ typedef struct ir_node ir_node; /* returns the number of predecessors without the block predecessor: */ int get_irn_arity (ir_node *node); /* returns the array with the ins: */ -inline ir_node **get_irn_in (ir_node *node); +INLINE ir_node **get_irn_in (ir_node *node); /* Replaces the old in array by a new one that will contain the ins given in the parameters. Conserves the block predecessor. It copies the array passed. This function is necessary to ajust in arrays of blocks, calls and phis. Assumes that current_ir_graph is set to the graph containing "node". "in" must contain all predecessors except the block that are required for the nodes opcode. */ -inline void set_irn_in (ir_node *node, int arity, +INLINE void set_irn_in (ir_node *node, int arity, ir_node **in); /* to iterate through the predecessors without touching the array. No order of predecessors guaranteed. @@ -74,34 +74,34 @@ inline void set_irn_in (ir_node *node, int arity, i < get_irn_arity. */ /* Access predecessor n */ /* get_irn_n removes Id predecessors. */ -inline ir_node *get_irn_n (ir_node *node, int n); -inline void set_irn_n (ir_node *node, int n, ir_node *in); +INLINE ir_node *get_irn_n (ir_node *node, int n); +INLINE void set_irn_n (ir_node *node, int n, ir_node *in); /* Get the mode struct. */ -inline ir_mode *get_irn_mode (ir_node *node); +INLINE ir_mode *get_irn_mode (ir_node *node); /* Get the mode-enum modecode */ -inline modecode get_irn_modecode (ir_node *node); +INLINE modecode get_irn_modecode (ir_node *node); /* Get the ident for a string representation of the mode */ -inline ident *get_irn_modeident (ir_node *node); +INLINE ident *get_irn_modeident (ir_node *node); /* Access the opcode struct of the node */ -inline ir_op *get_irn_op (ir_node *node); -inline void set_irn_op (ir_node *node, ir_op *op); +INLINE ir_op *get_irn_op (ir_node *node); +INLINE void set_irn_op (ir_node *node, ir_op *op); /* Get the opcode-enum of the node */ -inline opcode get_irn_opcode (ir_node *node); +INLINE opcode get_irn_opcode (ir_node *node); /* Get the ident for a string representation of the opcode */ -inline ident *get_irn_opident (ir_node *node); +INLINE ident *get_irn_opident (ir_node *node); /* Get the string representation of the opcode */ -inline const char *get_irn_opname (ir_node *node); -inline void set_irn_visited (ir_node *node, unsigned long visited); -inline unsigned long get_irn_visited (ir_node *node); +INLINE const char *get_irn_opname (ir_node *node); +INLINE void set_irn_visited (ir_node *node, unsigned long visited); +INLINE unsigned long get_irn_visited (ir_node *node); /* Sets visited to get_irg_visited(current_ir_graph) */ -inline void mark_irn_visited (ir_node *node); +INLINE void mark_irn_visited (ir_node *node); /* Returns 1 of visited < get_irg_visited(current_ir_graph). */ -inline int irn_not_visited (ir_node *node); -inline void set_irn_link (ir_node *node, ir_node *link); -inline ir_node *get_irn_link (ir_node *node); +INLINE int irn_not_visited (ir_node *node); +INLINE void set_irn_link (ir_node *node, ir_node *link); +INLINE ir_node *get_irn_link (ir_node *node); /* Outputs a unique number for this node if libfirm is compiled for debugging, else returns 0. */ -inline long get_irn_node_nr(ir_node *node); +INLINE long get_irn_node_nr(ir_node *node); /*****/ /* irnode constructor */ @@ -109,7 +109,7 @@ inline long get_irn_node_nr(ir_node *node); /* some incoming irnodes. */ /* If arity is negative, a node with a dynamic array is created. */ -inline ir_node * +INLINE ir_node * new_ir_node (dbg_info *db, ir_graph *irg, ir_node *block, @@ -128,8 +128,8 @@ new_ir_node (dbg_info *db, */ /* this works for all except Block */ -inline ir_node *get_nodes_Block (ir_node *node); -inline void set_nodes_Block (ir_node *node, ir_node *block); +INLINE ir_node *get_nodes_Block (ir_node *node); +INLINE void set_nodes_Block (ir_node *node, ir_node *block); /* Projection numbers for result of Start node: use for Proj nodes! */ typedef enum { @@ -142,20 +142,20 @@ typedef enum { pns_args /* Projection on all arguments */ } pns_number; -inline ir_node **get_Block_cfgpred_arr (ir_node *node); +INLINE ir_node **get_Block_cfgpred_arr (ir_node *node); int get_Block_n_cfgpreds (ir_node *node); -/* inline void set_Block_n_cfgpreds (ir_node *node, int n_preds); */ -inline ir_node *get_Block_cfgpred (ir_node *node, int pos); -inline void set_Block_cfgpred (ir_node *node, int pos, ir_node *pred); -inline bool get_Block_matured (ir_node *node); -inline void set_Block_matured (ir_node *node, bool matured); -inline unsigned long get_Block_block_visited (ir_node *node); -inline void set_Block_block_visited (ir_node *node, unsigned long visit); +/* INLINE void set_Block_n_cfgpreds (ir_node *node, int n_preds); */ +INLINE ir_node *get_Block_cfgpred (ir_node *node, int pos); +INLINE void set_Block_cfgpred (ir_node *node, int pos, ir_node *pred); +INLINE bool get_Block_matured (ir_node *node); +INLINE void set_Block_matured (ir_node *node, bool matured); +INLINE unsigned long get_Block_block_visited (ir_node *node); +INLINE void set_Block_block_visited (ir_node *node, unsigned long visit); /* For this current_ir_graph must be set. */ -inline void mark_Block_block_visited(ir_node *node); -inline int Block_not_block_visited(ir_node *node); -inline ir_node *get_Block_graph_arr (ir_node *node, int pos); -inline void set_Block_graph_arr (ir_node *node, int pos, ir_node *value); +INLINE void mark_Block_block_visited(ir_node *node); +INLINE int Block_not_block_visited(ir_node *node); +INLINE ir_node *get_Block_graph_arr (ir_node *node, int pos); +INLINE void set_Block_graph_arr (ir_node *node, int pos, ir_node *value); /* exc handling */ void set_Block_exc (ir_node*, exc_t); @@ -179,14 +179,14 @@ ir_node ** get_Block_cg_cfgpred_arr(ir_node * node); int get_Block_cg_n_cfgpreds(ir_node * node); void remove_Block_cg_cfgpred_arr(ir_node * node); -inline int get_End_n_keepalives(ir_node *end); -inline ir_node *get_End_keepalive(ir_node *end, int pos); -inline void add_End_keepalive (ir_node *end, ir_node *ka); -inline void set_End_keepalive(ir_node *end, int pos, ir_node *ka); +INLINE int get_End_n_keepalives(ir_node *end); +INLINE ir_node *get_End_keepalive(ir_node *end, int pos); +INLINE void add_End_keepalive (ir_node *end, ir_node *ka); +INLINE void set_End_keepalive(ir_node *end, int pos, ir_node *ka); /* Some parts of the End node are allocated seperately -- their memory is not recovered by dead_node_elimination if a End node is dead. free_End frees these data structures. */ -inline void free_End (ir_node *end); +INLINE void free_End (ir_node *end); /* We distinguish three kinds of Cond nodes. These can be distinguished by the mode of the selector operand and an internal flag of type cond_kind. @@ -214,26 +214,26 @@ typedef enum { Proj nodes mean default control flow, i.e., Proj(n). */ } cond_kind; -inline ir_node *get_Cond_selector (ir_node *node); -inline void set_Cond_selector (ir_node *node, ir_node *selector); -inline cond_kind get_Cond_kind (ir_node *node); -inline void set_Cond_kind (ir_node *node, cond_kind kind); +INLINE ir_node *get_Cond_selector (ir_node *node); +INLINE void set_Cond_selector (ir_node *node, ir_node *selector); +INLINE cond_kind get_Cond_kind (ir_node *node); +INLINE void set_Cond_kind (ir_node *node, cond_kind kind); -inline ir_node *get_Return_mem (ir_node *node); -inline void set_Return_mem (ir_node *node, ir_node *mem); -inline ir_node **get_Return_res_arr (ir_node *node); -inline int get_Return_n_res (ir_node *node); -/*inline void set_Return_n_res (ir_node *node, int results); */ -inline ir_node *get_Return_res (ir_node *node, int pos); -inline void set_Return_res (ir_node *node, int pos, ir_node *res); +INLINE ir_node *get_Return_mem (ir_node *node); +INLINE void set_Return_mem (ir_node *node, ir_node *mem); +INLINE ir_node **get_Return_res_arr (ir_node *node); +INLINE int get_Return_n_res (ir_node *node); +/*INLINE void set_Return_n_res (ir_node *node, int results); */ +INLINE ir_node *get_Return_res (ir_node *node, int pos); +INLINE void set_Return_res (ir_node *node, int pos, ir_node *res); -inline ir_node *get_Raise_mem (ir_node *node); -inline void set_Raise_mem (ir_node *node, ir_node *mem); -inline ir_node *get_Raise_exo_ptr (ir_node *node); /* PoinTeR to EXception Object */ -inline void set_Raise_exo_ptr (ir_node *node, ir_node *exoptr); +INLINE ir_node *get_Raise_mem (ir_node *node); +INLINE void set_Raise_mem (ir_node *node, ir_node *mem); +INLINE ir_node *get_Raise_exo_ptr (ir_node *node); /* PoinTeR to EXception Object */ +INLINE void set_Raise_exo_ptr (ir_node *node, ir_node *exoptr); -inline tarval *get_Const_tarval (ir_node *node); -inline void set_Const_tarval (ir_node *node, tarval *con); +INLINE tarval *get_Const_tarval (ir_node *node); +INLINE void set_Const_tarval (ir_node *node, tarval *con); /* This enum names the three different kinds of symbolic Constants represented by SymConst. The content of the attribute type_or_id @@ -248,38 +248,38 @@ typedef enum { by the linker. Type_or_id_p is ident *. */ } symconst_kind; typedef union type_or_id * type_or_id_p; -inline symconst_kind get_SymConst_kind (ir_node *node); -inline void set_SymConst_kind (ir_node *node, symconst_kind num); +INLINE symconst_kind get_SymConst_kind (ir_node *node); +INLINE void set_SymConst_kind (ir_node *node, symconst_kind num); /* Only to access SymConst of kind type_tag or size. Else assertion: */ -inline type *get_SymConst_type (ir_node *node); -inline void set_SymConst_type (ir_node *node, type *type); +INLINE type *get_SymConst_type (ir_node *node); +INLINE void set_SymConst_type (ir_node *node, type *type); /* Only to access SymConst of kind linkage_ptr_info. Else assertion: */ -inline ident *get_SymConst_ptrinfo (ir_node *node); -inline void set_SymConst_ptrinfo (ir_node *node, ident *ptrinfo); +INLINE ident *get_SymConst_ptrinfo (ir_node *node); +INLINE void set_SymConst_ptrinfo (ir_node *node, ident *ptrinfo); /* Sets both: type and ptrinfo. Needed to treat the node independent of its semantics. Does a memcpy for the memory tori points to. */ -inline type_or_id_p get_SymConst_type_or_id (ir_node *node); -inline void set_SymConst_type_or_id (ir_node *node, type_or_id_p tori); - -inline ir_node *get_Sel_mem (ir_node *node); -inline void set_Sel_mem (ir_node *node, ir_node *mem); -inline ir_node *get_Sel_ptr (ir_node *node); /* ptr to the object to select from */ -inline void set_Sel_ptr (ir_node *node, ir_node *ptr); -inline ir_node **get_Sel_index_arr (ir_node *node); -inline int get_Sel_n_index (ir_node *node); -/*inline void set_Sel_n_index (ir_node *node, int n_index); */ -inline ir_node *get_Sel_index (ir_node *node, int pos); -inline void set_Sel_index (ir_node *node, int pos, ir_node *index); -inline entity *get_Sel_entity (ir_node *node); /* entity to select */ -inline void set_Sel_entity (ir_node *node, entity *ent); +INLINE type_or_id_p get_SymConst_type_or_id (ir_node *node); +INLINE void set_SymConst_type_or_id (ir_node *node, type_or_id_p tori); + +INLINE ir_node *get_Sel_mem (ir_node *node); +INLINE void set_Sel_mem (ir_node *node, ir_node *mem); +INLINE ir_node *get_Sel_ptr (ir_node *node); /* ptr to the object to select from */ +INLINE void set_Sel_ptr (ir_node *node, ir_node *ptr); +INLINE ir_node **get_Sel_index_arr (ir_node *node); +INLINE int get_Sel_n_index (ir_node *node); +/*INLINE void set_Sel_n_index (ir_node *node, int n_index); */ +INLINE ir_node *get_Sel_index (ir_node *node, int pos); +INLINE void set_Sel_index (ir_node *node, int pos, ir_node *index); +INLINE entity *get_Sel_entity (ir_node *node); /* entity to select */ +INLINE void set_Sel_entity (ir_node *node, entity *ent); typedef enum { static_linkage, /* entity is used internal and not visible out of this file/class. */ external_linkage, /* */ no_linkage } linkage_type; -inline linkage_type get_Sel_linkage_type (ir_node *node); -inline void set_Sel_linkage_type (ir_node *node, linkage_type lt); +INLINE linkage_type get_Sel_linkage_type (ir_node *node); +INLINE void set_Sel_linkage_type (ir_node *node, linkage_type lt); type *get_InstOf_ent (ir_node*); void set_InstOf_ent (ir_node*, type*); @@ -288,18 +288,18 @@ void set_InstOf_obj (ir_node*, ir_node*); ir_node *get_InstOf_store (ir_node*); void set_InstOf_store (ir_node*, ir_node*); -inline ir_node *get_Call_mem (ir_node *node); -inline void set_Call_mem (ir_node *node, ir_node *mem); -inline ir_node *get_Call_ptr (ir_node *node); -inline void set_Call_ptr (ir_node *node, ir_node *ptr); -inline ir_node **get_Call_param_arr (ir_node *node); -inline int get_Call_n_params (ir_node *node); -inline int get_Call_arity (ir_node *node); -/* inline void set_Call_arity (ir_node *node, ir_node *arity); */ -inline ir_node *get_Call_param (ir_node *node, int pos); -inline void set_Call_param (ir_node *node, int pos, ir_node *param); -inline type *get_Call_type (ir_node *node); -inline void set_Call_type (ir_node *node, type *type); +INLINE ir_node *get_Call_mem (ir_node *node); +INLINE void set_Call_mem (ir_node *node, ir_node *mem); +INLINE ir_node *get_Call_ptr (ir_node *node); +INLINE void set_Call_ptr (ir_node *node, ir_node *ptr); +INLINE ir_node **get_Call_param_arr (ir_node *node); +INLINE int get_Call_n_params (ir_node *node); +INLINE int get_Call_arity (ir_node *node); +/* INLINE void set_Call_arity (ir_node *node, ir_node *arity); */ +INLINE ir_node *get_Call_param (ir_node *node, int pos); +INLINE void set_Call_param (ir_node *node, int pos, ir_node *param); +INLINE type *get_Call_type (ir_node *node); +INLINE void set_Call_type (ir_node *node, type *type); /* Set, get and remove the callee-analysis. */ int get_Call_n_callees(ir_node * node); @@ -313,81 +313,81 @@ void remove_Call_callee_arr(ir_node * node); unops are: Minus, Abs, Not, Conv binops are: Add, Sub, Mul, Quot, DivMod, Div, Mod, And, Or, Eor, Shl, Shr, Shrs, Rot, Cmp */ -inline int is_unop (ir_node *node); -inline ir_node *get_unop_op (ir_node *node); -inline void set_unop_op (ir_node *node, ir_node *op); -inline int is_binop (ir_node *node); -inline ir_node *get_binop_left (ir_node *node); -inline void set_binop_left (ir_node *node, ir_node *left); -inline ir_node *get_binop_right (ir_node *node); -inline void set_binop_right (ir_node *node, ir_node *right); - -inline ir_node *get_Add_left (ir_node *node); -inline void set_Add_left (ir_node *node, ir_node *left); -inline ir_node *get_Add_right (ir_node *node); -inline void set_Add_right (ir_node *node, ir_node *right); - -inline ir_node *get_Sub_left (ir_node *node); -inline void set_Sub_left (ir_node *node, ir_node *left); -inline ir_node *get_Sub_right (ir_node *node); -inline void set_Sub_right (ir_node *node, ir_node *right); - -inline ir_node *get_Minus_op (ir_node *node); -inline void set_Minus_op (ir_node *node, ir_node *op); - -inline ir_node *get_Mul_left (ir_node *node); -inline void set_Mul_left (ir_node *node, ir_node *left); -inline ir_node *get_Mul_right (ir_node *node); -inline void set_Mul_right (ir_node *node, ir_node *right); - -inline ir_node *get_Quot_left (ir_node *node); -inline void set_Quot_left (ir_node *node, ir_node *left); -inline ir_node *get_Quot_right (ir_node *node); -inline void set_Quot_right (ir_node *node, ir_node *right); -inline ir_node *get_Quot_mem (ir_node *node); -inline void set_Quot_mem (ir_node *node, ir_node *mem); - -inline ir_node *get_DivMod_left (ir_node *node); -inline void set_DivMod_left (ir_node *node, ir_node *left); -inline ir_node *get_DivMod_right (ir_node *node); -inline void set_DivMod_right (ir_node *node, ir_node *right); -inline ir_node *get_DivMod_mem (ir_node *node); -inline void set_DivMod_mem (ir_node *node, ir_node *mem); - -inline ir_node *get_Div_left (ir_node *node); -inline void set_Div_left (ir_node *node, ir_node *left); -inline ir_node *get_Div_right (ir_node *node); -inline void set_Div_right (ir_node *node, ir_node *right); -inline ir_node *get_Div_mem (ir_node *node); -inline void set_Div_mem (ir_node *node, ir_node *mem); - -inline ir_node *get_Mod_left (ir_node *node); -inline void set_Mod_left (ir_node *node, ir_node *left); -inline ir_node *get_Mod_right (ir_node *node); -inline void set_Mod_right (ir_node *node, ir_node *right); -inline ir_node *get_Mod_mem (ir_node *node); -inline void set_Mod_mem (ir_node *node, ir_node *mem); - -inline ir_node *get_Abs_op (ir_node *node); -inline void set_Abs_op (ir_node *node, ir_node *op); - -inline ir_node *get_And_left (ir_node *node); -inline void set_And_left (ir_node *node, ir_node *left); -inline ir_node *get_And_right (ir_node *node); -inline void set_And_right (ir_node *node, ir_node *right); - -inline ir_node *get_Or_left (ir_node *node); -inline void set_Or_left (ir_node *node, ir_node *left); -inline ir_node *get_Or_right (ir_node *node); -inline void set_Or_right (ir_node *node, ir_node *right); - -inline ir_node *get_Eor_left (ir_node *node); -inline void set_Eor_left (ir_node *node, ir_node *left); -inline ir_node *get_Eor_right (ir_node *node); -inline void set_Eor_right (ir_node *node, ir_node *right); - -inline ir_node *get_Not_op (ir_node *node); -inline void set_Not_op (ir_node *node, ir_node *op); +INLINE int is_unop (ir_node *node); +INLINE ir_node *get_unop_op (ir_node *node); +INLINE void set_unop_op (ir_node *node, ir_node *op); +INLINE int is_binop (ir_node *node); +INLINE ir_node *get_binop_left (ir_node *node); +INLINE void set_binop_left (ir_node *node, ir_node *left); +INLINE ir_node *get_binop_right (ir_node *node); +INLINE void set_binop_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Add_left (ir_node *node); +INLINE void set_Add_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Add_right (ir_node *node); +INLINE void set_Add_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Sub_left (ir_node *node); +INLINE void set_Sub_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Sub_right (ir_node *node); +INLINE void set_Sub_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Minus_op (ir_node *node); +INLINE void set_Minus_op (ir_node *node, ir_node *op); + +INLINE ir_node *get_Mul_left (ir_node *node); +INLINE void set_Mul_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Mul_right (ir_node *node); +INLINE void set_Mul_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Quot_left (ir_node *node); +INLINE void set_Quot_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Quot_right (ir_node *node); +INLINE void set_Quot_right (ir_node *node, ir_node *right); +INLINE ir_node *get_Quot_mem (ir_node *node); +INLINE void set_Quot_mem (ir_node *node, ir_node *mem); + +INLINE ir_node *get_DivMod_left (ir_node *node); +INLINE void set_DivMod_left (ir_node *node, ir_node *left); +INLINE ir_node *get_DivMod_right (ir_node *node); +INLINE void set_DivMod_right (ir_node *node, ir_node *right); +INLINE ir_node *get_DivMod_mem (ir_node *node); +INLINE void set_DivMod_mem (ir_node *node, ir_node *mem); + +INLINE ir_node *get_Div_left (ir_node *node); +INLINE void set_Div_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Div_right (ir_node *node); +INLINE void set_Div_right (ir_node *node, ir_node *right); +INLINE ir_node *get_Div_mem (ir_node *node); +INLINE void set_Div_mem (ir_node *node, ir_node *mem); + +INLINE ir_node *get_Mod_left (ir_node *node); +INLINE void set_Mod_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Mod_right (ir_node *node); +INLINE void set_Mod_right (ir_node *node, ir_node *right); +INLINE ir_node *get_Mod_mem (ir_node *node); +INLINE void set_Mod_mem (ir_node *node, ir_node *mem); + +INLINE ir_node *get_Abs_op (ir_node *node); +INLINE void set_Abs_op (ir_node *node, ir_node *op); + +INLINE ir_node *get_And_left (ir_node *node); +INLINE void set_And_left (ir_node *node, ir_node *left); +INLINE ir_node *get_And_right (ir_node *node); +INLINE void set_And_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Or_left (ir_node *node); +INLINE void set_Or_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Or_right (ir_node *node); +INLINE void set_Or_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Eor_left (ir_node *node); +INLINE void set_Eor_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Eor_right (ir_node *node); +INLINE void set_Eor_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Not_op (ir_node *node); +INLINE void set_Not_op (ir_node *node, ir_node *op); /* Projection numbers of compare: use for Proj nodes! */ typedef enum { @@ -409,105 +409,105 @@ typedef enum { True, /* true */ not_mask = Leg /* bits to flip to negate comparison */ } pnc_number; -inline char *get_pnc_string(int pnc); -inline int get_negated_pnc(int pnc); -inline ir_node *get_Cmp_left (ir_node *node); -inline void set_Cmp_left (ir_node *node, ir_node *left); -inline ir_node *get_Cmp_right (ir_node *node); -inline void set_Cmp_right (ir_node *node, ir_node *right); - -inline ir_node *get_Shl_left (ir_node *node); -inline void set_Shl_left (ir_node *node, ir_node *left); -inline ir_node *get_Shl_right (ir_node *node); -inline void set_Shl_right (ir_node *node, ir_node *right); - -inline ir_node *get_Shr_left (ir_node *node); -inline void set_Shr_left (ir_node *node, ir_node *left); -inline ir_node *get_Shr_right (ir_node *node); -inline void set_Shr_right (ir_node *node, ir_node *right); - -inline ir_node *get_Shrs_left (ir_node *node); -inline void set_Shrs_left (ir_node *node, ir_node *left); -inline ir_node *get_Shrs_right (ir_node *node); -inline void set_Shrs_right (ir_node *node, ir_node *right); - -inline ir_node *get_Rot_left (ir_node *node); -inline void set_Rot_left (ir_node *node, ir_node *left); -inline ir_node *get_Rot_right (ir_node *node); -inline void set_Rot_right (ir_node *node, ir_node *right); - -inline ir_node *get_Conv_op (ir_node *node); -inline void set_Conv_op (ir_node *node, ir_node *op); - -inline ir_node **get_Phi_preds_arr (ir_node *node); -inline int get_Phi_n_preds (ir_node *node); -/* inline void set_Phi_n_preds (ir_node *node, int n_preds); */ -inline ir_node *get_Phi_pred (ir_node *node, int pos); -inline void set_Phi_pred (ir_node *node, int pos, ir_node *pred); - -inline ir_node *get_Load_mem (ir_node *node); -inline void set_Load_mem (ir_node *node, ir_node *mem); -inline ir_node *get_Load_ptr (ir_node *node); -inline void set_Load_ptr (ir_node *node, ir_node *ptr); - -inline ir_node *get_Store_mem (ir_node *node); -inline void set_Store_mem (ir_node *node, ir_node *mem); -inline ir_node *get_Store_ptr (ir_node *node); -inline void set_Store_ptr (ir_node *node, ir_node *ptr); -inline ir_node *get_Store_value (ir_node *node); -inline void set_Store_value (ir_node *node, ir_node *value); - -inline ir_node *get_Alloc_mem (ir_node *node); -inline void set_Alloc_mem (ir_node *node, ir_node *mem); -inline ir_node *get_Alloc_size (ir_node *node); -inline void set_Alloc_size (ir_node *node, ir_node *size); -inline type *get_Alloc_type (ir_node *node); -inline void set_Alloc_type (ir_node *node, type *type); +INLINE char *get_pnc_string(int pnc); +INLINE int get_negated_pnc(int pnc); +INLINE ir_node *get_Cmp_left (ir_node *node); +INLINE void set_Cmp_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Cmp_right (ir_node *node); +INLINE void set_Cmp_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Shl_left (ir_node *node); +INLINE void set_Shl_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Shl_right (ir_node *node); +INLINE void set_Shl_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Shr_left (ir_node *node); +INLINE void set_Shr_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Shr_right (ir_node *node); +INLINE void set_Shr_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Shrs_left (ir_node *node); +INLINE void set_Shrs_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Shrs_right (ir_node *node); +INLINE void set_Shrs_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Rot_left (ir_node *node); +INLINE void set_Rot_left (ir_node *node, ir_node *left); +INLINE ir_node *get_Rot_right (ir_node *node); +INLINE void set_Rot_right (ir_node *node, ir_node *right); + +INLINE ir_node *get_Conv_op (ir_node *node); +INLINE void set_Conv_op (ir_node *node, ir_node *op); + +INLINE ir_node **get_Phi_preds_arr (ir_node *node); +INLINE int get_Phi_n_preds (ir_node *node); +/* INLINE void set_Phi_n_preds (ir_node *node, int n_preds); */ +INLINE ir_node *get_Phi_pred (ir_node *node, int pos); +INLINE void set_Phi_pred (ir_node *node, int pos, ir_node *pred); + +INLINE ir_node *get_Load_mem (ir_node *node); +INLINE void set_Load_mem (ir_node *node, ir_node *mem); +INLINE ir_node *get_Load_ptr (ir_node *node); +INLINE void set_Load_ptr (ir_node *node, ir_node *ptr); + +INLINE ir_node *get_Store_mem (ir_node *node); +INLINE void set_Store_mem (ir_node *node, ir_node *mem); +INLINE ir_node *get_Store_ptr (ir_node *node); +INLINE void set_Store_ptr (ir_node *node, ir_node *ptr); +INLINE ir_node *get_Store_value (ir_node *node); +INLINE void set_Store_value (ir_node *node, ir_node *value); + +INLINE ir_node *get_Alloc_mem (ir_node *node); +INLINE void set_Alloc_mem (ir_node *node, ir_node *mem); +INLINE ir_node *get_Alloc_size (ir_node *node); +INLINE void set_Alloc_size (ir_node *node, ir_node *size); +INLINE type *get_Alloc_type (ir_node *node); +INLINE void set_Alloc_type (ir_node *node, type *type); typedef enum { stack_alloc, /* Alloc allocates the object on the stack. */ heap_alloc /* Alloc allocates the object on the heap. */ } where_alloc; -inline where_alloc get_Alloc_where (ir_node *node); -inline void set_Alloc_where (ir_node *node, where_alloc where); - -inline ir_node *get_Free_mem (ir_node *node); -inline void set_Free_mem (ir_node *node, ir_node *mem); -inline ir_node *get_Free_ptr (ir_node *node); -inline void set_Free_ptr (ir_node *node, ir_node *ptr); -inline ir_node *get_Free_size (ir_node *node); -inline void set_Free_size (ir_node *node, ir_node *size); -inline type *get_Free_type (ir_node *node); -inline void set_Free_type (ir_node *node, type *type); - -inline ir_node **get_Sync_preds_arr (ir_node *node); -inline int get_Sync_n_preds (ir_node *node); -/* inline void set_Sync_n_preds (ir_node *node, int n_preds); */ -inline ir_node *get_Sync_pred (ir_node *node, int pos); -inline void set_Sync_pred (ir_node *node, int pos, ir_node *pred); - -inline ir_node *get_Proj_pred (ir_node *node); -inline void set_Proj_pred (ir_node *node, ir_node *pred); -inline long get_Proj_proj (ir_node *node); -inline void set_Proj_proj (ir_node *node, long proj); - -inline ir_node **get_Tuple_preds_arr (ir_node *node); -inline int get_Tuple_n_preds (ir_node *node); -/* inline void set_Tuple_n_preds (ir_node *node, int n_preds); */ -inline ir_node *get_Tuple_pred (ir_node *node, int pos); -inline void set_Tuple_pred (ir_node *node, int pos, ir_node *pred); - -inline ir_node *get_Id_pred (ir_node *node); -inline void set_Id_pred (ir_node *node, ir_node *pred); - -inline ir_node *get_Filter_pred(ir_node *node); -inline long get_Filter_proj(ir_node *node); +INLINE where_alloc get_Alloc_where (ir_node *node); +INLINE void set_Alloc_where (ir_node *node, where_alloc where); + +INLINE ir_node *get_Free_mem (ir_node *node); +INLINE void set_Free_mem (ir_node *node, ir_node *mem); +INLINE ir_node *get_Free_ptr (ir_node *node); +INLINE void set_Free_ptr (ir_node *node, ir_node *ptr); +INLINE ir_node *get_Free_size (ir_node *node); +INLINE void set_Free_size (ir_node *node, ir_node *size); +INLINE type *get_Free_type (ir_node *node); +INLINE void set_Free_type (ir_node *node, type *type); + +INLINE ir_node **get_Sync_preds_arr (ir_node *node); +INLINE int get_Sync_n_preds (ir_node *node); +/* INLINE void set_Sync_n_preds (ir_node *node, int n_preds); */ +INLINE ir_node *get_Sync_pred (ir_node *node, int pos); +INLINE void set_Sync_pred (ir_node *node, int pos, ir_node *pred); + +INLINE ir_node *get_Proj_pred (ir_node *node); +INLINE void set_Proj_pred (ir_node *node, ir_node *pred); +INLINE long get_Proj_proj (ir_node *node); +INLINE void set_Proj_proj (ir_node *node, long proj); + +INLINE ir_node **get_Tuple_preds_arr (ir_node *node); +INLINE int get_Tuple_n_preds (ir_node *node); +/* INLINE void set_Tuple_n_preds (ir_node *node, int n_preds); */ +INLINE ir_node *get_Tuple_pred (ir_node *node, int pos); +INLINE void set_Tuple_pred (ir_node *node, int pos, ir_node *pred); + +INLINE ir_node *get_Id_pred (ir_node *node); +INLINE void set_Id_pred (ir_node *node, ir_node *pred); + +INLINE ir_node *get_Filter_pred(ir_node *node); +INLINE long get_Filter_proj(ir_node *node); /* set the interprocedural predecessors */ void set_Filter_cg_pred_arr(ir_node * node, int arity, ir_node ** in); void set_Filter_cg_pred(ir_node * node, int pos, ir_node * pred); /* Returns the ir_graph this node belongs to. Only valid for * CallBegin, EndReg and EndExcept */ -inline ir_graph *get_irn_irg(ir_node *node); +INLINE ir_graph *get_irn_irg(ir_node *node); /*****/ @@ -521,20 +521,20 @@ inline ir_graph *get_irn_irg(ir_node *node); */ /* returns operand of node if node is a Proj. */ -inline ir_node *skip_Proj (ir_node *node); +INLINE ir_node *skip_Proj (ir_node *node); /* returns operand of node if node is a Id */ -inline ir_node *skip_nop (ir_node *node); -inline ir_node *skip_Id (ir_node *node); /* Same as skip_nop. */ +INLINE ir_node *skip_nop (ir_node *node); +INLINE ir_node *skip_Id (ir_node *node); /* Same as skip_nop. */ /* returns corresponding operand of Tuple if node is a Proj from a Tuple. */ -inline ir_node *skip_Tuple (ir_node *node); +INLINE ir_node *skip_Tuple (ir_node *node); /* returns true if node is a Bad node. */ -inline int is_Bad (ir_node *node); +INLINE int is_Bad (ir_node *node); /* returns true if the node is not a Block */ -inline int is_no_Block (ir_node *node); +INLINE int is_no_Block (ir_node *node); /* returns true if node is a Proj node or a Filter node in * intraprocedural view */ -inline int is_Proj (ir_node *node); +INLINE int is_Proj (ir_node *node); /* Returns true if the operation manipulates control flow: Start, End, Jmp, Cond, Return, Raise, Bad */ int is_cfop(ir_node *node); diff --git a/ir/ir/irnode_t.h b/ir/ir/irnode_t.h index 44056e140..88b9b7555 100644 --- a/ir/ir/irnode_t.h +++ b/ir/ir/irnode_t.h @@ -174,11 +174,11 @@ int ir_node_print (XP_PAR1, const xprintf_info *, XP_PARN); /** access attributes directly **/ -inline tarval *get_irn_const_attr (ir_node *node); -inline long get_irn_proj_attr (ir_node *node); -inline alloc_attr get_irn_alloc_attr (ir_node *node); -inline type *get_irn_free_attr (ir_node *node); -inline symconst_attr get_irn_symconst_attr (ir_node *node); +INLINE tarval *get_irn_const_attr (ir_node *node); +INLINE long get_irn_proj_attr (ir_node *node); +INLINE alloc_attr get_irn_alloc_attr (ir_node *node); +INLINE type *get_irn_free_attr (ir_node *node); +INLINE symconst_attr get_irn_symconst_attr (ir_node *node); type *get_irn_call_attr (ir_node *node); sel_attr get_irn_sel_attr (ir_node *node); int get_irn_phi_attr (ir_node *node); diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index b9f16e744..43e6d3577 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -26,16 +26,16 @@ /* Make types visible to allow most efficient access */ # include "entity_t.h" -/* Trivial inlineable routine for copy propagation. - Does follow Ids, needed to optimize inlined code. */ -static inline ir_node * +/* Trivial INLINEable routine for copy propagation. + Does follow Ids, needed to optimize INLINEd code. */ +static INLINE ir_node * follow_Id (ir_node *n) { while (get_irn_op (n) == op_Id) n = get_Id_pred (n); return n; } -static inline tarval * +static INLINE tarval * value_of (ir_node *n) { if ((n != NULL) && (get_irn_op(n) == op_Const)) @@ -913,7 +913,7 @@ del_identities (pset *value_table) /* Return the canonical node computing the same value as n. Looks up the node in a hash table. */ -static inline ir_node * +static INLINE ir_node * identify (pset *value_table, ir_node *n) { ir_node *o = NULL; @@ -949,7 +949,7 @@ identify (pset *value_table, ir_node *n) /* During construction we set the pinned flag in the graph right when the optimizatin is performed. The flag turning on procedure global cse could be changed between two allocations. This way we are safe. */ -static inline ir_node * +static INLINE ir_node * identify_cons (pset *value_table, ir_node *n) { ir_node *old = n; n = identify(value_table, n); @@ -983,7 +983,7 @@ add_identities (pset *value_table, ir_node *node) { /* garbage in, garbage out. If a node has a dead input, i.e., the Bad node is input to the node, return the Bad node. */ -static inline ir_node * +static INLINE ir_node * gigo (ir_node *node) { int i; diff --git a/ir/ir/irprog.c b/ir/ir/irprog.c index 4ab9f55ef..0f9698268 100644 --- a/ir/ir/irprog.c +++ b/ir/ir/irprog.c @@ -42,7 +42,7 @@ ir_prog *new_ir_prog (void) { res->types = NEW_ARR_F (type *, 1); res->glob_type = new_type_class(id_from_str (GLOBAL_TYPE_NAME, strlen(GLOBAL_TYPE_NAME))); - // @@@ Das ist hier das 2. mal!! + /* @@@ Das ist hier das 2. mal!! */ add_irp_type(res->glob_type); res->const_code_irg = new_const_code_irg(); diff --git a/ir/ir/irvrfy.c b/ir/ir/irvrfy.c index 1022b9218..725186717 100644 --- a/ir/ir/irvrfy.c +++ b/ir/ir/irvrfy.c @@ -16,7 +16,128 @@ # include "irvrfy.h" # include "irgwalk.h" -void vrfy_Proj_proj(ir_node *p); +INLINE static void +vrfy_Proj_proj(ir_node *p) { + ir_node *pred; + ir_mode *mode; + int proj; + + pred = skip_nop(get_Proj_pred(p)); + assert(get_irn_mode(pred) == mode_T); + mode = get_irn_mode(p); + proj = get_Proj_proj(p); + + switch (get_irn_opcode(pred)) { + case iro_Start: + assert (((proj == 0 && mode == mode_X) || + (proj == 1 && mode == mode_M) || + (proj == 2 && mode == mode_p) || + (proj == 3 && mode == mode_p) || + (proj == 4 && mode == mode_T)) && + "wrong Proj from Start" ); + break; + case iro_Cond: + assert ((proj >= 0 && mode == mode_X) && + "wrong Proj from Cond"); + break; + case iro_Raise: + assert (((proj == 0 && mode == mode_X) || + (proj == 1 && mode == mode_M)) && + "wrong Proj from Raise" ); + break; + case iro_InstOf: + assert (((proj >= 0 && mode == mode_X) && + "wrong Proj from InstOf")); + break; + case iro_Call: + assert (((proj == 0 && mode == mode_M) || + (proj == 1 && mode == mode_X) || + (proj == 2 && mode == mode_T) || + (proj == 3 && mode == mode_M)) && + "wrong Proj from Call" ); + break; + case iro_Quot: + assert (((proj == 0 && mode == mode_M) || + (proj == 1 && mode == mode_X) || + (proj == 2 && mode_is_float(mode))) && + "wrong Proj from Quot"); + break; + case iro_DivMod: + assert (((proj == 0 && mode == mode_M) || + (proj == 1 && mode == mode_X) || + (proj == 2 && mode == mode_i) || + (proj == 3 && mode == mode_i)) && + "wrong Proj from DivMod" ); + break; + case iro_Div: + case iro_Mod: + assert (((proj == 0 && mode == mode_M) || + (proj == 1 && mode == mode_X) || + (proj == 2 && mode == mode_i)) && + "wrong Proj from Div or Mod" ); + break; + case iro_Cmp: + assert ((proj >= 0 && proj <= 15 && mode == mode_b) && + "wrong Proj from Cmp"); + break; + case iro_Load: + assert (((proj == 0 && mode == mode_M) || + (proj == 1 && mode == mode_X) || + (proj == 2 && mode_is_data(mode))) && + "wrong Proj from Load"); + break; + case iro_Store: + assert (((proj == 0 && mode == mode_M) || + (proj == 1 && mode == mode_X)) && + "wrong Proj from Store"); + break; + case iro_Alloc: + assert (((proj == 0 && mode == mode_M) || + (proj == 1 /* && mode == mode_X*/) || + (proj == 2 && mode == mode_p)) && + "wrong Proj from Alloc"); + break; + case iro_Proj: { + type *mt; /* A method type */ + pred = skip_nop(get_Proj_pred(pred)); + assert(get_irn_mode(pred) == mode_T); + switch (get_irn_opcode(pred)) { + case iro_Start: { + assert (proj >= 0 && mode_is_data(mode) && + "wrong Proj from Proj from Start"); + mt = get_entity_type(get_irg_ent(current_ir_graph)); + assert(proj < get_method_n_params(mt) && + "More Projs for args than args in type"); + assert(mode == get_type_mode(get_method_param_type(mt, proj)) && + "Mode of Proj from Start doesn't match mode of param type."); + } break; + case iro_Call: { + assert (proj >= 0 && mode_is_data(mode) && + "wrong Proj from Proj from Call"); + mt = get_Call_type(pred); + assert(proj < get_method_n_res(mt) && + "More Projs for results than results in type."); + assert(mode == get_type_mode(get_method_res_type(mt, proj)) && + "Mode of Proj from Call doesn't match mode of result type."); + } break; + case iro_Tuple: ; + /* We don't test */ + break; + default: assert(0); + } break; + } + case iro_Tuple: + /* We don't test */ + break; + case iro_CallBegin: + break; + case iro_EndReg: + break; + case iro_EndExcept: + break; + default: assert(0); + } +} void irn_vrfy (ir_node *n) @@ -360,129 +481,6 @@ irn_vrfy (ir_node *n) } } -void -vrfy_Proj_proj(ir_node *p) { - ir_node *pred; - ir_mode *mode; - int proj; - - pred = skip_nop(get_Proj_pred(p)); - assert(get_irn_mode(pred) == mode_T); - mode = get_irn_mode(p); - proj = get_Proj_proj(p); - - switch (get_irn_opcode(pred)) { - case iro_Start: - assert (((proj == 0 && mode == mode_X) || - (proj == 1 && mode == mode_M) || - (proj == 2 && mode == mode_p) || - (proj == 3 && mode == mode_p) || - (proj == 4 && mode == mode_T)) && - "wrong Proj from Start" ); - break; - case iro_Cond: - assert ((proj >= 0 && mode == mode_X) && - "wrong Proj from Cond"); - break; - case iro_Raise: - assert (((proj == 0 && mode == mode_X) || - (proj == 1 && mode == mode_M)) && - "wrong Proj from Raise" ); - break; - case iro_InstOf: - assert (((proj >= 0 && mode == mode_X) && - "wrong Proj from InstOf")); - break; - case iro_Call: - assert (((proj == 0 && mode == mode_M) || - (proj == 1 && mode == mode_X) || - (proj == 2 && mode == mode_T) || - (proj == 3 && mode == mode_M)) && - "wrong Proj from Call" ); - break; - case iro_Quot: - assert (((proj == 0 && mode == mode_M) || - (proj == 1 && mode == mode_X) || - (proj == 2 && mode_is_float(mode))) && - "wrong Proj from Quot"); - break; - case iro_DivMod: - assert (((proj == 0 && mode == mode_M) || - (proj == 1 && mode == mode_X) || - (proj == 2 && mode == mode_i) || - (proj == 3 && mode == mode_i)) && - "wrong Proj from DivMod" ); - break; - case iro_Div: - case iro_Mod: - assert (((proj == 0 && mode == mode_M) || - (proj == 1 && mode == mode_X) || - (proj == 2 && mode == mode_i)) && - "wrong Proj from Div or Mod" ); - break; - case iro_Cmp: - assert ((proj >= 0 && proj <= 15 && mode == mode_b) && - "wrong Proj from Cmp"); - break; - case iro_Load: - assert (((proj == 0 && mode == mode_M) || - (proj == 1 && mode == mode_X) || - (proj == 2 && mode_is_data(mode))) && - "wrong Proj from Load"); - break; - case iro_Store: - assert (((proj == 0 && mode == mode_M) || - (proj == 1 && mode == mode_X)) && - "wrong Proj from Store"); - break; - case iro_Alloc: - assert (((proj == 0 && mode == mode_M) || - (proj == 1 /* && mode == mode_X*/) || - (proj == 2 && mode == mode_p)) && - "wrong Proj from Alloc"); - break; - case iro_Proj: { - type *mt; /* A method type */ - pred = skip_nop(get_Proj_pred(pred)); - assert(get_irn_mode(pred) == mode_T); - switch (get_irn_opcode(pred)) { - case iro_Start: { - assert (proj >= 0 && mode_is_data(mode) && - "wrong Proj from Proj from Start"); - mt = get_entity_type(get_irg_ent(current_ir_graph)); - assert(proj < get_method_n_params(mt) && - "More Projs for args than args in type"); - assert(mode == get_type_mode(get_method_param_type(mt, proj)) && - "Mode of Proj from Start doesn't match mode of param type."); - } break; - case iro_Call: { - assert (proj >= 0 && mode_is_data(mode) && - "wrong Proj from Proj from Call"); - mt = get_Call_type(pred); - assert(proj < get_method_n_res(mt) && - "More Projs for results than results in type."); - assert(mode == get_type_mode(get_method_res_type(mt, proj)) && - "Mode of Proj from Call doesn't match mode of result type."); - } break; - case iro_Tuple: ; - /* We don't test */ - break; - default: assert(0); - } break; - } - case iro_Tuple: - /* We don't test */ - break; - case iro_CallBegin: - break; - case iro_EndReg: - break; - case iro_EndExcept: - break; - default: assert(0); - } -} - /*******************************************************************/ /* Verify the whole graph. */ @@ -493,8 +491,7 @@ vrfy_wrap (ir_node *node, void *env) { irn_vrfy(node); } -void -irg_vrfy (ir_graph *irg) +void irg_vrfy (ir_graph *irg) { ir_graph *rem; rem = current_ir_graph; diff --git a/ir/st/exc.c b/ir/st/exc.c index 1898247da..df13b7be5 100644 --- a/ir/st/exc.c +++ b/ir/st/exc.c @@ -1,7 +1,7 @@ /* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */ -// -// Time-stamp: -// +/* +** Time-stamp: +*/ /*** NAME @@ -40,7 +40,7 @@ static bool has_handler (ir_graph *graph, ir_node *b, ir_node *a) ir_node *succ = 0; assert (0 && "Wrongly implemented"); - // must check for _immediate_ dominance !!! + /* must check for _immediate_ dominance !!! */ if (is_handler_entry (graph, b) && dominates (graph, a, b)) return (true); @@ -63,15 +63,15 @@ static bool is_exc_jmp (ir_node *node) { ir_op *op = get_irn_op (node); - // Proj_X (Load), Proj_X (Sto), Proj_X (Div_Int), - // Proj_X (Raise), Proj_X (Call), Proj_X (Alloc) + /* Proj_X (Load), Proj_X (Sto), Proj_X (Div_Int), + Proj_X (Raise), Proj_X (Call), Proj_X (Alloc) */ if (op == op_Proj) { op = get_irn_op (get_Proj_pred (node)); assert ((is_fragile_op(get_Proj_pred(node))) && (op != op_Bad) /*&& (op != op_Unknown)*/ && - (get_irn_mode(node) == mode_X));// Check for proper Proj attr + (get_irn_mode(node) == mode_X));/* Check for proper Proj attr */ return (true); } else @@ -83,21 +83,23 @@ static bool is_exc_jmp (ir_node *node) /* Return true iff the given node represents a normal cfg jump */ +#if 0 static bool is_cfg_jmp (ir_node *node) { ir_op *op = get_irn_op (node); if (op == op_Proj) - { - op = get_irn_op (get_Proj_pred (node)); + { + op = get_irn_op (get_Proj_pred (node)); - // Proj_X (Proj_Cmp (Cond)) - if (op_Proj == op) - return (true); /* check for op == op_Cmp and op == op_Cond */ - } + /* Proj_X (Proj_Cmp (Cond)) */ + if (op_Proj == op) + return (true); /* check for op == op_Cmp and op == op_Cond */ + } return (false); } +#endif /* Return true iff a new exception region must be left upon entry of this block. diff --git a/ir/st/exc.h b/ir/st/exc.h index 95e5075ad..7334ea4d6 100644 --- a/ir/st/exc.h +++ b/ir/st/exc.h @@ -1,7 +1,7 @@ /* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */ -// -// Time-stamp: <02/03/22 17:03:05 liekweg> -// +/* +** Time-stamp: +*/ /*** NAME @@ -31,13 +31,13 @@ typedef enum { exc_invalid, /* not yet computed */ exc_normal, /* normal CF */ - // must push a new exc contrext at entry of block: + /* must push a new exc contrext at entry of block: */ exc_region, /* region entry */ - // must pop current exc contrext at EXIT of block + /* must pop current exc contrext at EXIT of block */ exc_exit, /* region exit */ - // must pop current exc contrext at entry of block + /* must pop current exc contrext at entry of block */ exc_handler, /* handler entry */ exc_max /* maximum value of enum for 'bounds checking' */ diff --git a/ir/st/st.c b/ir/st/st.c index 173df8d94..d9df53fb9 100644 --- a/ir/st/st.c +++ b/ir/st/st.c @@ -1,7 +1,7 @@ /* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */ -// -// Time-stamp: -// +/* +** Time-stamp: +*/ /*** NAME @@ -24,14 +24,17 @@ # ifdef DEBUG_libfirm # endif /* def DEBUG_libfirm */ # include +# include "misc.h" /* init globals: */ static dtree_t *trees = 0; +/* static dtree_t *last = 0; +*/ -// -------------------------------------------------------------------- -// Helper Functions -// -------------------------------------------------------------------- +/* -------------------------------------------------------------------- +** Helper Functions +** -------------------------------------------------------------------- */ /* Helper function for get_n_blocks */ @@ -65,9 +68,6 @@ static int get_n_blocks (ir_graph *graph) # endif /* def DEBUG_libfirm */ irg_block_walk (end_block, count_block, NULL, &n); - // irg_block_walk (end_block, NULL, NULL, NULL); - - // return (24); fprintf (stdout, "%s: Graph(%p) has (%i) blocks\n", __FILE__ ":" __PRETTY_FUNCTION__, graph, n); @@ -117,18 +117,18 @@ static dt_t *new_dt (ir_graph *graph) return (res); } - +/* static void free_dt (dt_t *dt) { free (dt->blocks); dt->blocks = 0; free (dt->masks); dt->masks = 0; free (dt); } +*/ - -// -------------------------------------------------------------------- -// Private Functions -// -------------------------------------------------------------------- +/* -------------------------------------------------------------------- +** Private Functions +** -------------------------------------------------------------------- */ /* Given a graph, find its dominator tree in the global list: @@ -141,7 +141,6 @@ static dt_t *get_dominator_tree (ir_graph *graph) # ifdef DEBUG_libfirm assert (graph && "no graph"); - // assert (iter && "no trees"); # endif /* def DEBUG_libfirm */ while ((0 != iter) && (graph != iter->graph)) @@ -181,7 +180,7 @@ static void add_dominator_tree (dt_t *tree) __FILE__ ":" __PRETTY_FUNCTION__, dtree, trees); # endif /* def VERBOSE_libfirm */ - //enter in global list: + /* enter in global list: */ dtree->next = trees; trees = dtree; } @@ -257,6 +256,7 @@ static bs_t _get_mask (dt_t *dt, int index) /* Set the bit mask for a block */ +#if 0 static void _set_mask (dt_t*, int, bs_t); static void set_mask (dt_t *dt, ir_node *block, bs_t mask) { @@ -265,11 +265,11 @@ static void set_mask (dt_t *dt, ir_node *block, bs_t mask) # ifdef DEBUG_libfirm assert (dt && "no dt"); assert (block && "no block"); -# endif /* def DEBUG_libfirm */ + # endif /* def DEBUG_libfirm */ _set_mask (dt, index, mask); } - +#endif /* Set the bit mask for a block index */ @@ -285,11 +285,11 @@ static void _set_mask (dt_t *dt, int index, bs_t mask) /* Update the list of dominators of a given block */ -typedef struct dt_walk_env_t // grrr +typedef struct dt_walk_env_t { - dt_t *dt; // the dominator relation we're building - ir_node *start_block; // need to know the start block of this graph - bool changed; // wether the relation has changed recently + dt_t *dt; /* the dominator relation we're building */ + ir_node *start_block; /* need to know the start block of this graph */ + bool changed; /* wether the relation has changed recently */ } dt_walk_env_t; @@ -308,20 +308,20 @@ static void update_dominators (ir_node *block, void *env) bs_t old_mask = _get_mask (dt, block_index); bs_t new_mask = ~0x00000000; - // Special handling of Start Block: + /* Special handling of Start Block: */ if (block == w->start_block) return; - // check preds: + /* check preds: */ for (i = 0; i < n_ins; i ++) - { - ir_node *in = get_nodes_Block (get_irn_n (block, i)); // hope that's the block - bs_t in_mask = get_mask (dt, in); + { + ir_node *in = get_nodes_Block (get_irn_n (block, i)); + bs_t in_mask = get_mask (dt, in); - new_mask &= in_mask; - } + new_mask &= in_mask; + } - // and remember ourselves: + /* and remember ourselves: */ new_mask |= (0x00000001 << block_index); if (new_mask != old_mask) @@ -360,14 +360,15 @@ static ir_node *_get_idom (dt_t *dt, ir_node *block) if (0 != (idom = dt->idoms [block_index])) return (idom); - // check all CFG preds: - // Question: Shouldn't it be good enough to just ask our first CFG predecessor? + /* check all CFG preds: + Question: Shouldn't it be good enough to just ask our first CFG + predecessor? */ { int i = 0; int n = get_irn_arity (block); ir_node *pred = 0; - idom = block; // prime the loop: + idom = block; /* prime the loop: */ for (i = 0; i < n; i ++) { @@ -390,15 +391,15 @@ static ir_node *_get_idom (dt_t *dt, ir_node *block) block, idom); # endif /* def VERBOSE_libfirm */ - // remember it: + /* remember it: */ dt->idoms [block_index] = idom; return (idom); } -// -------------------------------------------------------------------- -// Public Functions -// -------------------------------------------------------------------- +/* -------------------------------------------------------------------- +** Public Functions +** -------------------------------------------------------------------- */ /* Say wether a dominates b @@ -497,16 +498,16 @@ void build_dominator_tree (ir_graph *graph) fprintf (stdout, "%s: for graph(%p)\n", __FILE__ ":" __PRETTY_FUNCTION__, graph); # endif /* def VERBOSE_libfirm */ - //if (0 != dt) - //free_dt (dt); + /*if (0 != dt) + free_dt (dt); */ dt = new_dt (graph); w->dt = dt; - w->start_block = start_block; // grrr - w->changed = TRUE; // at least one walk + w->start_block = start_block; + w->changed = TRUE; /* at least one walk */ - // do the walk: + /* do the walk: */ { int walks = 0; diff --git a/ir/st/st.h b/ir/st/st.h index 81da246a6..20ca8b0e5 100644 --- a/ir/st/st.h +++ b/ir/st/st.h @@ -1,4 +1,4 @@ -// Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved +/* Copyright (c) 2002 by Universität Karlsruhe (TH). All Rights Reserved */ /*** NAME @@ -16,7 +16,7 @@ # ifndef _ST_H_ # define _ST_H_ -// Includes: +/* Includes: */ # include "irgraph.h" # include "irnode.h" @@ -27,20 +27,20 @@ #define true TRUE #define false FALSE -// Data Types: +/* Data Types: */ -// One dominator tree +/* One dominator tree */ typedef struct { int n_blocks; - ir_graph *graph; // PRE + ir_graph *graph; /* PRE */ ir_node **blocks; - ir_node **idoms; // idom [n] == immediate dominator of blocks [n] + ir_node **idoms; /* idom [n] == immediate dominator of blocks [n] */ bs_t *masks; } dt_t; -// List entry: +/* List entry: */ typedef struct dtree_t { dt_t *tree; @@ -50,7 +50,7 @@ typedef struct dtree_t } dtree_t; -// dominator environment for a node @a in graph @graph +/* dominator environment for a node @a in graph @graph */ typedef struct dom_env_t { dt_t *dt; @@ -60,11 +60,11 @@ typedef struct dom_env_t bs_t mask; } dom_env_t; -// Forwards for Globals: +/* Forwards for Globals: */ extern dtree_t *trees; extern dtree_t *last; -// Prototypes: +/* Prototypes: */ void st_build_dominator_tree (ir_graph*); bool dominates (ir_graph*, ir_node*, ir_node*); ir_node *get_idom (ir_graph*, ir_node*); diff --git a/ir/tr/entity.c b/ir/tr/entity.c index 818602338..c4bbdf10c 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -36,7 +36,7 @@ init_entity (void) /** ENTITY **/ /*******************************************************************/ -inline void insert_entity_in_owner (entity *ent) { +INLINE void insert_entity_in_owner (entity *ent) { type *owner = ent->owner; switch (get_type_tpop_code(owner)) { case tpo_class: { @@ -96,7 +96,7 @@ new_entity (type *owner, ident *name, type *type) insert_entity_in_owner (res); return res; } -inline void free_entity_attrs(entity *ent) { +INLINE void free_entity_attrs(entity *ent) { assert(ent); DEL_ARR_F(ent->overwrites); DEL_ARR_F(ent->overwrittenby); @@ -136,7 +136,7 @@ copy_entity_name (entity *old, ident *new_name) { return new; } -inline const char * +INLINE const char * get_entity_name (entity *ent) { assert (ent); return id_to_str(get_entity_ident(ent)); @@ -153,18 +153,18 @@ void set_entitye_ld_name (entity *, char *ld_name); void set_entity_ld_ident (entity *, ident *ld_ident); */ -inline type * +INLINE type * get_entity_owner (entity *ent) { return ent->owner = skip_tid(ent->owner); } -inline void +INLINE void set_entity_owner (entity *ent, type *owner) { assert_legal_owner_of_ent(owner); ent->owner = owner; } -inline void /* should this go into type.c? */ +INLINE void /* should this go into type.c? */ assert_legal_owner_of_ent(type *owner) { assert (get_type_tpop_code(owner) == tpo_class || get_type_tpop_code(owner) == tpo_union || @@ -173,7 +173,7 @@ assert_legal_owner_of_ent(type *owner) { -- to select fields! */ } -inline ident * +INLINE ident * get_entity_ld_ident (entity *ent) { if (ent->ld_name == NULL) @@ -181,12 +181,12 @@ get_entity_ld_ident (entity *ent) return ent->ld_name; } -inline void +INLINE void set_entity_ld_ident (entity *ent, ident *ld_ident) { ent->ld_name = ld_ident; } -inline const char * +INLINE const char * get_entity_ld_name (entity *ent) { return id_to_str(get_entity_ld_ident(ent)); } @@ -196,45 +196,45 @@ char *get_entity_ld_name (entity *); void set_entity_ld_name (entity *, char *ld_name); */ -inline type * +INLINE type * get_entity_type (entity *ent) { return ent->type = skip_tid(ent->type); } -inline void +INLINE void set_entity_type (entity *ent, type *type) { ent->type = type; } -inline ent_allocation +INLINE ent_allocation get_entity_allocation (entity *ent) { return ent->allocation; } -inline void +INLINE void set_entity_allocation (entity *ent, ent_allocation al) { ent->allocation = al; } -inline ent_visibility +INLINE ent_visibility get_entity_visibility (entity *ent) { return ent->visibility; } -inline void +INLINE void set_entity_visibility (entity *ent, ent_visibility vis) { if (vis != local) assert(ent->allocation == static_allocated); ent->visibility = vis; } -inline ent_variability +INLINE ent_variability get_entity_variability (entity *ent) { return ent->variability; } -inline void +INLINE void set_entity_variability (entity *ent, ent_variability var){ if (var == part_constant) assert(is_class_type(ent->type) || is_struct_type(ent->type)); @@ -254,24 +254,23 @@ set_entity_variability (entity *ent, ent_variability var){ } -inline ent_volatility +INLINE ent_volatility get_entity_volatility (entity *ent) { return ent->volatility; } -inline void +INLINE void set_entity_volatility (entity *ent, ent_volatility vol) { ent->volatility = vol; } -inline peculiarity +INLINE peculiarity get_entity_peculiarity (entity *ent) { assert (ent); - //assert (is_method_type(ent->type)); return ent->peculiarity; } -inline void +INLINE void set_entity_peculiarity (entity *ent, peculiarity pec) { assert (ent); assert (is_method_type(ent->type)); @@ -279,14 +278,14 @@ set_entity_peculiarity (entity *ent, peculiarity pec) { } /* Set has no effect for entities of type method. */ -inline ir_node * +INLINE ir_node * get_atomic_ent_value(entity *ent) { assert(ent); assert(is_atomic_entity(ent)); assert((ent->variability != uninitialized)); return ent->value; } -inline void +INLINE void set_atomic_ent_value(entity *ent, ir_node *val) { assert(ent && is_atomic_entity(ent) && (ent->variability != uninitialized)); if (is_method_type(ent->type)) return; @@ -321,7 +320,7 @@ ir_node *copy_atomic_ent_value(entity *ent) { /* A value of a compound entity is a pair of value and the corresponding member of the compound. */ -inline void +INLINE void add_compound_ent_value(entity *ent, ir_node *val, entity *member) { assert(ent && is_compound_entity(ent) && (ent->variability != uninitialized)); ARR_APP1 (ir_node *, ent->values, val); @@ -331,7 +330,7 @@ add_compound_ent_value(entity *ent, ir_node *val, entity *member) { /* Copies the firm subgraph referenced by val to const_code_irg and adds the node as constant initialization to ent. The subgraph may not contain control flow operations. */ -inline void +INLINE void copy_and_add_compound_ent_value(entity *ent, ir_node *val, entity *member) { ir_graph *rem = current_ir_graph; @@ -343,13 +342,13 @@ copy_and_add_compound_ent_value(entity *ent, ir_node *val, entity *member) { current_ir_graph = rem; } -inline int +INLINE int get_compound_ent_n_values(entity *ent) { assert(ent && is_compound_entity(ent) && (ent->variability != uninitialized)); return (ARR_LEN (ent->values))-1; } -inline ir_node * +INLINE ir_node * get_compound_ent_value(entity *ent, int pos) { assert(ent && is_compound_entity(ent) && (ent->variability != uninitialized)); return ent->values[pos+1]; @@ -362,13 +361,13 @@ copy_compound_ent_value(entity *ent, int pos) { return copy_const_value(ent->values[pos+1]); } -inline entity * +INLINE entity * get_compound_ent_value_member(entity *ent, int pos) { assert(ent && is_compound_entity(ent) && (ent->variability != uninitialized)); return ent->val_ents[pos+1]; } -inline void +INLINE void set_compound_ent_value(entity *ent, ir_node *val, entity *member, int pos) { assert(ent && is_compound_entity(ent) && (ent->variability != uninitialized)); ent->values[pos+1] = val; @@ -397,17 +396,17 @@ set_array_entity_values(entity *ent, tarval **values, int num_vals) { current_ir_graph = rem; } -inline int +INLINE int get_entity_offset (entity *ent) { return ent->offset; } -inline void +INLINE void set_entity_offset (entity *ent, int offset) { ent->offset = offset; } -inline void +INLINE void add_entity_overwrites (entity *ent, entity *overwritten) { assert(ent); assert(is_class_type(get_entity_owner(ent))); @@ -415,14 +414,14 @@ add_entity_overwrites (entity *ent, entity *overwritten) { ARR_APP1 (entity *, overwritten->overwrittenby, ent); } -inline int +INLINE int get_entity_n_overwrites (entity *ent) { assert(ent); assert(is_class_type(get_entity_owner(ent))); return (ARR_LEN (ent->overwrites))-1; } -inline entity * +INLINE entity * get_entity_overwrites (entity *ent, int pos) { assert(ent); assert(is_class_type(get_entity_owner(ent))); @@ -430,7 +429,7 @@ get_entity_overwrites (entity *ent, int pos) { return ent->overwrites[pos+1]; } -inline void +INLINE void set_entity_overwrites (entity *ent, int pos, entity *overwritten) { assert(ent); assert(is_class_type(get_entity_owner(ent))); @@ -438,21 +437,21 @@ set_entity_overwrites (entity *ent, int pos, entity *overwritten) { ent->overwrites[pos+1] = overwritten; } -inline void +INLINE void add_entity_overwrittenby (entity *ent, entity *overwrites) { assert(ent); assert(is_class_type(get_entity_owner(ent))); add_entity_overwrites(overwrites, ent); } -inline int +INLINE int get_entity_n_overwrittenby (entity *ent) { assert(ent); assert(is_class_type(get_entity_owner(ent))); return (ARR_LEN (ent->overwrittenby))-1; } -inline entity * +INLINE entity * get_entity_overwrittenby (entity *ent, int pos) { assert(ent); assert(is_class_type(get_entity_owner(ent))); @@ -460,7 +459,7 @@ get_entity_overwrittenby (entity *ent, int pos) { return ent->overwrittenby[pos+1]; } -inline void +INLINE void set_entity_overwrittenby (entity *ent, int pos, entity *overwrites) { assert(ent); assert(is_class_type(get_entity_owner(ent))); @@ -481,14 +480,14 @@ set_entity_link(entity *ent, void *l) { ent->link = l; } -inline ir_graph * +INLINE ir_graph * get_entity_irg(entity *ent) { assert (ent); assert (is_method_type(ent->type)); return ent->irg; } -inline void +INLINE void set_entity_irg(entity *ent, ir_graph *irg) { assert (ent && ent->type); /* Wie kann man die Referenz auf einen IRG löschen, z.B. wenn die diff --git a/ir/tr/entity.h b/ir/tr/entity.h index 7b01bc077..4f918543c 100644 --- a/ir/tr/entity.h +++ b/ir/tr/entity.h @@ -152,7 +152,7 @@ void set_entity_ld_name (entity *ent, char *ld_name); type *get_entity_owner (entity *ent); /* Sets the owner field in entity to owner. */ void set_entity_owner (entity *ent, type *owner); -inline void assert_legal_owner_of_ent(type *owner); +INLINE void assert_legal_owner_of_ent(type *owner); type *get_entity_type (entity *ent); void set_entity_type (entity *ent, type *type); diff --git a/ir/tr/type.c b/ir/tr/type.c index 25c9c833c..089235325 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -48,7 +48,7 @@ unsigned long type_visited; -inline type * +INLINE type * new_type(tp_op *type_op, ir_mode *mode, ident* name) { type *res; int node_size ; @@ -267,7 +267,7 @@ type *new_type_class (ident *name) { return res; } -inline void free_class_attrs(type *clss) { +INLINE void free_class_attrs(type *clss) { assert(clss && (clss->type_op == type_class)); DEL_ARR_F(clss->attr.ca.members); DEL_ARR_F(clss->attr.ca.subtypes); @@ -387,11 +387,11 @@ void remove_class_supertype(type *clss, type *supertype) { } } -inline peculiarity get_class_peculiarity (type *clss) { +INLINE peculiarity get_class_peculiarity (type *clss) { assert(clss && (clss->type_op == type_class)); return clss->attr.ca.peculiarity; } -inline void set_class_peculiarity (type *clss, peculiarity pec) { +INLINE void set_class_peculiarity (type *clss, peculiarity pec) { assert(clss && (clss->type_op == type_class)); clss->attr.ca.peculiarity = pec; } @@ -423,7 +423,7 @@ type *new_type_struct (ident *name) { res->attr.sa.members = NEW_ARR_F (entity *, 1); return res; } -inline void free_struct_attrs (type *strct) { +INLINE void free_struct_attrs (type *strct) { assert(strct && (strct->type_op == type_struct)); DEL_ARR_F(strct->attr.sa.members); } @@ -483,7 +483,7 @@ type *new_type_method (ident *name, int n_param, int n_res) { res->attr.ma.res_type = (type **) xmalloc (sizeof (type *) * n_res); return res; } -inline void free_method_attrs(type *method) { +INLINE void free_method_attrs(type *method) { assert(method && (method->type_op == type_method)); free(method->attr.ma.param_type); free(method->attr.ma.res_type); @@ -539,7 +539,7 @@ type *new_type_uni (ident *name) { res->attr.ua.members = NEW_ARR_F (entity *, 1); return res; } -inline void free_union_attrs (type *uni) { +INLINE void free_union_attrs (type *uni) { assert(uni && (uni->type_op == type_union)); DEL_ARR_F(uni->attr.ua.members); } @@ -639,7 +639,7 @@ type *new_type_array (ident *name, int n_dimensions, return res; } -inline void free_array_attrs (type *array) { +INLINE void free_array_attrs (type *array) { assert(array && (array->type_op == type_array)); free(array->attr.aa.lower_bound); free(array->attr.aa.upper_bound); @@ -746,7 +746,7 @@ type *new_type_enumeration (ident *name, int n_enums) { return res; } -inline void free_enumeration_attrs(type *enumeration) { +INLINE void free_enumeration_attrs(type *enumeration) { assert(enumeration && (enumeration->type_op == type_enumeration)); free(enumeration->attr.ea.enumer); free(enumeration->attr.ea.enum_nameid); @@ -802,7 +802,7 @@ type *new_type_pointer (ident *name, type *points_to) { res->state = layout_fixed; return res; } -inline void free_pointer_attrs (type *pointer) { +INLINE void free_pointer_attrs (type *pointer) { assert(pointer && (pointer->type_op == type_pointer)); } /* manipulate fields of type_pointer */ @@ -835,7 +835,7 @@ type *new_type_primitive (ident *name, ir_mode *mode) { res->state = layout_fixed; return res; } -inline void free_primitive_attrs (type *primitive) { +INLINE void free_primitive_attrs (type *primitive) { assert(primitive && (primitive->type_op == type_primitive)); } @@ -850,12 +850,12 @@ bool is_primitive_type (type *primitive) { /*******************************************************************/ -inline int is_atomic_type(type *tp) { +INLINE int is_atomic_type(type *tp) { assert(tp && tp->kind == k_type); return (is_primitive_type(tp) || is_pointer_type(tp) || is_enumeration_type(tp)); } -inline int is_compound_type(type *tp) { +INLINE int is_compound_type(type *tp) { assert(tp && tp->kind == k_type); return (is_class_type(tp) || is_struct_type(tp) || is_array_type(tp) || is_union_type(tp)); diff --git a/ir/tr/type.h b/ir/tr/type.h index 0f2afbcd9..a82877cae 100644 --- a/ir/tr/type.h +++ b/ir/tr/type.h @@ -287,8 +287,8 @@ typedef enum peculiarity { /* The peculiarity of the class. The enumeration peculiarity is defined in entity.h */ -inline peculiarity get_class_peculiarity (type *clss); -inline void set_class_peculiarity (type *clss, peculiarity pec); +INLINE peculiarity get_class_peculiarity (type *clss); +INLINE void set_class_peculiarity (type *clss, peculiarity pec); /* Set and get a class' dfn */ void set_class_dfn (type*, int); diff --git a/ir/tr/type_t.h b/ir/tr/type_t.h index b6e790a32..b070c335f 100644 --- a/ir/tr/type_t.h +++ b/ir/tr/type_t.h @@ -128,20 +128,20 @@ struct type { * initalized. The type is in state layout_undefined. *** */ -inline type * +INLINE type * new_type(tp_op *type_op, ir_mode *mode, ident* name); void free_type_attrs (type *tp); -inline void free_class_attrs (type *clss); -inline void free_struct_attrs (type *strct); -inline void free_method_attrs (type *method); -inline void free_union_attrs (type *uni); -inline void free_array_attrs (type *array); -inline void free_enumeration_attrs(type *enumeration); -inline void free_pointer_attrs (type *pointer); -inline void free_primitive_attrs (type *primitive); +INLINE void free_class_attrs (type *clss); +INLINE void free_struct_attrs (type *strct); +INLINE void free_method_attrs (type *method); +INLINE void free_union_attrs (type *uni); +INLINE void free_array_attrs (type *array); +INLINE void free_enumeration_attrs(type *enumeration); +INLINE void free_pointer_attrs (type *pointer); +INLINE void free_primitive_attrs (type *primitive); # endif /* _TYPE_T_H_ */ diff --git a/ir/tr/typegmod.c b/ir/tr/typegmod.c index 553ad2967..a3cf5e1f4 100644 --- a/ir/tr/typegmod.c +++ b/ir/tr/typegmod.c @@ -12,7 +12,7 @@ # include "tpop_t.h" # include "irmode.h" -inline void exchange_types(type *old_type, type *new_type) { +INLINE void exchange_types(type *old_type, type *new_type) { /* Deallocate datastructures not directly contained in the old type. We must do this now as it is the latest point where we know the original kind of type. @@ -36,7 +36,7 @@ inline void exchange_types(type *old_type, type *new_type) { old_type->mode = (ir_mode *) new_type; } -inline type *skip_tid(type *tp) { +INLINE type *skip_tid(type *tp) { while (tp->type_op == type_id) tp = (type *) tp->mode; return tp; diff --git a/ir/tr/typegmod.h b/ir/tr/typegmod.h index d751f297d..9b862482e 100644 --- a/ir/tr/typegmod.h +++ b/ir/tr/typegmod.h @@ -37,7 +37,7 @@ * this will be at considerable runtime cost. *** */ -inline void exchange_types(type *old_type, type *new_type); +INLINE void exchange_types(type *old_type, type *new_type); /****f* tpop/skip_tid * @@ -52,6 +52,6 @@ inline void exchange_types(type *old_type, type *new_type); * If tp is an id type retruns the real type it stands for. *** */ -inline type *skip_tid(type *tp); +INLINE type *skip_tid(type *tp); # endif /*_TYPEGMOD_H_ */ diff --git a/ir/tv/tv.c b/ir/tv/tv.c index e0b825fba..934584bb2 100644 --- a/ir/tv/tv.c +++ b/ir/tv/tv.c @@ -57,6 +57,10 @@ static pset *tarvals; /* pset containing pointers to _all_ tarvals */ /* currently building an object with tarval_start() & friends ? */ #define BUILDING obstack_object_size (&tv_obst) +/* bcopy is not ISO C */ +#define bcopy(X, Y, Z) memcpy((Y), (X), (Z)) + + /* special tarvals: */ tarval *tarval_bad; tarval *tarval_b_false; @@ -140,7 +144,7 @@ tv_val_s (tarval *tv) /* Overflows `chil' signed integral `mode'? */ -static inline bool +static INLINE bool chil_overflow (tarval_chil chil, ir_mode *mode) { assert (is_chilCHIL(get_mode_modecode(mode))); @@ -151,7 +155,7 @@ chil_overflow (tarval_chil chil, ir_mode *mode) /* Overflows `CHIL' unsigned integral `mode'? */ -static inline bool +static INLINE bool CHIL_overflow (tarval_CHIL CHIL, ir_mode *mode) { assert (is_chilCHIL(get_mode_modecode(mode))); @@ -531,7 +535,7 @@ tarval_B_from_str (const char *s, size_t len) if (b >= 8) { /* we've accumulated at least a byte */ char c = x & 0xFF; /* extract the lower 8 bits from x */ - obstack_grow (&tv_obst, &c, 1); /* and stuff them into B */ + obstack_grow (&tv_obst, &c, 1); /* and stuff them into B */ x >>= 8; /* remove the lower 8 bits from x */ b -= 8; /* x now contains 8 bits fewer */ ++n; /* B grew a byte */ @@ -1696,7 +1700,8 @@ tarval_print (XP_PAR1, const xprintf_info *info ATTRIBUTE((unused)), XP_PARN) case irm_c: /* signed char */ case irm_C: /* unsigned char */ - if (isprint (val->u.chil)) { + if ((isprint (val->u.chil)) && + (val->u.chil != '\\') && (val->u.chil != '\'')) { printed = XPF1R ("'%c'", val->u.chil); } else { printed = XPF1R ("0x%x", (unsigned long)val->u.chil); diff --git a/testprograms/oo_inline_example.c b/testprograms/oo_inline_example.c index ebddd011a..2821b88da 100644 --- a/testprograms/oo_inline_example.c +++ b/testprograms/oo_inline_example.c @@ -282,7 +282,7 @@ main(void) current_ir_graph = main_irg; printf("Inlining set_a ...\n"); inline_method(set_a_call, set_a_irg); - printf("Inlineing c ...\n"); + printf("INLINEing c ...\n"); inline_method(c_call, c_irg); printf("Optimizing ...\n"); -- 2.20.1