diff options
author | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-23 21:43:48 +0000 |
---|---|---|
committer | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-23 21:43:48 +0000 |
commit | 9cfaa86b8d0a7f410c902fdb462ad478278d47ef (patch) | |
tree | 26c43945bac86361efe2fc80e60c524097e50dee | |
parent | 7d60cc603c75cb116460c7cc446891bae4462cb2 (diff) |
This commit was manufactured by cvs2svn to create tagbefore-merge-HEAD-csl-arm-1
'before-merge-HEAD-csl-arm-1'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/before-merge-HEAD-csl-arm-1@74984 138bc75d-0d04-0410-961f-82ee72b054a4
113 files changed, 2973 insertions, 21759 deletions
diff --git a/boehm-gc/install-sh b/boehm-gc/install-sh index 398a88e1421..e9de23842dc 100755 --- a/boehm-gc/install-sh +++ b/boehm-gc/install-sh @@ -109,7 +109,7 @@ then echo "install: no input file specified" exit 1 else - : + true fi if [ x"$dir_arg" != x ]; then @@ -120,7 +120,7 @@ if [ x"$dir_arg" != x ]; then instcmd=: chmodcmd="" else - instcmd=$mkdirprog + instcmd=mkdir fi else @@ -130,7 +130,7 @@ else if [ -f $src -o -d $src ] then - : + true else echo "install: $src does not exist" exit 1 @@ -141,7 +141,7 @@ else echo "install: no destination specified" exit 1 else - : + true fi # If destination is a directory, append the input filename; if your system @@ -151,7 +151,7 @@ else then dst="$dst"/`basename $src` else - : + true fi fi @@ -163,8 +163,8 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' +defaultIFS=' +' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" @@ -183,7 +183,7 @@ while [ $# -ne 0 ] ; do then $mkdirprog "${pathcomp}" else - : + true fi pathcomp="${pathcomp}/" @@ -194,10 +194,10 @@ if [ x"$dir_arg" != x ] then $doit $instcmd $dst && - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. @@ -216,7 +216,7 @@ else then dstfile=`basename $dst` else - : + true fi # Make a temp file name in the proper directory. @@ -235,10 +235,10 @@ else # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. diff --git a/boehm-gc/libtool.m4 b/boehm-gc/libtool.m4 index 066bf6a5ce6..c857149a9d6 100644 --- a/boehm-gc/libtool.m4 +++ b/boehm-gc/libtool.m4 @@ -1,6 +1,5 @@ -# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- -## Copyright 1996, 1997, 1998, 1999, 2000, 2001 -## Free Software Foundation, Inc. +## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*- +## Copyright (C) 1996-1999 Free Software Foundation, Inc. ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 ## ## This program is free software; you can redistribute it and/or modify @@ -22,68 +21,85 @@ ## configuration script generated by Autoconf, you may include it under ## the same distribution terms that you use for the rest of that program. -# serial 46 AC_PROG_LIBTOOL - -AC_DEFUN([AC_PROG_LIBTOOL], +# serial 40 AC_PROG_LIBTOOL +AC_DEFUN(AC_PROG_LIBTOOL, [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +# Save cache, so that ltconfig can load it +AC_CACHE_SAVE + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ +|| AC_MSG_ERROR([libtool configure failed]) + +# Reload cache, that may have been modified by ltconfig +AC_CACHE_LOAD + # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log ]) -AC_DEFUN([AC_LIBTOOL_SETUP], +AC_DEFUN(AC_LIBTOOL_SETUP, [AC_PREREQ(2.13)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl dnl -_LT_AC_PROG_ECHO_BACKSLASH -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; esac -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +# Check for any special flags to pass to ltconfig. +# +# the following will cause an existing older ltconfig to fail, so +# we ignore this at the expense of the cache file... Checking this +# will just take longer ... bummer! +#libtool_flags="--cache-file=$cache_file" +# +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], +[libtool_flags="$libtool_flags --enable-dlopen"]) ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - +[libtool_flags="$libtool_flags --enable-win32-dll"]) AC_ARG_ENABLE(libtool-lock, [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" # Some flags need to be propagated to the compiler or linker for good # libtool support. -case $host in +case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" ;; @@ -103,10 +119,7 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_SAVE - AC_LANG_C - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_RESTORE]) + [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" @@ -114,2889 +127,33 @@ case $host in ;; ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) +[*-*-cygwin* | *-*-mingw*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one - AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, - [AC_TRY_LINK([], - [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); - DllMain (0, 0, 0);], - [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) - - case $host/$CC in - *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) - # old mingw systems require "-dll" to link a DLL, while more recent ones - # require "-mdll" - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mdll" - AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, - [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) - CFLAGS="$SAVE_CFLAGS" ;; - *-*-cygwin* | *-*-pw32*) - # cygwin systems need to pass --dll to the linker, and not link - # crt.o which will require a WinMain@16 definition. - lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; - esac ;; - ]) -esac - -_LT_AC_LTCONFIG_HACK - ]) - -# AC_LIBTOOL_HEADER_ASSERT -# ------------------------ -AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], -[AC_CACHE_CHECK([whether $CC supports assert without backlinking], - [lt_cv_func_assert_works], - [case $host in - *-*-solaris*) - if test "$GCC" = yes && test "$with_gnu_ld" != yes; then - case `$CC --version 2>/dev/null` in - [[12]].*) lt_cv_func_assert_works=no ;; - *) lt_cv_func_assert_works=yes ;; - esac - fi - ;; - esac]) - -if test "x$lt_cv_func_assert_works" = xyes; then - AC_CHECK_HEADERS(assert.h) -fi -])# AC_LIBTOOL_HEADER_ASSERT - -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h) -])# _LT_AC_CHECK_DLFCN - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix*) - symcode='[[BCDEGRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $host_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[[ABCDGISTW]]' -fi - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Write the raw and C identifiers. -lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - rm -f conftest* - cat > conftest.$ac_ext <<EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat <<EOF > conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' - - cat <<EOF >> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[[]] = -{ -EOF - sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if AC_TRY_EVAL(ac_link) && test -s conftest; then - pipe_works=yes - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AC_FD_CC - fi - else - echo "cannot find nm_test_var in $nlist" >&AC_FD_CC - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC - fi - else - echo "$progname: failed program was:" >&AC_FD_CC - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" -if test -z "$lt_cv_sys_global_symbol_pipe"; then - global_symbol_to_cdecl= - global_symbol_to_c_name_address= -else - global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" - global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" -fi -if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; -then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - -# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR -# --------------------------------- -AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], -[# Find the correct PATH separator. Usually this is `:', but -# DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) lt_cv_sys_path_separator=';' ;; - *) lt_cv_sys_path_separator=':' ;; - esac - PATH_SEPARATOR=$lt_cv_sys_path_separator -fi -])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR - -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit 0 -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -AC_DIVERT_POP -])# _LT_AC_PROG_ECHO_BACKSLASH - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[if test "$cross_compiling" = yes; then : - [$4] -else - AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF -[#line __oline__ "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - -# AC_LIBTOOL_DLOPEN_SELF -# ------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - cygwin* | mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - -AC_DEFUN([_LT_AC_LTCONFIG_HACK], -[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" -need_locks="$enable_libtool_lock" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -if test x"$host" != x"$build"; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case $host_os in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` esac - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="[$]2" - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([for objdir]) -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -AC_MSG_RESULT($objdir) -## -## END FIXME - - -## FIXME: this should be a separate macro -## -AC_ARG_WITH(pic, -[ --with-pic try to use only PIC/non-PIC objects [default=use both]], -pic_mode="$withval", pic_mode=default) -test -z "$pic_mode" && pic_mode=default - -# We assume here that the value for lt_cv_prog_cc_pic will not be cached -# in isolation, and that seeing it set (from the cache) indicates that -# the associated values are set (in the cache) correctly too. -AC_MSG_CHECKING([for $compiler option to produce PIC]) -AC_CACHE_VAL(lt_cv_prog_cc_pic, -[ lt_cv_prog_cc_pic= - lt_cv_prog_cc_shlib= - lt_cv_prog_cc_wl= - lt_cv_prog_cc_static= - lt_cv_prog_cc_no_builtin= - lt_cv_prog_cc_can_build_shared=$can_build_shared - - if test "$GCC" = yes; then - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-static' - - case $host_os in - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # not sure about C++ programs. - lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_cv_prog_cc_pic='-fno-common' - ;; - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_cv_prog_cc_pic=-Kconform_pic - fi - ;; - *) - lt_cv_prog_cc_pic='-fPIC' - ;; - esac - else - # PORTME Check for PIC flags for the system compiler. - case $host_os in - aix3* | aix4* | aix5*) - lt_cv_prog_cc_wl='-Wl,' - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' - else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better lt_cv_prog_cc_static that works with the bundled CC? - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" - lt_cv_prog_cc_pic='+Z' - ;; - - irix5* | irix6*) - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - - newsos6) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - ;; - - sco3.2v5*) - lt_cv_prog_cc_pic='-Kpic' - lt_cv_prog_cc_static='-dn' - lt_cv_prog_cc_shlib='-belf' - ;; - - solaris*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Wl,' - ;; - - sunos4*) - lt_cv_prog_cc_pic='-PIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - if test "x$host_vendor" = xsni; then - lt_cv_prog_cc_wl='-LD' - else - lt_cv_prog_cc_wl='-Wl,' - fi - ;; - - uts4*) - lt_cv_prog_cc_pic='-pic' - lt_cv_prog_cc_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_cv_prog_cc_pic='-Kconform_pic' - lt_cv_prog_cc_static='-Bstatic' - fi - ;; - - *) - lt_cv_prog_cc_can_build_shared=no - ;; - esac - fi -]) -if test -z "$lt_cv_prog_cc_pic"; then - AC_MSG_RESULT([none]) -else - AC_MSG_RESULT([$lt_cv_prog_cc_pic]) - - # Check to make sure the pic_flag actually works. - AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) - AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" - AC_TRY_COMPILE([], [], [dnl - case $host_os in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then - # they create non-PIC objects. So, if there were any warnings, we - # assume that PIC is not supported. - if test -s conftest.err; then - lt_cv_prog_cc_pic_works=no - else - lt_cv_prog_cc_pic_works=yes - fi - ;; - *) - lt_cv_prog_cc_pic_works=yes - ;; - esac - ], [dnl - lt_cv_prog_cc_pic_works=no - ]) - CFLAGS="$save_CFLAGS" - ]) - - if test "X$lt_cv_prog_cc_pic_works" = Xno; then - lt_cv_prog_cc_pic= - lt_cv_prog_cc_can_build_shared=no - else - lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" - fi - - AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) -fi -## -## END FIXME - -# Check for any special shared library compilation flags. -if test -n "$lt_cv_prog_cc_shlib"; then - AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) - lt_cv_prog_cc_can_build_shared=no - fi -fi - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) -AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl - lt_cv_prog_cc_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" - AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) - LDFLAGS="$save_LDFLAGS" ]) -# Belt *and* braces to stop my trousers falling down: -test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= -AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) - -pic_flag="$lt_cv_prog_cc_pic" -special_shlib_compile_flags="$lt_cv_prog_cc_shlib" -wl="$lt_cv_prog_cc_wl" -link_static_flag="$lt_cv_prog_cc_static" -no_builtin_flag="$lt_cv_prog_cc_no_builtin" -can_build_shared="$lt_cv_prog_cc_can_build_shared" -## -## END FIXME - - -## FIXME: this should be a separate macro -## -# Check to see if options -o and -c are simultaneously supported by compiler -AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) -AC_CACHE_VAL([lt_cv_compiler_c_o], [ -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -echo "int some_variable = 0;" > conftest.$ac_ext -mkdir out -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -# that will create temporary files in the current directory regardless of -# the output directory. Thus, making CWD read-only will cause this test -# to fail, enabling locking or at least warning the user not to do parallel -# builds. -chmod -w . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" -compiler_c_o=no -if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - lt_cv_compiler_c_o=no - else - lt_cv_compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&AC_FD_CC - lt_cv_compiler_c_o=no -fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null -]) -compiler_c_o=$lt_cv_compiler_c_o -AC_MSG_RESULT([$compiler_c_o]) - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) - AC_CACHE_VAL([lt_cv_compiler_o_lo], [ - lt_cv_compiler_o_lo=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - save_objext="$ac_objext" - ac_objext=lo - AC_TRY_COMPILE([], [int some_variable = 0;], [dnl - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - lt_cv_compiler_o_lo=no - else - lt_cv_compiler_o_lo=yes - fi - ]) - ac_objext="$save_objext" - CFLAGS="$save_CFLAGS" - ]) - compiler_o_lo=$lt_cv_compiler_o_lo - AC_MSG_RESULT([$compiler_o_lo]) -else - compiler_o_lo=no -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Check to see if we can do hard links to lock some files if needed -hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -if test "$GCC" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) - echo "int some_variable = 0;" > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" - compiler_rtti_exceptions=no - AC_TRY_COMPILE([], [int some_variable = 0;], [dnl - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - compiler_rtti_exceptions=no - else - compiler_rtti_exceptions=yes - fi - ]) - CFLAGS="$save_CFLAGS" - AC_MSG_RESULT([$compiler_rtti_exceptions]) - - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi -fi -## -## END FIXME - -## FIXME: this should be a separate macro -## -# See if the linker supports building shared libraries. -AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) - -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -old_archive_from_expsyms_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_into_libs=no -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -link_all_deplibs=unknown -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. -extract_expsyms_cmds= - -case $host_os in -cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; -openbsd*) - with_gnu_ld=no - ;; -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX, the GNU linker is very broken - # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. - ld_shlibs=no - cat <<EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ - sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ - test -f $output_objdir/impgen.exe || (cd $output_objdir && \ - if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ - else $CC -o impgen impgen.c ; fi)~ - $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' - - # cygwin and mingw dlls have different entry points and sets of symbols - # to exclude. - # FIXME: what about values for MSVC? - dll_entry=__cygwin_dll_entry@12 - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ - case $host_os in - mingw*) - # mingw values - dll_entry=_DllMainCRTStartup@12 - dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ - ;; - esac - - # mingw and cygwin differ, and it's simplest to just exclude the union - # of the two symbol sets. - dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one (in ltdll.c) - if test "x$lt_cv_need_dllmain" = "xyes"; then - ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " - ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ - test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' - else - ltdll_obj= - ltdll_cmds= - fi - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left be newer dlltools. - export_symbols_cmds="$ltdll_cmds"' - $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' - - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is. - # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; - else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \[$]# in - 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; - fi~ - '"$ltdll_cmds"' - $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ - $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ - $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw* | pw32*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - hardcode_direct=yes - archive_cmds='' - hardcode_libdir_separator=':' - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - shared_flag='${wl}-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall can do strange things, so it is better to - # generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='${wl}-berok' - # This is a bit strange, but is similar to how AIX traditionally builds - # it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - ;; - - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[[012]]) - allow_undefined_flag='-undefined suppress' - ;; - *) # Darwin 1.3 on - allow_undefined_flag='-flat_namespace -undefined suppress' - ;; - esac - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' - # We need to add '_' to the symbols in $export_symbols first - #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' - hardcode_direct=yes - hardcode_shlibpath_var=no - whole_archive_flag_spec='-all_load $convenience' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case $host_os in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case "$host_os" in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - #Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - export_dynamic_flag_spec='${wl}-Bexport' - ;; - - solaris*) - # gcc --version < 3.0 without binutils cannot create self contained - # shared libraries reliably, requiring libgcc.a to resolve some of - # the object symbols generated in some cases. Libraries that use - # assert need libgcc.a to resolve __eprintf, for example. Linking - # a copy of libgcc.a into every shared library to guarantee resolving - # such symbols causes other problems: According to Tim Van Holder - # <tim.van.holder@pandora.be>, C++ libraries end up with a separate - # (to the application) exception stack for one thing. - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - case `$CC --version 2>/dev/null` in - [[12]].*) - cat <<EOF 1>&2 - -*** Warning: Releases of GCC earlier than version 3.0 cannot reliably -*** create self contained shared libraries on Solaris systems, without -*** introducing a dependency on libgcc.a. Therefore, libtool is disabling -*** -no-undefined support, which will at least allow you to build shared -*** libraries. However, you may find that when you link such libraries -*** into an application without using GCC, you have to manually add -*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to -*** upgrade to a newer version of GCC. Another option is to rebuild your -*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. - -EOF - no_undefined_flag= - ;; - esac - fi - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - if test "x$host_vendor" = xsno; then - archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - else - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5uw7* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi -AC_MSG_RESULT([$ld_shlibs]) -test "$ld_shlibs" = no && can_build_shared=no -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Check hardcoding attributes. -AC_MSG_CHECKING([how to hardcode library paths into programs]) -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -AC_MSG_RESULT([$hardcode_action]) -## -## END FIXME - -## FIXME: this should be a separate macro -## -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi -## -## END FIXME - -reload_cmds='$LD$reload_flag -o $output$reload_objs' -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -## FIXME: this should be a separate macro -## -# PORTME Fill in your ld.so characteristics -AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' - ;; - -aix4* | aix5*) - version_type=linux - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can - # not hardcode correct soname into executable. Probably we can - # add versioning support to collect2, so additional links can - # be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}.so$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}.so' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi4*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - need_version=no - need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin*) - library_names_spec='$libname.dll.a' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' - postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog .libs/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - ;; - yes,mingw*) - library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - ;; - *) - library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' - soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - *) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - dynamic_linker="$host_os dld.sl" - version_type=sunos - need_lib_prefix=no - need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -irix5* | irix6*) - version_type=irix - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' - case $host_os in - irix5*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux-gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case "$host_os" in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - ;; - -os2*) - libname_spec='$name' - need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no -## -## END FIXME - -## FIXME: this should be a separate macro -## -# Report the final consequences. -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) -## -## END FIXME - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case "$host_os" in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) -## -## END FIXME - -## FIXME: this should be a separate macro -## -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) -## -## END FIXME - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -AC_LIBTOOL_DLOPEN_SELF - -## FIXME: this should be a separate macro -## -if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], - [$rm conftest* - echo 'static int dummy;' > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile); then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_cv_prog_cc_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi]) - AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) - ;; - esac -fi -need_lc=${lt_cv_archive_cmds_need_lc-yes} -## -## END FIXME - -## FIXME: this should be a separate macro -## -# The second clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - : -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - test -f Makefile && make "$ltmain" -fi - -if test -f "$ltmain"; then - trap "$rm \"${ofile}T\"; exit 1" 1 2 15 - $rm -f "${ofile}T" - - echo creating $ofile - - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS \ - AR AR_FLAGS CC LD LN_S NM SHELL \ - reload_flag reload_cmds wl \ - pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ - thread_safe_flag_spec whole_archive_flag_spec libname_spec \ - library_names_spec soname_spec \ - RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ - old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \ - postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \ - old_striplib striplib file_magic_cmd export_symbols_cmds \ - deplibs_check_method allow_undefined_flag no_undefined_flag \ - finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ - global_symbol_to_c_name_address \ - hardcode_libdir_flag_spec hardcode_libdir_separator \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do - - case $var in - reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ - extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - cat <<__EOF__ > "${ofile}T" -#! $SHELL - -# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996-2000 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="sed -e s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi - -# ### BEGIN LIBTOOL CONFIG - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$need_lc - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# The default C compiler. -CC=$lt_CC - -# Is the compiler the GNU C compiler? -with_gcc=$GCC - -# The linker used to build libraries. -LD=$lt_LD - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_pic_flag -pic_mode=$pic_mode - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_compiler_c_o - -# Can we write directly to a .lo ? -compiler_o_lo=$lt_compiler_o_lo - -# Must we lock files when doing compilation ? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_link_static_flag - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# ### END LIBTOOL CONFIG - -__EOF__ - - case $host_os in - aix3*) - cat <<\EOF >> "${ofile}T" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - case $host_os in - cygwin* | mingw* | pw32* | os2*) - cat <<'EOF' >> "${ofile}T" - # This is a source program that is used to create dlls on Windows - # Don't remove nor modify the starting and closing comments -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include <windows.h> -# #undef WIN32_LEAN_AND_MEAN -# #include <stdio.h> -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include <cygwin/cygwin_dll.h> -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ - # This is a source program that is used to create import libraries - # on Windows for dlls which lack them. Don't remove nor modify the - # starting and closing comments -# /* impgen.c starts here */ -# /* Copyright (C) 1999-2000 Free Software Foundation, Inc. -# -# This file is part of GNU libtool. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# */ -# -# #include <stdio.h> /* for printf() */ -# #include <unistd.h> /* for open(), lseek(), read() */ -# #include <fcntl.h> /* for O_RDONLY, O_BINARY */ -# #include <string.h> /* for strdup() */ -# -# /* O_BINARY isn't required (or even defined sometimes) under Unix */ -# #ifndef O_BINARY -# #define O_BINARY 0 -# #endif -# -# static unsigned int -# pe_get16 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[2]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 2); -# return b[0] + (b[1]<<8); -# } -# -# static unsigned int -# pe_get32 (fd, offset) -# int fd; -# int offset; -# { -# unsigned char b[4]; -# lseek (fd, offset, SEEK_SET); -# read (fd, b, 4); -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# static unsigned int -# pe_as32 (ptr) -# void *ptr; -# { -# unsigned char *b = ptr; -# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); -# } -# -# int -# main (argc, argv) -# int argc; -# char *argv[]; -# { -# int dll; -# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; -# unsigned long export_rva, export_size, nsections, secptr, expptr; -# unsigned long name_rvas, nexp; -# unsigned char *expdata, *erva; -# char *filename, *dll_name; -# -# filename = argv[1]; -# -# dll = open(filename, O_RDONLY|O_BINARY); -# if (dll < 1) -# return 1; -# -# dll_name = filename; -# -# for (i=0; filename[i]; i++) -# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') -# dll_name = filename + i +1; -# -# pe_header_offset = pe_get32 (dll, 0x3c); -# opthdr_ofs = pe_header_offset + 4 + 20; -# num_entries = pe_get32 (dll, opthdr_ofs + 92); -# -# if (num_entries < 1) /* no exports */ -# return 1; -# -# export_rva = pe_get32 (dll, opthdr_ofs + 96); -# export_size = pe_get32 (dll, opthdr_ofs + 100); -# nsections = pe_get16 (dll, pe_header_offset + 4 +2); -# secptr = (pe_header_offset + 4 + 20 + -# pe_get16 (dll, pe_header_offset + 4 + 16)); -# -# expptr = 0; -# for (i = 0; i < nsections; i++) -# { -# char sname[8]; -# unsigned long secptr1 = secptr + 40 * i; -# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); -# unsigned long vsize = pe_get32 (dll, secptr1 + 16); -# unsigned long fptr = pe_get32 (dll, secptr1 + 20); -# lseek(dll, secptr1, SEEK_SET); -# read(dll, sname, 8); -# if (vaddr <= export_rva && vaddr+vsize > export_rva) -# { -# expptr = fptr + (export_rva - vaddr); -# if (export_rva + export_size > vaddr + vsize) -# export_size = vsize - (export_rva - vaddr); -# break; -# } -# } -# -# expdata = (unsigned char*)malloc(export_size); -# lseek (dll, expptr, SEEK_SET); -# read (dll, expdata, export_size); -# erva = expdata - export_rva; -# -# nexp = pe_as32 (expdata+24); -# name_rvas = pe_as32 (expdata+32); -# -# printf ("EXPORTS\n"); -# for (i = 0; i<nexp; i++) -# { -# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); -# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); -# } -# -# return 0; -# } -# /* impgen.c ends here */ - -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1) - - mv -f "${ofile}T" "$ofile" || \ - (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") - chmod +x "$ofile" -fi -## -## END FIXME - -])# _LT_AC_LTCONFIG_HACK - # AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN(AC_ENABLE_SHARED, [dnl +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(shared, changequote(<<, >>)dnl << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case $enableval in +case "$enableval" in yes) enable_shared=yes ;; no) enable_shared=no ;; *) @@ -3015,22 +172,21 @@ enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl ]) # AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no)]) # AC_ENABLE_STATIC - implement the --enable-static flag # Usage: AC_ENABLE_STATIC[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN(AC_ENABLE_STATIC, [dnl +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(static, changequote(<<, >>)dnl << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case $enableval in +case "$enableval" in yes) enable_static=yes ;; no) enable_static=no ;; *) @@ -3049,8 +205,7 @@ enable_static=AC_ENABLE_STATIC_DEFAULT)dnl ]) # AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no)]) @@ -3058,14 +213,14 @@ AC_ENABLE_STATIC(no)]) # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to # `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE(fast-install, changequote(<<, >>)dnl << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], changequote([, ])dnl [p=${PACKAGE-default} -case $enableval in +case "$enableval" in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) @@ -3083,120 +238,29 @@ esac], enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl ]) -# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no)]) -# AC_LIBTOOL_PICMODE - implement the --with-pic flag -# Usage: AC_LIBTOOL_PICMODE[(MODE)] -# Where MODE is either `yes' or `no'. If omitted, it defaults to -# `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default)]) - - -# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in - /*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; - ?:/*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. - ;; - *) - ac_save_MAGIC_CMD="$MAGIC_CMD" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - egrep "$file_magic_regex" > /dev/null; then - : - else - cat <<EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$ac_save_ifs" - MAGIC_CMD="$ac_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -]) - - -# AC_PATH_MAGIC - find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl -AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) - else - MAGIC_CMD=: - fi -fi -]) - - # AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], +AC_DEFUN(AC_PROG_LD, [AC_ARG_WITH(gnu-ld, [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl ac_prog=ld -if test "$GCC" = yes; then +if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in # Accept absolute paths. - [[\\/]]* | [[A-Za-z]]:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' +changequote(,)dnl + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' +changequote([,])dnl # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do @@ -3218,17 +282,17 @@ elif test "$with_gnu_ld" = yes; then else AC_MSG_CHECKING([for non-GNU ld]) fi -AC_CACHE_VAL(lt_cv_path_LD, +AC_CACHE_VAL(ac_cv_path_LD, [if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" + ac_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then test "$with_gnu_ld" != no && break else test "$with_gnu_ld" != yes && break @@ -3237,9 +301,9 @@ AC_CACHE_VAL(lt_cv_path_LD, done IFS="$ac_save_ifs" else - lt_cv_path_LD="$LD" # Let the user override the test with a path. + ac_cv_path_LD="$LD" # Let the user override the test with a path. fi]) -LD="$lt_cv_path_LD" +LD="$ac_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else @@ -3249,252 +313,56 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_PROG_LD_GNU ]) -# AC_PROG_LD_GNU - -AC_DEFUN([AC_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +AC_DEFUN(AC_PROG_LD_GNU, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then - lt_cv_prog_gnu_ld=yes + ac_cv_prog_gnu_ld=yes else - lt_cv_prog_gnu_ld=no + ac_cv_prog_gnu_ld=no fi]) -with_gnu_ld=$lt_cv_prog_gnu_ld ]) -# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], -[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, -[lt_cv_ld_reload_flag='-r']) -reload_flag=$lt_cv_ld_reload_flag -test -n "$reload_flag" && reload_flag=" $reload_flag" -]) - -# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], -[AC_CACHE_CHECK([how to recognise dependant libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given egrep regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi4*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin* | mingw* | pw32*) - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd='/usr/bin/file -L' - case "$host_os" in - rhapsody* | darwin1.[[012]]) - lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` - ;; - *) # Darwin 1.3 on - lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' - ;; - esac - ;; - -freebsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20*|hpux11*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - -irix5* | irix6*) - case $host_os in - irix5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" - ;; - *) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" - ;; - esac - lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux-gnu*) - case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; - esac - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -openbsd*) - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' - else - lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' - fi - ;; - -osf3* | osf4* | osf5*) - # this will be overridden with pass_all, but let us keep it just in case - lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' - lt_cv_file_magic_test_file=/shlib/libc.so - lt_cv_deplibs_check_method=pass_all - ;; - -sco3.2v5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - lt_cv_file_magic_test_file=/lib/libc.so - ;; - -sysv5uw[[78]]* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - esac - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -]) - - # AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl -AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(lt_cv_path_NM, +AC_DEFUN(AC_PROG_NM, +[AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(ac_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. - lt_cv_path_NM="$NM" + ac_cv_path_NM="$NM" else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/${ac_tool_prefix}nm - if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then - lt_cv_path_NM="$tmp_nm -B" + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" break - elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - lt_cv_path_NM="$tmp_nm -p" + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" break else - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags fi fi done IFS="$ac_save_ifs" - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm fi]) -NM="$lt_cv_path_NM" +NM="$ac_cv_path_NM" AC_MSG_RESULT([$NM]) ]) # AC_CHECK_LIBM - check for math library -AC_DEFUN([AC_CHECK_LIBM], +AC_DEFUN(AC_CHECK_LIBM, [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32*) +case "$lt_target" in +*-*-beos* | *-*-cygwin*) # These system don't have libm ;; *-ncr-sysv4.3*) @@ -3508,39 +376,33 @@ esac ]) # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-convenience to the -# configure arguments. Note that LIBLTDL and INCLTDL are not -# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not -# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed -# with '${top_builddir}/' and INCLTDL will be prefixed with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in +# the libltdl convenience library, adds --enable-ltdl-convenience to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case "$enable_ltdl_convenience" in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) ]) # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library and INCLTDL to the include flags for -# the libltdl header and adds --enable-ltdl-install to the configure -# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is -# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed -# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will -# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed -# with '${top_srcdir}/' (note the single quotes!). If your package is -# not flat and you're not using automake, define top_builddir and -# top_srcdir appropriately in the Makefiles. +# the libltdl installable library, and adds --enable-ltdl-install to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, main, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then @@ -3551,8 +413,8 @@ AC_DEFUN([AC_LIBLTDL_INSTALLABLE], ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" @@ -3560,14 +422,14 @@ AC_DEFUN([AC_LIBLTDL_INSTALLABLE], fi ]) -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) +dnl old names +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl + +dnl This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL])dnl diff --git a/boehm-gc/mkinstalldirs b/boehm-gc/mkinstalldirs index f9c37afd1b8..cc8783edce3 100755 --- a/boehm-gc/mkinstalldirs +++ b/boehm-gc/mkinstalldirs @@ -2,90 +2,29 @@ # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman <friedman@prep.ai.mit.edu> # Created: 1993-05-16 +# Last modified: 1994-03-25 # Public domain -# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ - errstatus=0 -dirmode="" - -usage="\ -Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." - -# process command line arguments -while test $# -gt 0 ; do - case "${1}" in - -h | --help | --h* ) # -h for help - echo "${usage}" 1>&2; exit 0 ;; - -m ) # -m PERM arg - shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - dirmode="${1}" - shift ;; - -- ) shift; break ;; # stop option processing - -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option - * ) break ;; # first non-opt arg - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in -0) exit 0 ;; -esac -case $dirmode in -'') - if mkdir -p -- . 2>/dev/null; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - fi ;; -*) - if mkdir -m "$dirmode" -p -- . 2>/dev/null; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - fi ;; -esac - -for file -do +for file in ${1+"$@"} ; do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= - for d - do + for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - - lasterr="" - chmod "$dirmode" "$pathcomp" || lasterr=$? + echo "mkdir $pathcomp" 1>&2 + mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? + fi - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi + if test ! -d "$pathcomp"; then + errstatus=$lasterr fi pathcomp="$pathcomp/" @@ -94,8 +33,4 @@ done exit $errstatus -# Local Variables: -# mode: shell-script -# sh-indentation: 3 -# End: # mkinstalldirs ends here diff --git a/fastjar/.cvsignore b/fastjar/.cvsignore deleted file mode 100644 index 67c7a2e782d..00000000000 --- a/fastjar/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -fastjar.info -grepjar.1 -jar.1 diff --git a/fastjar/install-sh b/fastjar/install-sh deleted file mode 100755 index c719342656f..00000000000 --- a/fastjar/install-sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/bash - -. install-defs.sh - -$CP fastjar ${BINDIR} -$STRIP ${BINDIR}/fastjar -$CHMOD 755 ${BINDIR}/fastjar - diff --git a/fastjar/missing b/fastjar/missing deleted file mode 100755 index 7789652e877..00000000000 --- a/fastjar/missing +++ /dev/null @@ -1,190 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. -# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -case "$1" in - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - - aclocal) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`configure.in'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`configure.in'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`configure.in'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case "$f" in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - bison|yacc) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if [ ! -f y.tab.h ]; then - echo >y.tab.h - fi - if [ ! -f y.tab.c ]; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex|flex) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if [ $# -ne 1 ]; then - eval LASTARG="\${$#}" - case "$LASTARG" in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if [ ! -f lex.yy.c ]; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - makeinfo) - echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` - if test -z "$file"; then - file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` - fi - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 diff --git a/fastjar/mkinstalldirs b/fastjar/mkinstalldirs deleted file mode 100755 index d2d5f21b611..00000000000 --- a/fastjar/mkinstalldirs +++ /dev/null @@ -1,111 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman <friedman@prep.ai.mit.edu> -# Created: 1993-05-16 -# Public domain - -errstatus=0 -dirmode="" - -usage="\ -Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." - -# process command line arguments -while test $# -gt 0 ; do - case $1 in - -h | --help | --h*) # -h for help - echo "$usage" 1>&2 - exit 0 - ;; - -m) # -m PERM arg - shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } - dirmode=$1 - shift - ;; - --) # stop option processing - shift - break - ;; - -*) # unknown option - echo "$usage" 1>&2 - exit 1 - ;; - *) # first non-opt arg - break - ;; - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in - 0) exit 0 ;; -esac - -case $dirmode in - '') - if mkdir -p -- . 2>/dev/null; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - fi - ;; - *) - if mkdir -m "$dirmode" -p -- . 2>/dev/null; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - fi - ;; -esac - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case $pathcomp in - -*) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - lasterr="" - chmod "$dirmode" "$pathcomp" || lasterr=$? - - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# End: -# mkinstalldirs ends here diff --git a/fastjar/stamp-h.in b/fastjar/stamp-h.in deleted file mode 100644 index 9788f70238c..00000000000 --- a/fastjar/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e62f2451f43..7b645b2fa04 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,169 @@ +2003-12-23 Zack Weinberg <zack@codesourcery.com> + Nathan Sidwell <nathan@codesourcery.com> + Mark Mitchell <mark@codesourcery.com> + + * collect2.c (windows.h): Include. + (dup2): Remove. + (handler): Change prototype. + (unhandled_filter): New funciton. + (install_handlers): Likewise. + (disable_break): Likewise. + (enable_break): Likewise. + (main): Call install_handlers rather than signal directly. + (collect_execute): Use pexec. + (scan_prog_file): Likewise. + (scan_libraries): Likewise. + +2003-12-19 Paul Brook <paul@codesourcery.com> + + * config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify + insn patterns to match. + * config/arm/arm-generic.md: Ditto. + * config/arm/cirrus.md: Ditto. + * config/arm/fpa.md: Ditto. + * config/amm/iwmmxt.md: Ditto. + * config/arm/arm1026ejs.md: Ditto. + * config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses + for 11_loadb. + +2003-12-18 Nathan Sidwell <nathan@codesourcery.com> + + * config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare. + * config/arm/arm.c (arm_adjust_cost): Check shift cost for + TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG. + (arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep, + arm_no_early_mul_dep): Correctly deal with conditional execution, + parallels and single shift operations. + (arm_no_early_alu_shift_value_dep): Define. + * arm.md (attr type): Replace 'normal' with 'alu', + 'alu_shift' and 'alu_shift_reg'. + (attr core_cycles): Adjust. + (*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3, + *shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0, + *not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp, + *cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0, + *arith_shiftsi_compare0_scratch, *sub_shiftsi, + *sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch, + *if_shift_move, *if_move_shift, *if_shift_shift): Set type + attribute appropriately. + * config/arm/arm1026ejs.md (alu_op): Adjust. + (alu_shift_op, alu_shift_reg_op): New. + * config/arm/arm1136.md: Add better bypasses for early + registers. Remove load[234] and store[234] bypasses. + (11_alu_op): Adjust. + (11_alu_shift_op, 11_alu_shift_reg_op): New. + +2003-12-15 Nathan Sidwell <nathan@codesourcery.com> + + * config/arm/arm-protos.h (arm_no_early_store_addr_dep, + arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare. + * config/arm/arm.c (arm_no_early_store_addr_dep, + arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define. + * config/arm/arm1026ejs.md: Add load-store bypass. + * config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles. + Add bypasses between instructions. + +2003-12-10 Paul Brook <paul@codesourcery.com> + + * config/arm/arm.c (arm_fpu_model): New variable. + (arm_fload_abi): New variable. + (target_fpe_name): Rename from target_fp_name. + (target_fpu_name): New variable. + (arm_is_cirrus): Remove. + (fpu_desc): New struct. + (all_fpus): Define. + (pf_model_for_fpu): Define. + (all_loat_abis): Define. + (arm_override_options): Set fp arch flags based on -mfpu= + and -float-abi=. + (FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM. + (LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM. + (*): Use new TARGET_* flags. + * config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove. + (TARGET_HARD_FLOAT): No longer implies TARGET_FPA. + (TARGET_SOFT_FLOAT): Ditto. + (TARGET_SOFT_FLOAT_ABI): New. + (TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies + TARGET_HARD_FLOAT. + (TARGET_VFP): No longer implies TARGET_HARD_FLOAT. + (TARGET_OPTIONS): Add -mfpu=. + (FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM. + (LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM. + (arm_pf_model): Define. + (arm_float_abi_type): Define. + (fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE + * config/arm/arm.md: Use new TARGET_* flags. + * config/arm/cirrus.md: Ditto. + * config/arm/fpa.md: Ditto. + * config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=. + * config/arm/semi.h (ASM_SPEC): Ditto. + * config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp. + (FPUTYPE_DEFAULT): Set to VFP. + * doc/invoke.texi: Document -mfpu= and -mfloat-abi=. + +2003-11-22 Phil Edwards <phil@codesourcery.com> + + PR target/12476 + * config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use + 'bx' instead of 'b' to avoid branch range restrictions. Output + the thunk immediately before the thunked-to function. + * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit + .thumb_func if a thunk is being generated. Emit .code 16 along + with .thumb_func if a thunk is not being generated. + +2003-11-15 Nicolas Pitre <nico@cam.org> + + * config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3, + arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns. + * config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3. + (lshrdi3_iwmmxt): Renamed from lshrdi3. + * config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly. + +2003-11-12 Steve Woodford <scw@wasabisystems.com> + Ian Lance Taylor <ian@wasabisystems.com> + + * config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new + code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__). + +2003-11-05 Phil Edwards <phil@codesourcery.com> + + * config/arm/arm.md (insn): Add new V6 instruction names. + (generic_sched): New attr. + * config/arm/arm-generic.md: Use generic_sched here. + * config/arm/arm1026ejs.md: Do not model fetch/issue/decode + stages of pipeline. Adjust latency counts accordingly. + * config/arm/arm1136jfs.md: New file. + +2003-11-05 Mark Mitchell <mark@codesourcery.com> + + * calls.c (initialize_argument_information): Add CALL_FROM_THUNK_P + parameter. Use it instead of current_function_is_thunk. + * function.h (struct function): Update documentation for is_thunk. + * tree.h (CALL_FROM_THUNK_P): New macro. + * config/alpha/alpha.c (alpha_sa_mask): Do not check + no_new_pseudos when testing current_function_is_thunk. + * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Likeiwse. + +2003-10-28 Mark Mitchell <mark@codesourcery.com> + + * config/arm/arm.h (processor_type): New enumeration type. + (CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S, + ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores. + (CPP_CPU_ARCH_SPEC): Likewise. + * config/arm/arm.c (arm_tune): New variable. + (all_cores): Use cores.def. + (all_architectures): Add representative processor. + (arm_override_options): Restructure way in which tuning + information is deduced. + * arm.md: Update "insn" and "type" attributes throughout. + (insn): New attribute. + (type): Compute "mult" from "insn" attribute. Add load2, + load3, load4 alternatives. + (arm automaton): Move to arm-generic.md. + * config/arm/arm-cores.def: New file. + * config/arm/arm-generic.md: Likewise. + * config/arm/arm1026ejs.md: Likewise. + 2003-10-26 Daniel Berlin <dberlin@dberlin.org> * ggc-zone.c: New file, zone allocating collector. @@ -455,7 +621,6 @@ * c-pch.c (struct c_pch_validity): Add pch_init field. (pch_init): Set it. (c_common_valid_pch): Check it. - (get_ident): Bump the PCH version number. 2003-10-22 David Taylor <dtaylor@emc.com> diff --git a/gcc/ada/.cvsignore b/gcc/ada/.cvsignore deleted file mode 100644 index 2ff143dfe88..00000000000 --- a/gcc/ada/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -gnat_ug_unx.info* -gnat_ug_vms.info* -gnat_ug_vxw.info* -gnat_ug_wnt.info* -gnat_rm.info* -gnat-style.info* diff --git a/gcc/ada/5lintman.adb b/gcc/ada/5lintman.adb deleted file mode 100644 index 56871f3d9ec..00000000000 --- a/gcc/ada/5lintman.adb +++ /dev/null @@ -1,401 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T -- --- -- --- B o d y -- --- -- --- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2003, Ada Core Technologies -- --- -- --- GNARL is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNARL; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- This is the GNU/Linux version of this package - --- This file performs the system-dependent translation between machine --- exceptions and the Ada exceptions, if any, that should be raised when they --- occur. This version works for the x86 running linux. - --- This is a Sun OS (FSU THREADS) version of this package - --- PLEASE DO NOT add any dependences on other packages. ??? why not ??? --- This package is designed to work with or without tasking support. - --- Make a careful study of all signals available under the OS, to see which --- need to be reserved, kept always unmasked, or kept always unmasked. Be on --- the lookout for special signals that may be used by the thread library. - --- The definitions of "reserved" differ slightly between the ARM and POSIX. --- Here is the ARM definition of reserved interrupt: - --- The set of reserved interrupts is implementation defined. A reserved --- interrupt is either an interrupt for which user-defined handlers are not --- supported, or one which already has an attached handler by some other --- implementation-defined means. Program units can be connected to --- non-reserved interrupts. - --- POSIX.5b/.5c specifies further: - --- Signals which the application cannot accept, and for which the application --- cannot modify the signal action or masking, because the signals are --- reserved for use by the Ada language implementation. The reserved signals --- defined by this standard are Signal_Abort, Signal_Alarm, --- Signal_Floating_Point_Error, Signal_Illegal_Instruction, --- Signal_Segmentation_Violation, Signal_Bus_Error. If the implementation --- supports any signals besides those defined by this standard, the --- implementation may also reserve some of those. - --- The signals defined by POSIX.5b/.5c that are not specified as being --- reserved are SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGUSR1, SIGUSR2, --- SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGIO SIGURG, and all --- the real-time signals. - --- Beware of reserving signals that POSIX.5b/.5c require to be available for --- users. POSIX.5b/.5c say: - --- An implementation shall not impose restrictions on the ability of an --- application to send, accept, block, or ignore the signals defined by this --- standard, except as specified in this standard. - --- Here are some other relevant requirements from POSIX.5b/.5c: - --- For the environment task, the initial signal mask is that specified for --- the process... - --- It is anticipated that the paragraph above may be modified by a future --- revision of this standard, to require that the realtime signals always be --- initially masked for a process that is an Ada active partition. - --- For all other tasks, the initial signal mask shall include all the signals --- that are not reserved signals and are not bound to entries of the task. - -with Interfaces.C; --- used for int and other types - -with System.Error_Reporting; --- used for Shutdown - -with System.OS_Interface; --- used for various Constants, Signal and types - -with Ada.Exceptions; --- used for Exception_Id --- Raise_From_Signal_Handler - -with System.Soft_Links; --- used for Get_Machine_State_Addr - -with Unchecked_Conversion; - -package body System.Interrupt_Management is - - use Interfaces.C; - use System.Error_Reporting; - use System.OS_Interface; - - package TSL renames System.Soft_Links; - - type Interrupt_List is array (Interrupt_ID range <>) of Interrupt_ID; - Exception_Interrupts : constant Interrupt_List := - (SIGFPE, SIGILL, SIGSEGV); - - Unreserve_All_Interrupts : Interfaces.C.int; - pragma Import - (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts"); - - subtype int is Interfaces.C.int; - subtype unsigned_short is Interfaces.C.unsigned_short; - subtype unsigned_long is Interfaces.C.unsigned_long; - - ---------------------- - -- Notify_Exception -- - ---------------------- - - pragma Warnings (Off); - -- Because many unaccessed arguments - - Signal_Mask : aliased sigset_t; - -- The set of signals handled by Notify_Exception - - -- This function identifies the Ada exception to be raised using - -- the information when the system received a synchronous signal. - -- Since this function is machine and OS dependent, different code - -- has to be provided for different target. - - procedure Notify_Exception - (signo : Signal; - gs : unsigned_short; - fs : unsigned_short; - es : unsigned_short; - ds : unsigned_short; - edi : unsigned_long; - esi : unsigned_long; - ebp : unsigned_long; - esp : unsigned_long; - ebx : unsigned_long; - edx : unsigned_long; - ecx : unsigned_long; - eax : unsigned_long; - trapno : unsigned_long; - err : unsigned_long; - eip : unsigned_long; - cs : unsigned_short; - eflags : unsigned_long; - esp_at_signal : unsigned_long; - ss : unsigned_short; - fpstate : System.Address; - oldmask : unsigned_long; - cr2 : unsigned_long); - - procedure Notify_Exception - (signo : Signal; - gs : unsigned_short; - fs : unsigned_short; - es : unsigned_short; - ds : unsigned_short; - edi : unsigned_long; - esi : unsigned_long; - ebp : unsigned_long; - esp : unsigned_long; - ebx : unsigned_long; - edx : unsigned_long; - ecx : unsigned_long; - eax : unsigned_long; - trapno : unsigned_long; - err : unsigned_long; - eip : unsigned_long; - cs : unsigned_short; - eflags : unsigned_long; - esp_at_signal : unsigned_long; - ss : unsigned_short; - fpstate : System.Address; - oldmask : unsigned_long; - cr2 : unsigned_long) - is - pragma Warnings (On); - - function To_Machine_State_Ptr is new - Unchecked_Conversion (Address, Machine_State_Ptr); - - -- These are not directly visible - - procedure Raise_From_Signal_Handler - (E : Ada.Exceptions.Exception_Id; - M : System.Address); - pragma Import - (Ada, Raise_From_Signal_Handler, - "ada__exceptions__raise_from_signal_handler"); - pragma No_Return (Raise_From_Signal_Handler); - - mstate : Machine_State_Ptr; - message : aliased constant String := "" & ASCII.Nul; - -- A null terminated String. - - Result : int; - - begin - - -- Raise_From_Signal_Handler makes sure that the exception is raised - -- safely from this signal handler. - - -- ??? The original signal mask (the one we had before coming into this - -- signal catching function) should be restored by - -- Raise_From_Signal_Handler. For now, restore it explicitely - - Result := pthread_sigmask (SIG_UNBLOCK, Signal_Mask'Access, null); - pragma Assert (Result = 0); - - -- Check that treatment of exception propagation here - -- is consistent with treatment of the abort signal in - -- System.Task_Primitives.Operations. - - mstate := To_Machine_State_Ptr (TSL.Get_Machine_State_Addr.all); - mstate.eip := eip; - mstate.ebx := ebx; - mstate.esp := esp_at_signal; - mstate.ebp := ebp; - mstate.esi := esi; - mstate.edi := edi; - - case signo is - when SIGFPE => - Raise_From_Signal_Handler - (Constraint_Error'Identity, message'Address); - when SIGILL => - Raise_From_Signal_Handler - (Constraint_Error'Identity, message'Address); - when SIGSEGV => - Raise_From_Signal_Handler - (Storage_Error'Identity, message'Address); - when others => - if Shutdown ("Unexpected signal") then - null; - end if; - end case; - end Notify_Exception; - - --------------------------- - -- Initialize_Interrupts -- - --------------------------- - - -- Nothing needs to be done on this platform. - - procedure Initialize_Interrupts is - begin - null; - end Initialize_Interrupts; - -begin - declare - act : aliased struct_sigaction; - old_act : aliased struct_sigaction; - Result : int; - - function State (Int : Interrupt_ID) return Character; - pragma Import (C, State, "__gnat_get_interrupt_state"); - -- Get interrupt state. Defined in a-init.c - -- The input argument is the interrupt number, - -- and the result is one of the following: - - User : constant Character := 'u'; - Runtime : constant Character := 'r'; - Default : constant Character := 's'; - -- 'n' this interrupt not set by any Interrupt_State pragma - -- 'u' Interrupt_State pragma set state to User - -- 'r' Interrupt_State pragma set state to Runtime - -- 's' Interrupt_State pragma set state to System (use "default" - -- system handler) - - begin - -- Need to call pthread_init very early because it is doing signal - -- initializations. - - pthread_init; - - Abort_Task_Interrupt := SIGADAABORT; - - act.sa_handler := Notify_Exception'Address; - - act.sa_flags := 0; - - -- On some targets, we set sa_flags to SA_NODEFER so that during the - -- handler execution we do not change the Signal_Mask to be masked for - -- the Signal. - - -- This is a temporary fix to the problem that the Signal_Mask is - -- not restored after the exception (longjmp) from the handler. - -- The right fix should be made in sigsetjmp so that we save - -- the Signal_Set and restore it after a longjmp. - - -- Since SA_NODEFER is obsolete, instead we reset explicitely - -- the mask in the exception handler. - - Result := sigemptyset (Signal_Mask'Access); - pragma Assert (Result = 0); - - -- Add signals that map to Ada exceptions to the mask. - - for J in Exception_Interrupts'Range loop - if State (Exception_Interrupts (J)) /= Default then - Result := - sigaddset (Signal_Mask'Access, Signal (Exception_Interrupts (J))); - pragma Assert (Result = 0); - end if; - end loop; - - act.sa_mask := Signal_Mask; - - pragma Assert (Keep_Unmasked = (Interrupt_ID'Range => False)); - pragma Assert (Reserve = (Interrupt_ID'Range => False)); - - -- Process state of exception signals - - for J in Exception_Interrupts'Range loop - if State (Exception_Interrupts (J)) /= User then - Keep_Unmasked (Exception_Interrupts (J)) := True; - Reserve (Exception_Interrupts (J)) := True; - - if State (Exception_Interrupts (J)) /= Default then - Result := - sigaction - (Signal (Exception_Interrupts (J)), act'Unchecked_Access, - old_act'Unchecked_Access); - pragma Assert (Result = 0); - end if; - end if; - end loop; - - if State (Abort_Task_Interrupt) /= User then - Keep_Unmasked (Abort_Task_Interrupt) := True; - Reserve (Abort_Task_Interrupt) := True; - end if; - - -- Set SIGINT to unmasked state as long as it's - -- not in "User" state. Check for Unreserve_All_Interrupts last - - if State (SIGINT) /= User then - Keep_Unmasked (SIGINT) := True; - Reserve (SIGINT) := True; - end if; - - -- Check all signals for state that requires keeping them - -- unmasked and reserved - - for J in Interrupt_ID'Range loop - if State (J) = Default or else State (J) = Runtime then - Keep_Unmasked (J) := True; - Reserve (J) := True; - end if; - end loop; - - -- Add the set of signals that must always be unmasked for this target - - for J in Unmasked'Range loop - Keep_Unmasked (Interrupt_ID (Unmasked (J))) := True; - Reserve (Interrupt_ID (Unmasked (J))) := True; - end loop; - - -- Add target-specific reserved signals - - for J in Reserved'Range loop - Reserve (Interrupt_ID (Reserved (J))) := True; - end loop; - - -- Process pragma Unreserve_All_Interrupts. This overrides any - -- settings due to pragma Interrupt_State: - - if Unreserve_All_Interrupts /= 0 then - Keep_Unmasked (SIGINT) := False; - Reserve (SIGINT) := False; - end if; - - -- We do not have Signal 0 in reality. We just use this value - -- to identify non-existent signals (see s-intnam.ads). Therefore, - -- Signal 0 should not be used in all signal related operations hence - -- mark it as reserved. - - Reserve (0) := True; - end; -end System.Interrupt_Management; diff --git a/gcc/ada/5ytiitho.adb b/gcc/ada/5ytiitho.adb deleted file mode 100644 index f0027fd24e1..00000000000 --- a/gcc/ada/5ytiitho.adb +++ /dev/null @@ -1,66 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- S Y S T E M . T H R E A D S . I N I T I A L I Z A T I O N . -- --- I N I T I A L I Z E _ T A S K _ H O O K S -- --- -- --- B o d y -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- This is the VxWorks AE 653 version of this procedure - -separate (System.Threads.Initialization) - -procedure Initialize_Task_Hooks is - - -- When defining the following routines for export in an AE 1.1 - -- simulation of AE653, Interfaces.C.int may be used for the - -- parameters of FUNCPTR. - type FUNCPTR is access function (T : OSI.Thread_Id) return OSI.STATUS; - - -------------------------------- - -- Imported vThreads Routines -- - -------------------------------- - - procedure procCreateHookAdd (createHookFunction : FUNCPTR); - pragma Import (C, procCreateHookAdd, "procCreateHookAdd"); - -- Registers task registration routine for AE653 - - procedure procStartHookAdd (StartHookFunction : FUNCPTR); - pragma Import (C, procStartHookAdd, "procStartHookAdd"); - -- Registers task restart routine for AE653 - - Result : OSI.STATUS; -begin - -- Register the exported routines with the vThreads ARINC API - procCreateHookAdd (Register'Access); - procStartHookAdd (Reset_TSD'Access); - -- Register the environment task - Result := Register (OSI.taskIdSelf); - pragma Assert (Result /= -1); -end Initialize_Task_Hooks; diff --git a/gcc/ada/5zthrini.adb b/gcc/ada/5zthrini.adb deleted file mode 100644 index ded9a5118bb..00000000000 --- a/gcc/ada/5zthrini.adb +++ /dev/null @@ -1,113 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- S Y S T E M . T H R E A D S . I N I T I A L I Z A T I O N -- --- -- --- B o d y -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- This is the VxWorks version of this package; to use this implementation, --- the task hook libraries should be included in the VxWorks kernel. - -with System.Secondary_Stack; -with Interfaces.C; -with Unchecked_Conversion; - -package body System.Threads.Initialization is - - use Interfaces.C; - - package SSS renames System.Secondary_Stack; - - procedure Initialize_Task_Hooks; - -- Register the appropriate hooks (Register and Reset_TSD) to the - -- underlying OS, so that they will be called when a task is created - -- or reset. - - Current_ATSD : aliased System.Address; - pragma Import (C, Current_ATSD, "__gnat_current_atsd"); - - --------------------------- - -- Initialize_Task_Hooks -- - --------------------------- - - procedure Initialize_Task_Hooks is separate; - -- Separate, as these hooks are different for AE653 and VxWorks 5.5. - - -------------- - -- Register -- - -------------- - - function Register (T : OSI.Thread_Id) return OSI.STATUS is - TSD : ATSD_Access := new ATSD; - Result : OSI.STATUS; - begin - -- It cannot be assumed that the caller of this routine has a ATSD; - -- so neither this procedure nor the procedures that it calls should - -- raise or handle exceptions, or make use of a secondary stack. - - if OSI.taskIdVerify (T) = OSI.ERROR - or else OSI.taskVarGet (T, Current_ATSD'Access) /= OSI.ERROR - then - return OSI.ERROR; - end if; - - Result := OSI.taskVarAdd (T, Current_ATSD'Access); - pragma Assert (Result /= -1); - Result := OSI.taskVarSet (T, Current_ATSD'Access, TSD.all'Address); - pragma Assert (Result /= -1); - TSD.Sec_Stack_Addr := SSS.SS_Create; - SSS.SS_Init (TSD.Sec_Stack_Addr); - return Result; - end Register; - - --------------- - -- Reset_TSD -- - --------------- - - function Reset_TSD (T : OSI.Thread_Id) return OSI.STATUS is - TSD_Ptr : int; - function To_Address is new Unchecked_Conversion - (Interfaces.C.int, ATSD_Access); - begin - TSD_Ptr := OSI.taskVarGet (T, Current_ATSD'Access); - pragma Assert (TSD_Ptr /= OSI.ERROR); - - -- Just reset the secondary stack pointer. The implementation here - -- assumes that the fixed secondary stack implementation is used. - -- If not, there will be a memory leak (along with allocation, which - -- is prohibited for ARINC processes once the system enters "normal" - -- mode). - - SSS.SS_Init (To_Address (TSD_Ptr).Sec_Stack_Addr); - return OSI.OK; - end Reset_TSD; - -begin - Initialize_Task_Hooks; -end System.Threads.Initialization; diff --git a/gcc/ada/5ztiitho.adb b/gcc/ada/5ztiitho.adb deleted file mode 100644 index f5c60043dee..00000000000 --- a/gcc/ada/5ztiitho.adb +++ /dev/null @@ -1,52 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- S Y S T E M . T H R E A D S . I N I T I A L I Z A T I O N . -- --- I N I T I A L I Z E _ T A S K _ H O O K S -- --- -- --- B o d y -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- This is the VxWorks 5.5 version of this procedure - -separate (System.Threads.Initialization) - -procedure Initialize_Task_Hooks is - - type FUNCPTR is access function (T : OSI.Thread_Id) return OSI.STATUS; - - procedure taskCreateHookAdd (createHookFunction : FUNCPTR); - pragma Import (C, taskCreateHookAdd, "taskCreateHookAdd"); - - Result : OSI.STATUS; -begin - taskCreateHookAdd (Register'Access); - -- Register the environment task - Result := Register (OSI.taskIdSelf); - pragma Assert (Result /= -1); -end Initialize_Task_Hooks; diff --git a/gcc/ada/einfo.h b/gcc/ada/einfo.h deleted file mode 100644 index f9b0a8a41fa..00000000000 --- a/gcc/ada/einfo.h +++ /dev/null @@ -1,1814 +0,0 @@ -/*--------------------------------------------------------------------------*/ -/* */ -/* GNAT COMPILER COMPONENTS */ -/* */ -/* E I N F O */ -/* */ -/* C Header File */ -/* */ -/* Copyright (C) 1992-2003 Free Software Foundation, Inc. */ -/* */ -/* GNAT is free software; you can redistribute it and/or modify it under */ -/* terms of the GNU General Public License as published by the Free Soft- */ -/* ware Foundation; either version 2, or (at your option) any later ver- */ -/* sion. GNAT is distributed in the hope that it will be useful, but WITH- */ -/* OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY */ -/* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License */ -/* for more details. You should have received a copy of the GNU General */ -/* Public License distributed with GNAT; see file COPYING. If not, write */ -/* to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, */ -/* MA 02111-1307, USA. */ -/* */ -/* As a special exception, if other files instantiate generics from this */ -/* unit, or you link this unit with other files to produce an executable, */ -/* this unit does not by itself cause the resulting executable to be */ -/* covered by the GNU General Public License. This exception does not */ -/* however invalidate any other reasons why the executable file might be */ -/* covered by the GNU Public License. */ -/* */ -/* GNAT was originally developed by the GNAT team at New York University. */ -/* Extensive contributions were provided by Ada Core Technologies Inc. */ -/* */ -/*--------------------------------------------------------------------------*/ - - #define E_Void 0 - #define E_Variable 1 - #define E_Component 2 - #define E_Constant 3 - #define E_Discriminant 4 - #define E_Loop_Parameter 5 - #define E_In_Parameter 6 - #define E_Out_Parameter 7 - #define E_In_Out_Parameter 8 - #define E_Generic_In_Out_Parameter 9 - #define E_Generic_In_Parameter 10 - #define E_Named_Integer 11 - #define E_Named_Real 12 - #define E_Enumeration_Type 13 - #define E_Enumeration_Subtype 14 - #define E_Signed_Integer_Type 15 - #define E_Signed_Integer_Subtype 16 - #define E_Modular_Integer_Type 17 - #define E_Modular_Integer_Subtype 18 - #define E_Ordinary_Fixed_Point_Type 19 - #define E_Ordinary_Fixed_Point_Subtype 20 - #define E_Decimal_Fixed_Point_Type 21 - #define E_Decimal_Fixed_Point_Subtype 22 - #define E_Floating_Point_Type 23 - #define E_Floating_Point_Subtype 24 - #define E_Access_Type 25 - #define E_Access_Subtype 26 - #define E_Access_Attribute_Type 27 - #define E_Allocator_Type 28 - #define E_General_Access_Type 29 - #define E_Access_Subprogram_Type 30 - #define E_Access_Protected_Subprogram_Type 31 - #define E_Anonymous_Access_Type 32 - #define E_Array_Type 33 - #define E_Array_Subtype 34 - #define E_String_Type 35 - #define E_String_Subtype 36 - #define E_String_Literal_Subtype 37 - #define E_Class_Wide_Type 38 - #define E_Class_Wide_Subtype 39 - #define E_Record_Type 40 - #define E_Record_Subtype 41 - #define E_Record_Type_With_Private 42 - #define E_Record_Subtype_With_Private 43 - #define E_Private_Type 44 - #define E_Private_Subtype 45 - #define E_Limited_Private_Type 46 - #define E_Limited_Private_Subtype 47 - #define E_Incomplete_Type 48 - #define E_Task_Type 49 - #define E_Task_Subtype 50 - #define E_Protected_Type 51 - #define E_Protected_Subtype 52 - #define E_Exception_Type 53 - #define E_Subprogram_Type 54 - #define E_Enumeration_Literal 55 - #define E_Function 56 - #define E_Operator 57 - #define E_Procedure 58 - #define E_Entry 59 - #define E_Entry_Family 60 - #define E_Block 61 - #define E_Entry_Index_Parameter 62 - #define E_Exception 63 - #define E_Generic_Function 64 - #define E_Generic_Procedure 65 - #define E_Generic_Package 66 - #define E_Label 67 - #define E_Loop 68 - #define E_Package 69 - #define E_Package_Body 70 - #define E_Protected_Object 71 - #define E_Protected_Body 72 - #define E_Task_Body 73 - #define E_Subprogram_Body 74 - - SUBTYPE (Access_Kind, Entity_Kind, - E_Access_Type, E_Anonymous_Access_Type) - - SUBTYPE (Array_Kind, Entity_Kind, - E_Array_Type, E_String_Literal_Subtype) - - SUBTYPE (Class_Wide_Kind, Entity_Kind, - E_Class_Wide_Type, E_Class_Wide_Subtype) - - SUBTYPE (Composite_Kind, Entity_Kind, - E_Array_Type, E_Protected_Subtype) - - SUBTYPE (Concurrent_Kind, Entity_Kind, - E_Task_Type, E_Protected_Subtype) - - SUBTYPE (Concurrent_Body_Kind, Entity_Kind, - E_Protected_Body, E_Task_Body) - - SUBTYPE (Decimal_Fixed_Point_Kind, Entity_Kind, - E_Decimal_Fixed_Point_Type, E_Decimal_Fixed_Point_Subtype) - - SUBTYPE (Digits_Kind, Entity_Kind, - E_Decimal_Fixed_Point_Type, E_Floating_Point_Subtype) - - SUBTYPE (Discrete_Kind, Entity_Kind, - E_Enumeration_Type, E_Modular_Integer_Subtype) - - SUBTYPE (Discrete_Or_Fixed_Point_Kind, Entity_Kind, - E_Enumeration_Type, E_Decimal_Fixed_Point_Subtype) - - SUBTYPE (Elementary_Kind, Entity_Kind, - E_Enumeration_Type, E_Anonymous_Access_Type) - - SUBTYPE (Enumeration_Kind, Entity_Kind, - E_Enumeration_Type, E_Enumeration_Subtype) - - SUBTYPE (Entry_Kind, Entity_Kind, - E_Entry, E_Entry_Family) - - SUBTYPE (Fixed_Point_Kind, Entity_Kind, - E_Ordinary_Fixed_Point_Type, E_Decimal_Fixed_Point_Subtype) - - SUBTYPE (Float_Kind, Entity_Kind, - E_Floating_Point_Type, E_Floating_Point_Subtype) - - SUBTYPE (Formal_Kind, Entity_Kind, - E_In_Parameter, E_In_Out_Parameter) - - SUBTYPE (Generic_Subprogram_Kind, Entity_Kind, - E_Generic_Function, E_Generic_Procedure) - - SUBTYPE (Generic_Unit_Kind, Entity_Kind, - E_Generic_Function, E_Generic_Package) - - SUBTYPE (Incomplete_Or_Private_Kind, Entity_Kind, - E_Record_Type_With_Private, E_Incomplete_Type) - - SUBTYPE (Integer_Kind, Entity_Kind, - E_Signed_Integer_Type, E_Modular_Integer_Subtype) - - SUBTYPE (Modular_Integer_Kind, Entity_Kind, - E_Modular_Integer_Type, E_Modular_Integer_Subtype) - - SUBTYPE (Named_Kind, Entity_Kind, - E_Named_Integer, E_Named_Real) - - SUBTYPE (Numeric_Kind, Entity_Kind, - E_Signed_Integer_Type, E_Floating_Point_Subtype) - - SUBTYPE (Object_Kind, Entity_Kind, - E_Variable, E_Generic_In_Parameter) - - SUBTYPE (Ordinary_Fixed_Point_Kind, Entity_Kind, - E_Ordinary_Fixed_Point_Type, E_Ordinary_Fixed_Point_Subtype) - - SUBTYPE (Overloadable_Kind, Entity_Kind, - E_Enumeration_Literal, E_Entry) - - SUBTYPE (Private_Kind, Entity_Kind, - E_Record_Type_With_Private, E_Limited_Private_Subtype) - - SUBTYPE (Protected_Kind, Entity_Kind, - E_Protected_Type, E_Protected_Subtype) - - SUBTYPE (Real_Kind, Entity_Kind, - E_Ordinary_Fixed_Point_Type, E_Floating_Point_Subtype) - - SUBTYPE (Record_Kind, Entity_Kind, - E_Class_Wide_Type, E_Record_Subtype_With_Private) - - SUBTYPE (Scalar_Kind, Entity_Kind, - E_Enumeration_Type, E_Floating_Point_Subtype) - - SUBTYPE (String_Kind, Entity_Kind, - E_String_Type, E_String_Literal_Subtype) - - SUBTYPE (Subprogram_Kind, Entity_Kind, - E_Function, E_Procedure) - - SUBTYPE (Signed_Integer_Kind, Entity_Kind, - E_Signed_Integer_Type, E_Signed_Integer_Subtype) - - SUBTYPE (Task_Kind, Entity_Kind, - E_Task_Type, E_Task_Subtype) - - SUBTYPE (Type_Kind, Entity_Kind, - E_Enumeration_Type, E_Subprogram_Type) - - typedef char Component_Alignment_Kind; - #define Calign_Default 0 - #define Calign_Component_Size 1 - #define Calign_Component_Size_4 2 - #define Calign_Storage_Unit 3 - - typedef Boolean B; - typedef Component_Alignment_Kind C; - typedef Entity_Id E; - typedef Mechanism_Type M; - typedef Node_Id N; - typedef Uint U; - typedef Ureal R; - typedef Elist_Id L; - typedef List_Id S; - - INLINE L Accept_Address (E Id); - INLINE E Access_Disp_Table (E Id); - INLINE E Actual_Subtype (E Id); - INLINE B Address_Taken (E Id); - INLINE E Alias (E Id); - INLINE U Alignment (E Id); - INLINE E Associated_Final_Chain (E Id); - INLINE E Associated_Formal_Package (E Id); - INLINE N Associated_Node_For_Itype (E Id); - INLINE E Associated_Storage_Pool (E Id); - INLINE N Barrier_Function (E Id); - INLINE N Block_Node (E Id); - INLINE E Body_Entity (E Id); - INLINE B Body_Needed_For_SAL (E Id); - INLINE E CR_Discriminant (E Id); - INLINE B C_Pass_By_Copy (E Id); - INLINE B Can_Never_Be_Null (E Id); - INLINE B Checks_May_Be_Suppressed (E Id); - INLINE E Class_Wide_Type (E Id); - INLINE E Cloned_Subtype (E Id); - - #define Component_Alignment einfo__component_alignment - C Component_Alignment (E Id); - - INLINE N Component_Clause (E Id); - INLINE U Component_Bit_Offset (E Id); - INLINE U Component_Size (E Id); - INLINE E Component_Type (E Id); - INLINE E Corresponding_Concurrent_Type (E Id); - INLINE E Corresponding_Discriminant (E Id); - INLINE E Corresponding_Equality (E Id); - INLINE E Corresponding_Record_Type (E Id); - INLINE E Corresponding_Remote_Type (E Id); - INLINE N Current_Value (E Id); - INLINE B Debug_Info_Off (E Id); - INLINE E Debug_Renaming_Link (E Id); - INLINE E DTC_Entity (E Id); - INLINE U DT_Entry_Count (E Id); - INLINE U DT_Position (E Id); - INLINE E Default_Expr_Function (E Id); - INLINE B Default_Expressions_Processed (E Id); - INLINE N Default_Value (E Id); - INLINE B Delay_Cleanups (E Id); - INLINE B Delay_Subprogram_Descriptors (E Id); - INLINE R Delta_Value (E Id); - INLINE L Dependent_Instances (E Id); - INLINE B Depends_On_Private (E Id); - INLINE U Digits_Value (E Id); - INLINE E Directly_Designated_Type (E Id); - INLINE B Discard_Names (E Id); - INLINE E Discriminal (E Id); - INLINE E Discriminal_Link (E Id); - INLINE E Discriminant_Checking_Func (E Id); - INLINE L Discriminant_Constraint (E Id); - INLINE N Discriminant_Default_Value (E Id); - INLINE U Discriminant_Number (E Id); - INLINE B Elaborate_All_Desirable (E Id); - INLINE E Elaboration_Entity (E Id); - INLINE B Elaboration_Entity_Required (E Id); - INLINE E Enclosing_Scope (E Id); - INLINE B Entry_Accepted (E Id); - INLINE E Entry_Bodies_Array (E Id); - INLINE E Entry_Cancel_Parameter (E Id); - INLINE E Entry_Component (E Id); - INLINE E Entry_Formal (E Id); - INLINE E Entry_Index_Constant (E Id); - INLINE E Entry_Index_Type (E Id); - INLINE E Entry_Parameters_Type (E Id); - INLINE E Enum_Pos_To_Rep (E Id); - INLINE U Enumeration_Pos (E Id); - INLINE U Enumeration_Rep (E Id); - INLINE N Enumeration_Rep_Expr (E Id); - INLINE E Equivalent_Type (E Id); - INLINE U Esize (E Id); - INLINE U Exception_Code (E Id); - INLINE E Extra_Accessibility (E Id); - INLINE E Extra_Constrained (E Id); - INLINE E Extra_Formal (E Id); - INLINE E Finalization_Chain_Entity (E Id); - - #define Finalize_Storage_Only einfo__finalize_storage_only - B Finalize_Storage_Only (E Id); - - INLINE E First_Entity (E Id); - INLINE N First_Index (E Id); - INLINE E First_Literal (E Id); - INLINE E First_Optional_Parameter (E Id); - INLINE E First_Private_Entity (E Id); - INLINE N First_Rep_Item (E Id); - INLINE N Freeze_Node (E Id); - INLINE B From_With_Type (E Id); - INLINE E Full_View (E Id); - INLINE B Function_Returns_With_DSP (E Id); - INLINE E Generic_Homonym (E Id); - INLINE L Generic_Renamings (E Id); - INLINE S Handler_Records (E Id); - INLINE B Has_Aliased_Components (E Id); - INLINE B Has_Alignment_Clause (E Id); - INLINE B Has_All_Calls_Remote (E Id); - INLINE B Has_Atomic_Components (E Id); - INLINE B Has_Biased_Representation (E Id); - INLINE B Has_Completion (E Id); - INLINE B Has_Completion_In_Body (E Id); - INLINE B Has_Complex_Representation (E Id); - INLINE B Has_Component_Size_Clause (E Id); - INLINE B Has_Contiguous_Rep (E Id); - INLINE B Has_Controlled_Component (E Id); - INLINE B Has_Controlling_Result (E Id); - INLINE B Has_Convention_Pragma (E Id); - INLINE B Has_Delayed_Freeze (E Id); - INLINE B Has_Discriminants (E Id); - INLINE B Has_Enumeration_Rep_Clause (E Id); - INLINE B Has_Exit (E Id); - INLINE B Has_External_Tag_Rep_Clause (E Id); - INLINE B Has_Fully_Qualified_Name (E Id); - INLINE B Has_Gigi_Rep_Item (E Id); - INLINE B Has_Homonym (E Id); - - #define Has_Interrupt_Handler einfo__has_interrupt_handler - B Has_Interrupt_Handler (E Id); - - INLINE B Has_Machine_Radix_Clause (E Id); - INLINE B Has_Master_Entity (E Id); - INLINE B Has_Missing_Return (E Id); - INLINE B Has_Nested_Block_With_Handler (E Id); - INLINE B Has_Forward_Instantiation (E Id); - INLINE B Has_Non_Standard_Rep (E Id); - INLINE B Has_Object_Size_Clause (E Id); - INLINE B Has_Per_Object_Constraint (E Id); - INLINE B Has_Pragma_Controlled (E Id); - INLINE B Has_Pragma_Elaborate_Body (E Id); - INLINE B Has_Pragma_Inline (E Id); - INLINE B Has_Pragma_Pack (E Id); - INLINE B Has_Pragma_Pure_Function (E Id); - INLINE B Has_Pragma_Unreferenced (E Id); - INLINE B Has_Primitive_Operations (E Id); - INLINE B Has_Qualified_Name (E Id); - INLINE B Has_Record_Rep_Clause (E Id); - INLINE B Has_Recursive_Call (E Id); - INLINE B Has_Size_Clause (E Id); - INLINE B Has_Small_Clause (E Id); - INLINE B Has_Specified_Layout (E Id); - INLINE B Has_Storage_Size_Clause (E Id); - INLINE B Has_Subprogram_Descriptor (E Id); - INLINE B Has_Task (E Id); - INLINE B Has_Unchecked_Union (E Id); - INLINE B Has_Unknown_Discriminants (E Id); - INLINE B Has_Volatile_Components (E Id); - INLINE B Has_Xref_Entry (E Id); - INLINE E Hiding_Loop_Variable (E Id); - INLINE E Homonym (E Id); - INLINE B In_Package_Body (E Id); - INLINE B In_Private_Part (E Id); - INLINE B In_Use (E Id); - INLINE L Inner_Instances (E Id); - INLINE N Interface_Name (E Id); - INLINE B Is_AST_Entry (E Id); - INLINE B Is_Abstract (E Id); - INLINE B Is_Access_Constant (E Id); - INLINE B Is_Aliased (E Id); - INLINE B Is_Asynchronous (E Id); - INLINE B Is_Atomic (E Id); - INLINE B Is_Bit_Packed_Array (E Id); - INLINE B Is_CPP_Class (E Id); - INLINE B Is_Called (E Id); - INLINE B Is_Character_Type (E Id); - INLINE B Is_Child_Unit (E Id); - INLINE B Is_Class_Wide_Equivalent_Type (E Id); - INLINE B Is_Compilation_Unit (E Id); - INLINE B Is_Completely_Hidden (E Id); - INLINE B Is_Constr_Subt_For_UN_Aliased (E Id); - INLINE B Is_Constr_Subt_For_U_Nominal (E Id); - INLINE B Is_Constrained (E Id); - INLINE B Is_Constructor (E Id); - INLINE B Is_Controlled (E Id); - INLINE B Is_Controlling_Formal (E Id); - INLINE B Is_Discrim_SO_Function (E Id); - INLINE B Is_Dispatching_Operation (E Id); - INLINE B Is_Eliminated (E Id); - INLINE B Is_Entry_Formal (E Id); - INLINE B Is_Exported (E Id); - INLINE B Is_First_Subtype (E Id); - INLINE B Is_For_Access_Subtype (E Id); - INLINE B Is_Frozen (E Id); - INLINE B Is_Generic_Instance (E Id); - INLINE B Is_Hidden (E Id); - INLINE B Is_Hidden_Open_Scope (E Id); - INLINE B Is_Immediately_Visible (E Id); - INLINE B Is_Imported (E Id); - INLINE B Is_Inlined (E Id); - INLINE B Is_Instantiated (E Id); - INLINE B Is_Internal (E Id); - INLINE B Is_Interrupt_Handler (E Id); - INLINE B Is_Intrinsic_Subprogram (E Id); - INLINE B Is_Itype (E Id); - INLINE B Is_Known_Non_Null (E Id); - INLINE B Is_Known_Valid (E Id); - INLINE B Is_Limited_Composite (E Id); - INLINE B Is_Machine_Code_Subprogram (E Id); - INLINE B Is_Non_Static_Subtype (E Id); - INLINE B Is_Null_Init_Proc (E Id); - INLINE B Is_Optional_Parameter (E Id); - INLINE B Is_Package_Body_Entity (E Id); - INLINE B Is_Packed (E Id); - INLINE B Is_Packed_Array_Type (E Id); - INLINE B Is_Potentially_Use_Visible (E Id); - INLINE B Is_Preelaborated (E Id); - INLINE B Is_Private_Composite (E Id); - INLINE B Is_Private_Descendant (E Id); - INLINE B Is_Psected (E Id); - INLINE B Is_Public (E Id); - INLINE B Is_Pure (E Id); - INLINE B Is_Remote_Call_Interface (E Id); - INLINE B Is_Remote_Types (E Id); - INLINE B Is_Renaming_Of_Object (E Id); - INLINE B Is_Shared_Passive (E Id); - INLINE B Is_Statically_Allocated (E Id); - INLINE B Is_Tag (E Id); - INLINE B Is_Tagged_Type (E Id); - INLINE B Is_True_Constant (E Id); - INLINE B Is_Unchecked_Union (E Id); - INLINE B Is_Unsigned_Type (E Id); - INLINE B Is_VMS_Exception (E Id); - INLINE B Is_Valued_Procedure (E Id); - INLINE B Is_Visible_Child_Unit (E Id); - - #define Is_Volatile einfo__is_volatile - B Is_Volatile (E Id); - - #define Is_Wrapper_Package einfo__is_wrapper_package - B Is_Wrapper_Package (E Id); - - INLINE B Kill_Elaboration_Checks (E Id); - INLINE B Kill_Range_Checks (E Id); - INLINE B Kill_Tag_Checks (E Id); - INLINE E Last_Entity (E Id); - INLINE L Limited_Views (E Id); - INLINE E Lit_Indexes (E Id); - INLINE E Lit_Strings (E Id); - INLINE B Machine_Radix_10 (E Id); - INLINE E Master_Id (E Id); - INLINE B Materialize_Entity (E Id); - INLINE M Mechanism (E Id); - INLINE U Modulus (E Id); - INLINE B Needs_Debug_Info (E Id); - INLINE B Needs_No_Actuals (E Id); - INLINE B Never_Set_In_Source (E Id); - INLINE E Next_Inlined_Subprogram (E Id); - INLINE B No_Pool_Assigned (E Id); - INLINE B No_Return (E Id); - INLINE B Non_Binary_Modulus (E Id); - INLINE E Non_Limited_View (E Id); - INLINE L Non_Limited_Views (E Id); - INLINE B Nonzero_Is_True (E Id); - INLINE U Normalized_First_Bit (E Id); - INLINE U Normalized_Position (E Id); - INLINE U Normalized_Position_Max (E Id); - INLINE E Object_Ref (E Id); - INLINE E Original_Array_Type (E Id); - INLINE E Original_Record_Component (E Id); - INLINE E Packed_Array_Type (E Id); - INLINE E Parent_Subtype (E Id); - INLINE L Primitive_Operations (E Id); - INLINE E Prival (E Id); - INLINE L Privals_Chain (E Id); - INLINE L Private_Dependents (E Id); - INLINE N Private_View (E Id); - INLINE E Protected_Body_Subprogram (E Id); - INLINE E Protected_Formal (E Id); - INLINE E Protected_Operation (E Id); - INLINE U RM_Size (E Id); - INLINE B Reachable (E Id); - INLINE B Referenced (E Id); - INLINE B Referenced_As_LHS (E Id); - INLINE N Referenced_Object (E Id); - INLINE N Register_Exception_Call (E Id); - INLINE E Related_Array_Object (E Id); - INLINE E Related_Instance (E Id); - INLINE N Renamed_Entity (E Id); - INLINE N Renamed_Object (E Id); - INLINE U Renaming_Map (E Id); - INLINE B Return_Present (E Id); - INLINE B Returns_By_Ref (E Id); - INLINE B Reverse_Bit_Order (E Id); - INLINE N Scalar_Range (E Id); - INLINE U Scale_Value (E Id); - INLINE U Scope_Depth_Value (E Id); - INLINE B Sec_Stack_Needed_For_Return (E Id); - INLINE S Shadow_Entities (E Id); - INLINE E Shared_Var_Assign_Proc (E Id); - INLINE E Shared_Var_Read_Proc (E Id); - INLINE N Size_Check_Code (E Id); - INLINE B Size_Known_At_Compile_Time (E Id); - INLINE B Size_Depends_On_Discriminant (E Id); - INLINE R Small_Value (E Id); - INLINE E Spec_Entity (E Id); - INLINE E Storage_Size_Variable (E Id); - INLINE L Stored_Constraint (E Id); - INLINE B Strict_Alignment (E Id); - INLINE U String_Literal_Length (E Id); - INLINE N String_Literal_Low_Bound (E Id); - INLINE B Suppress_Elaboration_Warnings (E Id); - INLINE B Suppress_Init_Proc (E Id); - INLINE B Suppress_Style_Checks (E Id); - INLINE B Treat_As_Volatile (E Id); - INLINE E Underlying_Full_View (E Id); - INLINE N Unset_Reference (E Id); - INLINE B Uses_Sec_Stack (E Id); - INLINE B Vax_Float (E Id); - INLINE B Warnings_Off (E Id); - INLINE B Is_Access_Type (E Id); - INLINE B Is_Array_Type (E Id); - INLINE B Is_Class_Wide_Type (E Id); - INLINE B Is_Composite_Type (E Id); - INLINE B Is_Concurrent_Body (E Id); - INLINE B Is_Concurrent_Record_Type (E Id); - INLINE B Is_Concurrent_Type (E Id); - INLINE B Is_Decimal_Fixed_Point_Type (E Id); - INLINE B Is_Digits_Type (E Id); - INLINE B Is_Discrete_Or_Fixed_Point_Type (E Id); - INLINE B Is_Discrete_Type (E Id); - INLINE B Is_Elementary_Type (E Id); - INLINE B Is_Entry (E Id); - INLINE B Is_Enumeration_Type (E Id); - INLINE B Is_Fixed_Point_Type (E Id); - INLINE B Is_Floating_Point_Type (E Id); - INLINE B Is_Formal (E Id); - INLINE B Is_Formal_Subprogram (E Id); - INLINE B Is_Generic_Actual_Type (E Id); - INLINE B Is_Generic_Unit (E Id); - INLINE B Is_Generic_Type (E Id); - INLINE B Is_Generic_Subprogram (E Id); - INLINE B Is_Incomplete_Or_Private_Type (E Id); - INLINE B Is_Integer_Type (E Id); - INLINE B Is_Limited_Record (E Id); - INLINE B Is_Modular_Integer_Type (E Id); - INLINE B Is_Named_Number (E Id); - INLINE B Is_Numeric_Type (E Id); - INLINE B Is_Object (E Id); - INLINE B Is_Ordinary_Fixed_Point_Type (E Id); - INLINE B Is_Overloadable (E Id); - INLINE B Is_Overriding_Operation (E Id); - INLINE B Is_Private_Type (E Id); - INLINE B Is_Protected_Type (E Id); - INLINE B Is_Real_Type (E Id); - INLINE B Is_Record_Type (E Id); - INLINE B Is_Scalar_Type (E Id); - INLINE B Is_Signed_Integer_Type (E Id); - INLINE B Is_Subprogram (E Id); - INLINE B Is_Task_Type (E Id); - INLINE B Is_Type (E Id); - - #define Address_Clause einfo__address_clause - N Address_Clause (E Id); - - #define Alignment_Clause einfo__alignment_clause - N Alignment_Clause (E Id); - - #define Ancestor_Subtype einfo__ancestor_subtype - E Ancestor_Subtype (E Id); - - #define Base_Type einfo__base_type - E Base_Type (E Id); - - #define Constant_Value einfo__constant_value - N Constant_Value (E Id); - - #define Declaration_Node einfo__declaration_node - N Declaration_Node (E Id); - - #define Designated_Type einfo__designated_type - E Designated_Type (E Id); - - #define Enclosing_Dynamic_Scope einfo__enclosing_dynamic_scope - E Enclosing_Dynamic_Scope (E Id); - - #define First_Component einfo__first_component - E First_Component (E Id); - - #define First_Discriminant einfo__first_discriminant - E First_Discriminant (E Id); - - #define First_Formal einfo__first_formal - E First_Formal (E Id); - - #define First_Stored_Discriminant einfo__first_stored_discriminant - E First_Stored_Discriminant (E Id); - - #define First_Subtype einfo__first_subtype - E First_Subtype (E Id); - - #define Has_Attach_Handler einfo__has_attach_handler - B Has_Attach_Handler (E Id); - - #define Has_Entries einfo__has_entries - B Has_Entries (E Id); - - #define Has_Foreign_Convention einfo__has_foreign_convention - B Has_Foreign_Convention (E Id); - - #define Has_Private_Ancestor einfo__has_private_ancestor - B Has_Private_Ancestor (E Id); - - INLINE B Has_Private_Declaration (E Id); - - #define Implementation_Base_Type einfo__implementation_base_type - E Implementation_Base_Type (E Id); - - #define Is_Always_Inlined einfo__is_always_inlined - B Is_Always_Inlined (E Id); - - #define Is_Boolean_Type einfo__is_boolean_type - B Is_Boolean_Type (E Id); - - #define Is_By_Copy_Type einfo__is_by_copy_type - B Is_By_Copy_Type (E Id); - - #define Is_By_Reference_Type einfo__is_by_reference_type - B Is_By_Reference_Type (E Id); - - #define Is_Derived_Type einfo__is_derived_type - B Is_Derived_Type (E Id); - - #define Is_Dynamic_Scope einfo__is_dynamic_scope - B Is_Dynamic_Scope (E Id); - - #define Is_Indefinite_Subtype einfo__is_indefinite_subtype - B Is_Indefinite_Subtype (E Id); - - #define Is_Limited_Type einfo__is_limited_type - B Is_Limited_Type (E Id); - - #define Is_Package einfo__is_package - B Is_Package (E Id); - - #define Is_Protected_Private einfo__is_protected_private - B Is_Protected_Private (E Id); - - #define Is_Protected_Record_Type einfo__is_protected_record_type - B Is_Protected_Record_Type (E Id); - - #define Is_Return_By_Reference_Type einfo__is_return_by_reference_type - B Is_Return_By_Reference_Type (E Id); - - #define Is_String_Type einfo__is_string_type - B Is_String_Type (E Id); - - #define Is_Task_Record_Type einfo__is_task_record_type - B Is_Task_Record_Type (E Id); - - #define Next_Component einfo__next_component - E Next_Component (E Id); - - #define Next_Discriminant einfo__next_discriminant - E Next_Discriminant (E Id); - - #define Next_Formal einfo__next_formal - E Next_Formal (E Id); - - #define Next_Formal_With_Extras einfo__next_formal_with_extras - E Next_Formal_With_Extras (E Id); - - INLINE E Next_Literal (E Id); - - #define Next_Stored_Discriminant einfo__next_stored_discriminant - E Next_Stored_Discriminant (E Id); - - #define Number_Dimensions einfo__number_dimensions - Pos Number_Dimensions (E Id); - - #define Number_Discriminants einfo__number_discriminants - Pos Number_Discriminants (E Id); - - #define Number_Entries einfo__number_entries - Nat Number_Entries (E Id); - - #define Number_Formals einfo__number_formals - Pos Number_Formals (E Id); - - INLINE Formal_Kind Parameter_Mode (E Id); - - #define Root_Type einfo__root_type - E Root_Type (E Id); - - #define Scope_Depth_Set einfo__scope_depth_set - B Scope_Depth_Set (E Id); - - #define Size_Clause einfo__size_clause - N Size_Clause (E Id); - - #define Tag_Component einfo__tag_component - E Tag_Component (E Id); - - #define Type_High_Bound einfo__type_high_bound - N Type_High_Bound (E Id); - - #define Type_Low_Bound einfo__type_low_bound - N Type_Low_Bound (E Id); - - #define Underlying_Type einfo__underlying_type - E Underlying_Type (E Id); - - #define Known_Alignment einfo__known_alignment - B Known_Alignment (Entity_Id E); - - #define Known_Component_Bit_Offset einfo__known_component_bit_offset - B Known_Component_Bit_Offset (Entity_Id E); - - #define Known_Component_Size einfo__known_component_size - B Known_Component_Size (Entity_Id E); - - #define Known_Esize einfo__known_esize - B Known_Esize (Entity_Id E); - - #define Known_Normalized_First_Bit einfo__known_normalized_first_bit - B Known_Normalized_First_Bit (Entity_Id E); - - #define Known_Normalized_Position einfo__known_normalized_position - B Known_Normalized_Position (Entity_Id E); - - #define Known_Normalized_Position_Max einfo__known_normalized_position_max - B Known_Normalized_Position_Max (Entity_Id E); - - #define Known_RM_Size einfo__known_rm_size - B Known_RM_Size (Entity_Id E); - - #define Known_Static_Component_Bit_Offset einfo__known_static_component_bit_offset - B Known_Static_Component_Bit_Offset (Entity_Id E); - - #define Known_Static_Component_Size einfo__known_static_component_size - B Known_Static_Component_Size (Entity_Id E); - - #define Known_Static_Esize einfo__known_static_esize - B Known_Static_Esize (Entity_Id E); - - #define Known_Static_Normalized_First_Bit einfo__known_static_normalized_first_bit - B Known_Static_Normalized_First_Bit (Entity_Id E); - - #define Known_Static_Normalized_Position einfo__known_static_normalized_position - B Known_Static_Normalized_Position (Entity_Id E); - - #define Known_Static_Normalized_Position_Max einfo__known_static_normalized_position_max - B Known_Static_Normalized_Position_Max (Entity_Id E); - - #define Known_Static_RM_Size einfo__known_static_rm_size - B Known_Static_RM_Size (Entity_Id E); - - #define Unknown_Alignment einfo__unknown_alignment - B Unknown_Alignment (Entity_Id E); - - #define Unknown_Component_Bit_Offset einfo__unknown_component_bit_offset - B Unknown_Component_Bit_Offset (Entity_Id E); - - #define Unknown_Component_Size einfo__unknown_component_size - B Unknown_Component_Size (Entity_Id E); - - #define Unknown_Esize einfo__unknown_esize - B Unknown_Esize (Entity_Id E); - - #define Unknown_Normalized_First_Bit einfo__unknown_normalized_first_bit - B Unknown_Normalized_First_Bit (Entity_Id E); - - #define Unknown_Normalized_Position einfo__unknown_normalized_position - B Unknown_Normalized_Position (Entity_Id E); - - #define Unknown_Normalized_Position_Max einfo__unknown_normalized_position_max - B Unknown_Normalized_Position_Max (Entity_Id E); - - #define Unknown_RM_Size einfo__unknown_rm_size - B Unknown_RM_Size (Entity_Id E); - - - INLINE L Accept_Address (E Id) - { return Elist21 (Id); } - - INLINE E Access_Disp_Table (E Id) - { return Node16 (Implementation_Base_Type (Id)); } - - INLINE E Actual_Subtype (E Id) - { return Node17 (Id); } - - INLINE B Address_Taken (E Id) - { return Flag104 (Id); } - - INLINE E Alias (E Id) - { return Node18 (Id); } - - INLINE U Alignment (E Id) - { return Uint14 (Id); } - - INLINE E Associated_Final_Chain (E Id) - { return Node23 (Id); } - - INLINE E Associated_Formal_Package (E Id) - { return Node12 (Id); } - - INLINE N Associated_Node_For_Itype (E Id) - { return Node8 (Id); } - - INLINE E Associated_Storage_Pool (E Id) - { return Node22 (Root_Type (Id)); } - - INLINE N Barrier_Function (E Id) - { return Node12 (Id); } - - INLINE N Block_Node (E Id) - { return Node11 (Id); } - - INLINE E Body_Entity (E Id) - { return Node19 (Id); } - - INLINE B Body_Needed_For_SAL (E Id) - { return Flag40 (Id); } - - INLINE B C_Pass_By_Copy (E Id) - { return Flag125 (Implementation_Base_Type (Id)); } - - INLINE B Can_Never_Be_Null (E Id) - { return Flag38 (Id); } - - INLINE B Checks_May_Be_Suppressed (E Id) - { return Flag31 (Id); } - - INLINE E Class_Wide_Type (E Id) - { return Node9 (Id); } - - INLINE E Cloned_Subtype (E Id) - { return Node16 (Id); } - - INLINE U Component_Bit_Offset (E Id) - { return Uint11 (Id); } - - INLINE N Component_Clause (E Id) - { return Node13 (Id); } - - INLINE U Component_Size (E Id) - { return Uint22 (Implementation_Base_Type (Id)); } - - INLINE E Component_Type (E Id) - { return Node20 (Implementation_Base_Type (Id)); } - - INLINE E Corresponding_Concurrent_Type (E Id) - { return Node18 (Id); } - - INLINE E Corresponding_Discriminant (E Id) - { return Node19 (Id); } - - INLINE E Corresponding_Equality (E Id) - { return Node13 (Id); } - - INLINE E Corresponding_Record_Type (E Id) - { return Node18 (Id); } - - INLINE E Corresponding_Remote_Type (E Id) - { return Node22 (Id); } - - INLINE N Current_Value (E Id) - { return Node9 (Id); } - - INLINE E CR_Discriminant (E Id) - { return Node23 (Id); } - - INLINE B Debug_Info_Off (E Id) - { return Flag166 (Id); } - - INLINE E Debug_Renaming_Link (E Id) - { return Node13 (Id); } - - INLINE E Default_Expr_Function (E Id) - { return Node21 (Id); } - - INLINE B Default_Expressions_Processed (E Id) - { return Flag108 (Id); } - - INLINE N Default_Value (E Id) - { return Node20 (Id); } - - INLINE B Delay_Cleanups (E Id) - { return Flag114 (Id); } - - INLINE B Delay_Subprogram_Descriptors (E Id) - { return Flag50 (Id); } - - INLINE R Delta_Value (E Id) - { return Ureal18 (Id); } - - INLINE L Dependent_Instances (E Id) - { return Elist8 (Id); } - - INLINE B Depends_On_Private (E Id) - { return Flag14 (Id); } - - INLINE U Digits_Value (E Id) - { return Uint17 (Id); } - - INLINE E Directly_Designated_Type (E Id) - { return Node20 (Id); } - - INLINE B Discard_Names (E Id) - { return Flag88 (Id); } - - INLINE E Discriminal (E Id) - { return Node17 (Id); } - - INLINE N Discriminal_Link (E Id) - { return Node10 (Id); } - - INLINE E Discriminant_Checking_Func (E Id) - { return Node20 (Id); } - - INLINE L Discriminant_Constraint (E Id) - { return Elist21 (Id); } - - INLINE N Discriminant_Default_Value (E Id) - { return Node20 (Id); } - - INLINE U Discriminant_Number (E Id) - { return Uint15 (Id); } - - INLINE U DT_Entry_Count (E Id) - { return Uint15 (Id); } - - INLINE U DT_Position (E Id) - { return Uint15 (Id); } - - INLINE E DTC_Entity (E Id) - { return Node16 (Id); } - - INLINE B Elaborate_All_Desirable (E Id) - { return Flag146 (Id); } - - INLINE E Elaboration_Entity (E Id) - { return Node13 (Id); } - - INLINE B Elaboration_Entity_Required (E Id) - { return Flag174 (Id); } - - INLINE E Enclosing_Scope (E Id) - { return Node18 (Id); } - - INLINE B Entry_Accepted (E Id) - { return Flag152 (Id); } - - INLINE E Entry_Bodies_Array (E Id) - { return Node15 (Id); } - - INLINE E Entry_Cancel_Parameter (E Id) - { return Node23 (Id); } - - INLINE E Entry_Component (E Id) - { return Node11 (Id); } - - INLINE E Entry_Formal (E Id) - { return Node16 (Id); } - - INLINE N Entry_Index_Constant (E Id) - { return Node18 (Id); } - - INLINE E Entry_Parameters_Type (E Id) - { return Node15 (Id); } - - INLINE E Enum_Pos_To_Rep (E Id) - { return Node23 (Id); } - - INLINE Uint Enumeration_Pos (E Id) - { return Uint11 (Id); } - - INLINE U Enumeration_Rep (E Id) - { return Uint12 (Id); } - - INLINE N Enumeration_Rep_Expr (E Id) - { return Node22 (Id); } - - INLINE E Equivalent_Type (E Id) - { return Node18 (Id); } - - INLINE Uint Esize (E Id) - { return Uint12 (Id); } - - INLINE Uint Exception_Code (E Id) - { return Uint22 (Id); } - - INLINE E Extra_Accessibility (E Id) - { return Node13 (Id); } - - INLINE E Extra_Constrained (E Id) - { return Node23 (Id); } - - INLINE E Extra_Formal (E Id) - { return Node15 (Id); } - - INLINE E Finalization_Chain_Entity (E Id) - { return Node19 (Id); } - - INLINE E First_Entity (E Id) - { return Node17 (Id); } - - INLINE N First_Index (E Id) - { return Node17 (Id); } - - INLINE E First_Literal (E Id) - { return Node17 (Id); } - - INLINE E First_Optional_Parameter (E Id) - { return Node14 (Id); } - - INLINE E First_Private_Entity (E Id) - { return Node16 (Id); } - - INLINE E First_Rep_Item (E Id) - { return Node6 (Id); } - - INLINE N Freeze_Node (E Id) - { return Node7 (Id); } - - INLINE B From_With_Type (E Id) - { return Flag159 (Id); } - - INLINE E Full_View (E Id) - { return Node11 (Id); } - - INLINE B Function_Returns_With_DSP (E Id) - { return Flag169 (Id); } - - INLINE E Generic_Homonym (E Id) - { return Node11 (Id); } - - INLINE L Generic_Renamings (E Id) - { return Elist23 (Id); } - - INLINE S Handler_Records (E Id) - { return List10 (Id); } - - INLINE B Has_Aliased_Components (E Id) - { return Flag135 (Implementation_Base_Type (Id)); } - - INLINE B Has_Alignment_Clause (E Id) - { return Flag46 (Id); } - - INLINE B Has_All_Calls_Remote (E Id) - { return Flag79 (Id); } - - INLINE B Has_Atomic_Components (E Id) - { return Flag86 (Implementation_Base_Type (Id)); } - - INLINE B Has_Biased_Representation (E Id) - { return Flag139 (Id); } - - INLINE B Has_Completion (E Id) - { return Flag26 (Id); } - - INLINE B Has_Completion_In_Body (E Id) - { return Flag71 (Id); } - - INLINE B Has_Complex_Representation (E Id) - { return Flag140 (Implementation_Base_Type (Id)); } - - INLINE B Has_Component_Size_Clause (E Id) - { return Flag68 (Implementation_Base_Type (Id)); } - - INLINE B Has_Controlled_Component (E Id) - { return Flag43 (Base_Type (Id)); } - - INLINE B Has_Contiguous_Rep (E Id) - { return Flag181 (Id); } - - INLINE B Has_Controlling_Result (E Id) - { return Flag98 (Id); } - - INLINE B Has_Convention_Pragma (E Id) - { return Flag119 (Id); } - - INLINE B Has_Delayed_Freeze (E Id) - { return Flag18 (Id); } - - INLINE B Has_Discriminants (E Id) - { return Flag5 (Id); } - - INLINE B Has_Enumeration_Rep_Clause (E Id) - { return Flag66 (Id); } - - INLINE B Has_Exit (E Id) - { return Flag47 (Id); } - - INLINE B Has_External_Tag_Rep_Clause (E Id) - { return Flag110 (Id); } - - INLINE B Has_Forward_Instantiation (E Id) - { return Flag175 (Id); } - - INLINE B Has_Fully_Qualified_Name (E Id) - { return Flag173 (Id); } - - INLINE B Has_Gigi_Rep_Item (E Id) - { return Flag82 (Id); } - - INLINE B Has_Homonym (E Id) - { return Flag56 (Id); } - - INLINE B Has_Machine_Radix_Clause (E Id) - { return Flag83 (Id); } - - INLINE B Has_Master_Entity (E Id) - { return Flag21 (Id); } - - INLINE B Has_Missing_Return (E Id) - { return Flag142 (Id); } - - INLINE B Has_Nested_Block_With_Handler (E Id) - { return Flag101 (Id); } - - INLINE B Has_Non_Standard_Rep (E Id) - { return Flag75 (Implementation_Base_Type (Id)); } - - INLINE B Has_Object_Size_Clause (E Id) - { return Flag172 (Id); } - - INLINE B Has_Per_Object_Constraint (E Id) - { return Flag154 (Id); } - - INLINE B Has_Pragma_Controlled (E Id) - { return Flag27 (Implementation_Base_Type (Id)); } - - INLINE B Has_Pragma_Elaborate_Body (E Id) - { return Flag150 (Id); } - - INLINE B Has_Pragma_Inline (E Id) - { return Flag157 (Id); } - - INLINE B Has_Pragma_Pack (E Id) - { return Flag121 (Implementation_Base_Type (Id)); } - - INLINE B Has_Pragma_Pure_Function (E Id) - { return Flag179 (Id); } - - INLINE B Has_Pragma_Unreferenced (E Id) - { return Flag180 (Id); } - - INLINE B Has_Primitive_Operations (E Id) - { return Flag120 (Base_Type (Id)); } - - INLINE B Has_Private_Declaration (E Id) - { return Flag155 (Id); } - - INLINE B Has_Qualified_Name (E Id) - { return Flag161 (Id); } - - INLINE B Has_Record_Rep_Clause (E Id) - { return Flag65 (Implementation_Base_Type (Id)); } - - INLINE B Has_Recursive_Call (E Id) - { return Flag143 (Id); } - - INLINE B Has_Size_Clause (E Id) - { return Flag29 (Id); } - - INLINE B Has_Small_Clause (E Id) - { return Flag67 (Id); } - - INLINE B Has_Specified_Layout (E Id) - { return Flag100 (Implementation_Base_Type (Id)); } - - INLINE B Has_Storage_Size_Clause (E Id) - { return Flag23 (Implementation_Base_Type (Id)); } - - INLINE B Has_Subprogram_Descriptor (E Id) - { return Flag93 (Id); } - - INLINE B Has_Task (E Id) - { return Flag30 (Base_Type (Id)); } - - INLINE B Has_Unchecked_Union (E Id) - { return Flag123 (Base_Type (Id)); } - - INLINE B Has_Unknown_Discriminants (E Id) - { return Flag72 (Id); } - - INLINE B Has_Volatile_Components (E Id) - { return Flag87 (Implementation_Base_Type (Id)); } - - INLINE B Has_Xref_Entry (E Id) - { return Flag182 (Implementation_Base_Type (Id)); } - - INLINE E Hiding_Loop_Variable (E Id) - { return Node8 (Id); } - - INLINE E Homonym (E Id) - { return Node4 (Id); } - - INLINE B In_Package_Body (E Id) - { return Flag48 (Id); } - - INLINE B In_Private_Part (E Id) - { return Flag45 (Id); } - - INLINE B In_Use (E Id) - { return Flag8 (Id); } - - INLINE L Inner_Instances (E Id) - { return Elist23 (Id); } - - INLINE N Interface_Name (E Id) - { return Node21 (Id); } - - INLINE B Is_Abstract (E Id) - { return Flag19 (Id); } - - INLINE B Is_Access_Constant (E Id) - { return Flag69 (Id); } - - INLINE B Is_Aliased (E Id) - { return Flag15 (Id); } - - INLINE B Is_AST_Entry (E Id) - { return Flag132 (Id); } - - INLINE B Is_Asynchronous (E Id) - { return Flag81 (Id); } - - INLINE B Is_Atomic (E Id) - { return Flag85 (Id); } - - INLINE B Is_Bit_Packed_Array (E Id) - { return Flag122 (Implementation_Base_Type (Id)); } - - INLINE B Is_Called (E Id) - { return Flag102 (Id); } - - INLINE B Is_Character_Type (E Id) - { return Flag63 (Id); } - - INLINE B Is_Child_Unit (E Id) - { return Flag73 (Id); } - - INLINE B Is_Class_Wide_Equivalent_Type (E Id) - { return Flag35 (Id); } - - INLINE B Is_Compilation_Unit (E Id) - { return Flag149 (Id); } - - INLINE B Is_Completely_Hidden (E Id) - { return Flag103 (Id); } - - INLINE B Is_Constr_Subt_For_U_Nominal (E Id) - { return Flag80 (Id); } - - INLINE B Is_Constr_Subt_For_UN_Aliased (E Id) - { return Flag141 (Id); } - - INLINE B Is_Constrained (E Id) - { return Flag12 (Id); } - - INLINE B Is_Constructor (E Id) - { return Flag76 (Id); } - - INLINE B Is_Controlled (E Id) - { return Flag42 (Base_Type (Id)); } - - INLINE B Is_Controlling_Formal (E Id) - { return Flag97 (Id); } - - INLINE B Is_CPP_Class (E Id) - { return Flag74 (Id); } - - INLINE B Is_Discrim_SO_Function (E Id) - { return Flag176 (Id); } - - INLINE B Is_Dispatching_Operation (E Id) - { return Flag6 (Id); } - - INLINE B Is_Eliminated (E Id) - { return Flag124 (Id); } - - INLINE B Is_Entry_Formal (E Id) - { return Flag52 (Id); } - - INLINE B Is_Exported (E Id) - { return Flag99 (Id); } - - INLINE B Is_First_Subtype (E Id) - { return Flag70 (Id); } - - INLINE B Is_For_Access_Subtype (E Id) - { return Flag118 (Id); } - - INLINE B Is_Formal_Subprogram (E Id) - { return Flag111 (Id); } - - INLINE B Is_Frozen (E Id) - { return Flag4 (Id); } - - INLINE B Is_Generic_Actual_Type (E Id) - { return Flag94 (Id); } - - INLINE B Is_Generic_Instance (E Id) - { return Flag130 (Id); } - - INLINE B Is_Generic_Type (E Id) - { return Flag13 (Id); } - - INLINE B Is_Hidden (E Id) - { return Flag57 (Id); } - - INLINE B Is_Hidden_Open_Scope (E Id) - { return Flag171 (Id); } - - INLINE B Is_Immediately_Visible (E Id) - { return Flag7 (Id); } - - INLINE B Is_Imported (E Id) - { return Flag24 (Id); } - - INLINE B Is_Inlined (E Id) - { return Flag11 (Id); } - - INLINE B Is_Instantiated (E Id) - { return Flag126 (Id); } - - INLINE B Is_Internal (E Id) - { return Flag17 (Id); } - - INLINE B Is_Interrupt_Handler (E Id) - { return Flag89 (Id); } - - INLINE B Is_Intrinsic_Subprogram (E Id) - { return Flag64 (Id); } - - INLINE B Is_Itype (E Id) - { return Flag91 (Id); } - - INLINE B Is_Known_Non_Null (E Id) - { return Flag37 (Id); } - - INLINE B Is_Known_Valid (E Id) - { return Flag170 (Id); } - - INLINE B Is_Limited_Composite (E Id) - { return Flag106 (Id); } - - INLINE B Is_Limited_Record (E Id) - { return Flag25 (Id); } - - INLINE B Is_Machine_Code_Subprogram (E Id) - { return Flag137 (Id); } - - INLINE B Is_Non_Static_Subtype (E Id) - { return Flag109 (Id); } - - INLINE B Is_Null_Init_Proc (E Id) - { return Flag178 (Id); } - - INLINE B Is_Optional_Parameter (E Id) - { return Flag134 (Id); } - - INLINE B Is_Overriding_Operation (E Id) - { return Flag39 (Id); } - - INLINE B Is_Package_Body_Entity (E Id) - { return Flag160 (Id); } - - INLINE B Is_Packed (E Id) - { return Flag51 (Implementation_Base_Type (Id)); } - - INLINE B Is_Packed_Array_Type (E Id) - { return Flag138 (Id); } - - INLINE B Is_Potentially_Use_Visible (E Id) - { return Flag9 (Id); } - - INLINE B Is_Preelaborated (E Id) - { return Flag59 (Id); } - - INLINE B Is_Private_Composite (E Id) - { return Flag107 (Id); } - - INLINE B Is_Private_Descendant (E Id) - { return Flag53 (Id); } - - INLINE B Is_Psected (E Id) - { return Flag153 (Id); } - - INLINE B Is_Public (E Id) - { return Flag10 (Id); } - - INLINE B Is_Pure (E Id) - { return Flag44 (Id); } - - INLINE B Is_Remote_Call_Interface (E Id) - { return Flag62 (Id); } - - INLINE B Is_Remote_Types (E Id) - { return Flag61 (Id); } - - INLINE B Is_Renaming_Of_Object (E Id) - { return Flag112 (Id); } - - INLINE B Is_Shared_Passive (E Id) - { return Flag60 (Id); } - - INLINE B Is_Statically_Allocated (E Id) - { return Flag28 (Id); } - - INLINE B Is_Tag (E Id) - { return Flag78 (Id); } - - INLINE B Is_Tagged_Type (E Id) - { return Flag55 (Id); } - - INLINE B Is_True_Constant (E Id) - { return Flag163 (Id); } - - INLINE B Is_Unchecked_Union (E Id) - { return Flag117 (Id); } - - INLINE B Is_Unsigned_Type (E Id) - { return Flag144 (Id); } - - INLINE B Is_Valued_Procedure (E Id) - { return Flag127 (Id); } - - INLINE B Is_Visible_Child_Unit (E Id) - { return Flag116 (Id); } - - INLINE B Is_VMS_Exception (E Id) - { return Flag133 (Id); } - - INLINE B Kill_Elaboration_Checks (E Id) - { return Flag32 (Id); } - - INLINE B Kill_Range_Checks (E Id) - { return Flag33 (Id); } - - INLINE B Kill_Tag_Checks (E Id) - { return Flag34 (Id); } - - INLINE E Last_Entity (E Id) - { return Node20 (Id); } - - INLINE L Limited_Views (E Id) - { return Elist23 (Id); } - - INLINE E Lit_Indexes (E Id) - { return Node15 (Id); } - - INLINE E Lit_Strings (E Id) - { return Node16 (Id); } - - INLINE B Machine_Radix_10 (E Id) - { return Flag84 (Id); } - - INLINE E Master_Id (E Id) - { return Node17 (Id); } - - INLINE B Materialize_Entity (E Id) - { return Flag168 (Id); } - - INLINE M Mechanism (E Id) - { return UI_To_Int (Uint8 (Id)); } - - INLINE Uint Modulus (E Id) - { return Uint17 (Base_Type (Id)); } - - INLINE B Needs_Debug_Info (E Id) - { return Flag147 (Id); } - - INLINE B Needs_No_Actuals (E Id) - { return Flag22 (Id); } - - INLINE B Never_Set_In_Source (E Id) - { return Flag115 (Id); } - - INLINE E Next_Inlined_Subprogram (E Id) - { return Node12 (Id); } - - INLINE B No_Pool_Assigned (E Id) - { return Flag131 (Root_Type (Id)); } - - INLINE B No_Return (E Id) - { return Flag113 (Id); } - - INLINE B Non_Binary_Modulus (E Id) - { return Flag58 (Base_Type (Id)); } - - INLINE E Non_Limited_View (E Id) - { return Node17 (Id); } - - INLINE L Non_Limited_Views (E Id) - { return Elist8 (Id); } - - INLINE B Nonzero_Is_True (E Id) - { return Flag162 (Base_Type (Id)); } - - INLINE U Normalized_First_Bit (E Id) - { return Uint8 (Id); } - - INLINE U Normalized_Position (E Id) - { return Uint14 (Id); } - - INLINE U Normalized_Position_Max (E Id) - { return Uint10 (Id); } - - INLINE E Object_Ref (E Id) - { return Node17 (Id); } - - INLINE E Original_Array_Type (E Id) - { return Node21 (Id); } - - INLINE E Original_Record_Component (E Id) - { return Node22 (Id); } - - INLINE E Packed_Array_Type (E Id) - { return Node23 (Id); } - - INLINE E Parent_Subtype (E Id) - { return Node19 (Id); } - - INLINE L Primitive_Operations (E Id) - { return Elist15 (Id); } - - INLINE E Prival (E Id) - { return Node17 (Id); } - - INLINE L Privals_Chain (E Id) - { return Elist23 (Id); } - - INLINE L Private_Dependents (E Id) - { return Elist18 (Id); } - - INLINE N Private_View (E Id) - { return Node22 (Id); } - - INLINE E Protected_Body_Subprogram (E Id) - { return Node11 (Id); } - - INLINE E Protected_Formal (E Id) - { return Node22 (Id); } - - INLINE N Protected_Operation (E Id) - { return Node23 (Id); } - - INLINE B Reachable (E Id) - { return Flag49 (Id); } - - INLINE B Referenced (E Id) - { return Flag156 (Id); } - - INLINE B Referenced_As_LHS (E Id) - { return Flag36 (Id); } - - INLINE N Referenced_Object (E Id) - { return Node10 (Id); } - - INLINE N Register_Exception_Call (E Id) - { return Node20 (Id); } - - INLINE E Related_Array_Object (E Id) - { return Node19 (Id); } - - INLINE E Related_Instance (E Id) - { return Node15 (Id); } - - INLINE N Renamed_Entity (E Id) - { return Node18 (Id); } - - INLINE N Renamed_Object (E Id) - { return Node18 (Id); } - - INLINE U Renaming_Map (E Id) - { return Uint9 (Id); } - - INLINE B Return_Present (E Id) - { return Flag54 (Id); } - - INLINE B Returns_By_Ref (E Id) - { return Flag90 (Id); } - - INLINE B Reverse_Bit_Order (E Id) - { return Flag164 (Base_Type (Id)); } - - INLINE U RM_Size (E Id) - { return Uint13 (Id); } - - INLINE N Scalar_Range (E Id) - { return Node20 (Id); } - - INLINE U Scale_Value (E Id) - { return Uint15 (Id); } - - INLINE U Scope_Depth_Value (E Id) - { return Uint22 (Id); } - - INLINE B Sec_Stack_Needed_For_Return (E Id) - { return Flag167 (Id); } - - INLINE S Shadow_Entities (E Id) - { return List14 (Id); } - - INLINE E Shared_Var_Assign_Proc (E Id) - { return Node22 (Id); } - - INLINE E Shared_Var_Read_Proc (E Id) - { return Node15 (Id); } - - INLINE N Size_Check_Code (E Id) - { return Node19 (Id); } - - INLINE B Size_Depends_On_Discriminant (E Id) - { return Flag177 (Id); } - - INLINE B Size_Known_At_Compile_Time (E Id) - { return Flag92 (Id); } - - INLINE R Small_Value (E Id) - { return Ureal21 (Id); } - - INLINE E Spec_Entity (E Id) - { return Node19 (Id); } - - INLINE E Storage_Size_Variable (E Id) - { return Node15 (Implementation_Base_Type (Id)); } - - INLINE L Stored_Constraint (E Id) - { return Elist23 (Id); } - - INLINE B Strict_Alignment (E Id) - { return Flag145 (Implementation_Base_Type (Id)); } - - INLINE U String_Literal_Length (E Id) - { return Uint16 (Id); } - - INLINE N String_Literal_Low_Bound (E Id) - { return Node15 (Id); } - - INLINE B Suppress_Elaboration_Warnings (E Id) - { return Flag148 (Id); } - - INLINE B Suppress_Init_Proc (E Id) - { return Flag105 (Base_Type (Id)); } - - INLINE B Suppress_Style_Checks (E Id) - { return Flag165 (Id); } - - INLINE B Treat_As_Volatile (E Id) - { return Flag41 (Id); } - - INLINE E Underlying_Full_View (E Id) - { return Node19 (Id); } - - INLINE N Unset_Reference (E Id) - { return Node16 (Id); } - - INLINE B Uses_Sec_Stack (E Id) - { return Flag95 (Id); } - - INLINE B Vax_Float (E Id) - { return Flag151 (Base_Type (Id)); } - - INLINE B Warnings_Off (E Id) - { return Flag96 (Id); } - - INLINE B Is_Access_Type (E Id) - { return IN (Ekind (Id), Access_Kind); } - - INLINE B Is_Array_Type (E Id) - { return IN (Ekind (Id), Array_Kind); } - - INLINE B Is_Class_Wide_Type (E Id) - { return IN (Ekind (Id), Class_Wide_Kind); } - - INLINE B Is_Composite_Type (E Id) - { return IN (Ekind (Id), Composite_Kind); } - - INLINE B Is_Concurrent_Body (E Id) - { return IN (Ekind (Id), Concurrent_Body_Kind); } - - INLINE B Is_Concurrent_Record_Type (E Id) - { return Flag20 (Id); } - - INLINE B Is_Concurrent_Type (E Id) - { return IN (Ekind (Id), Concurrent_Kind); } - - INLINE B Is_Decimal_Fixed_Point_Type (E Id) - { return IN (Ekind (Id), Decimal_Fixed_Point_Kind); } - - INLINE B Is_Digits_Type (E Id) - { return IN (Ekind (Id), Digits_Kind); } - - INLINE B Is_Discrete_Or_Fixed_Point_Type (E Id) - { return IN (Ekind (Id), Discrete_Or_Fixed_Point_Kind); } - - INLINE B Is_Discrete_Type (E Id) - { return IN (Ekind (Id), Discrete_Kind); } - - INLINE B Is_Elementary_Type (E Id) - { return IN (Ekind (Id), Elementary_Kind); } - - INLINE B Is_Entry (E Id) - { return IN (Ekind (Id), Entry_Kind); } - - INLINE B Is_Enumeration_Type (E Id) - { return IN (Ekind (Id), Enumeration_Kind); } - - INLINE B Is_Fixed_Point_Type (E Id) - { return IN (Ekind (Id), Fixed_Point_Kind); } - - INLINE B Is_Floating_Point_Type (E Id) - { return IN (Ekind (Id), Float_Kind); } - - INLINE B Is_Formal (E Id) - { return IN (Ekind (Id), Formal_Kind); } - - INLINE B Is_Generic_Subprogram (E Id) - { return IN (Ekind (Id), Generic_Subprogram_Kind); } - - INLINE B Is_Generic_Unit (E Id) - { return IN (Ekind (Id), Generic_Unit_Kind); } - - INLINE B Is_Incomplete_Or_Private_Type (E Id) - { return IN (Ekind (Id), Incomplete_Or_Private_Kind); } - - INLINE B Is_Integer_Type (E Id) - { return IN (Ekind (Id), Integer_Kind); } - - INLINE B Is_Modular_Integer_Type (E Id) - { return IN (Ekind (Id), Modular_Integer_Kind); } - - INLINE B Is_Named_Number (E Id) - { return IN (Ekind (Id), Named_Kind); } - - INLINE B Is_Numeric_Type (E Id) - { return IN (Ekind (Id), Numeric_Kind); } - - INLINE B Is_Object (E Id) - { return IN (Ekind (Id), Object_Kind); } - - INLINE B Is_Ordinary_Fixed_Point_Type (E Id) - { return IN (Ekind (Id), Ordinary_Fixed_Point_Kind); } - - INLINE B Is_Overloadable (E Id) - { return IN (Ekind (Id), Overloadable_Kind); } - - INLINE B Is_Private_Type (E Id) - { return IN (Ekind (Id), Private_Kind); } - - INLINE B Is_Protected_Type (E Id) - { return IN (Ekind (Id), Protected_Kind); } - - INLINE B Is_Real_Type (E Id) - { return IN (Ekind (Id), Real_Kind); } - - INLINE B Is_Record_Type (E Id) - { return IN (Ekind (Id), Record_Kind); } - - INLINE B Is_Scalar_Type (E Id) - { return IN (Ekind (Id), Scalar_Kind); } - - INLINE B Is_Signed_Integer_Type (E Id) - { return IN (Ekind (Id), Signed_Integer_Kind); } - - INLINE B Is_Subprogram (E Id) - { return IN (Ekind (Id), Subprogram_Kind); } - - INLINE B Is_Task_Type (E Id) - { return IN (Ekind (Id), Task_Kind); } - - INLINE B Is_Type (E Id) - { return IN (Ekind (Id), Type_Kind); } - - INLINE N Entry_Index_Type (E Id) - { return Etype (Discrete_Subtype_Definition (Parent (Id))); } - - INLINE Node_Id Next_Index (Node_Id Id) - { return Next (Id); } - - INLINE E Next_Literal (E Id) - { return Next (Id); } - - INLINE Formal_Kind Parameter_Mode (E Id) - { return Ekind (Id); } - -/* End of einfo.h (C version of Einfo package specification) */ diff --git a/gcc/ada/gnat_wrapper.adb b/gcc/ada/gnat_wrapper.adb deleted file mode 100644 index 189cdc46ea1..00000000000 --- a/gcc/ada/gnat_wrapper.adb +++ /dev/null @@ -1,121 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- G N A T _ W R A P P E R -- --- -- --- B o d y -- --- -- --- Copyright (C) 2002-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- GNAT_Wrapper is to be used as the starter program for most of the GNAT --- executables. It sets up the working environment variables and calls the --- real executable which is to be found under the 'real' sub-directory. --- --- This avoids using the registry on Windows which is tricky to setup to run --- multiple compilers (GNAT Pro release and wavefronts for example) at the --- same time. - -with Ada.Command_Line; use Ada.Command_Line; -with GNAT.OS_Lib; use GNAT.OS_Lib; - -procedure GNAT_Wrapper is - DS : Character renames Directory_Separator; - PS : Character renames Path_Separator; - - procedure Split_Command; - -- Parse Actual_Name and set K and L variables (see below). - - Actual_Name : String_Access := new String'(Command_Name); - - K : Natural; - -- Index of the directory separator just before program name's first - -- character. - - L : Natural; - -- Index of the last character of the GNATPRO install directory. - - LD_LIBRARY_PATH : String_Access := Getenv ("LD_LIBRARY_PATH"); - PATH : String_Access := Getenv ("PATH"); - - ------------------- - -- Split_Command -- - ------------------- - - procedure Split_Command is - begin - K := Actual_Name'Last; - loop - exit when K = 0 - or else Actual_Name (K) = '\' or else Actual_Name (K) = '/'; - K := K - 1; - end loop; - end Split_Command; - -begin - Split_Command; - - if K = 0 then - -- No path information found, locate the program on the path. - declare - Old : String_Access := Actual_Name; - begin - Actual_Name := Locate_Exec_On_Path (Actual_Name.all); - Free (Old); - - Split_Command; - end; - end if; - - -- Skip 'bin' from directory above. GNAT binaries are always under - -- <gnatpro>/bin directory. - - L := K - 4; - - declare - Prog : constant String := Actual_Name (K + 1 .. Actual_Name'Last); - Dir : constant String := Actual_Name (Actual_Name'First .. L - 1); - Real : constant String := Dir & DS & ".bin"; - Bin : constant String := Dir & DS & "bin"; - Args : Argument_List (1 .. Argument_Count); - Result : Integer; - - begin - Setenv ("GCC_ROOT", Dir); - Setenv ("GNAT_ROOT", Dir); - Setenv ("BINUTILS_ROOT", Dir); - Setenv ("LD_LIBRARY_PATH", Dir & DS & "lib" & PS & LD_LIBRARY_PATH.all); - Setenv ("PATH", Real & PS & Bin & PS & PATH.all); - - -- Call the right executable under "<dir>/.bin" - - for K in 1 .. Argument_Count loop - Args (K) := new String'(Argument (K)); - end loop; - - Normalize_Arguments (Args); - Result := Spawn (Real & DS & Prog, Args); - - for K in 1 .. Argument_Count loop - Free (Args (K)); - end loop; - - OS_Exit (Result); - end; -end GNAT_Wrapper; diff --git a/gcc/ada/gnatpsta.adb b/gcc/ada/gnatpsta.adb deleted file mode 100644 index 502445d355f..00000000000 --- a/gcc/ada/gnatpsta.adb +++ /dev/null @@ -1,373 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT SYSTEM UTILITIES -- --- -- --- G N A T P S T A -- --- -- --- B o d y -- --- -- --- Copyright (C) 1997-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- Program to print out listing of Standard package for the target (not --- the host) with all constants appearing explicitly. This is not really --- valid Ada, since one cannot really define new base types, but it is a --- helpful listing from a documentation point of view. - --- Note that special care has been taken to use the host parameters for --- integer and floating point sizes. - -with Ada.Text_IO; use Ada.Text_IO; -with Gnatvsn; -with Ttypef; use Ttypef; -with Ttypes; use Ttypes; -with Types; use Types; - -procedure GnatPsta is - pragma Ident (Gnatvsn.Gnat_Static_Version_String); - - procedure P (Item : String) renames Ada.Text_IO.Put_Line; - - procedure P_Int_Range (Size : Pos; Put_First : Boolean := True); - -- Prints the range of an integer based on its Size. If Put_First is - -- False, then skip the first bound. - - procedure P_Float_Range (Nb_Digits : Pos); - -- Prints the maximum range of a Float whose 'Digits is given by Nb_Digits - - ------------------- - -- P_Float_Range -- - ------------------- - - procedure P_Float_Range (Nb_Digits : Pos) is - begin - -- This routine assumes only IEEE floats. - -- ??? Should the following be adapted for OpenVMS ? - - case Nb_Digits is - when IEEES_Digits => - P (" range " & IEEES_First'Universal_Literal_String & " .. " & - IEEES_Last'Universal_Literal_String & ";"); - when IEEEL_Digits => - P (" range " & IEEEL_First'Universal_Literal_String & " .. " & - IEEEL_Last'Universal_Literal_String & ";"); - when IEEEX_Digits => - P (" range " & IEEEX_First'Universal_Literal_String & " .. " & - IEEEX_Last'Universal_Literal_String & ";"); - - when others => - P (";"); - end case; - - -- If one of the floating point types of the host computer has the - -- same digits as the target float we are processing, then print out - -- the float range using the host computer float type. - - if Nb_Digits = Short_Float'Digits then - P (" -- " & - Short_Float'First'Img & " .. " & Short_Float'Last'Img); - - elsif Nb_Digits = Float'Digits then - P (" -- " & - Float'First'Img & " .. " & Float'Last'Img); - - elsif Nb_Digits = Long_Float'Digits then - P (" -- " & - Long_Float'First'Img & " .. " & Long_Float'Last'Img); - - elsif Nb_Digits = Long_Long_Float'Digits then - P (" -- " & - Long_Long_Float'First'Img & " .. " & Long_Long_Float'Last'Img); - end if; - - New_Line; - end P_Float_Range; - - ----------------- - -- P_Int_Range -- - ----------------- - - procedure P_Int_Range (Size : Pos; Put_First : Boolean := True) is - begin - if Put_First then - Put (" is range -(2 **" & Pos'Image (Size - 1) & ")"); - end if; - P (" .. +(2 **" & Pos'Image (Size - 1) & " - 1);"); - end P_Int_Range; - --- Start of processing for GnatPsta - -begin - P ("package Standard is"); - P ("pragma Pure(Standard);"); - New_Line; - - P (" type Boolean is (False, True);"); - New_Line; - - -- Integer types - - Put (" type Integer"); - P_Int_Range (Standard_Integer_Size); - New_Line; - - Put (" subtype Natural is Integer range 0"); - P_Int_Range (Standard_Integer_Size, Put_First => False); - - Put (" subtype Positive is Integer range 1"); - P_Int_Range (Standard_Integer_Size, Put_First => False); - New_Line; - - Put (" type Short_Short_Integer"); - P_Int_Range (Standard_Short_Short_Integer_Size); - - Put (" type Short_Integer "); - P_Int_Range (Standard_Short_Integer_Size); - - Put (" type Long_Integer "); - P_Int_Range (Standard_Long_Integer_Size); - - Put (" type Long_Long_Integer "); - P_Int_Range (Standard_Long_Long_Integer_Size); - New_Line; - - -- Floating point types - - P (" type Short_Float is digits" - & Standard_Short_Float_Digits'Img); - P_Float_Range (Standard_Short_Float_Digits); - - P (" type Float is digits" - & Standard_Float_Digits'Img); - P_Float_Range (Standard_Float_Digits); - - P (" type Long_Float is digits" - & Standard_Long_Float_Digits'Img); - P_Float_Range (Standard_Long_Float_Digits); - - P (" type Long_Long_Float is digits" - & Standard_Long_Long_Float_Digits'Img); - P_Float_Range (Standard_Long_Long_Float_Digits); - - P (" -- function ""*"" (Left : root_integer; Right : root_real)"); - P (" -- return root_real;"); - New_Line; - - P (" -- function ""*"" (Left : root_real; Right : root_integer)"); - P (" -- return root_real;"); - New_Line; - - P (" -- function ""/"" (Left : root_real; Right : root_integer)"); - P (" -- return root_real;"); - New_Line; - - P (" -- function ""*"" (Left : universal_fixed; " & - "Right : universal_fixed)"); - P (" -- return universal_fixed;"); - New_Line; - - P (" -- function ""/"" (Left : universal_fixed; " & - "Right : universal_fixed)"); - P (" -- return universal_fixed;"); - New_Line; - - P (" -- The declaration of type Character is based on the standard"); - P (" -- ISO 8859-1 character set."); - New_Line; - - P (" -- There are no character literals corresponding to the positions"); - P (" -- for control characters. They are indicated by lower case"); - P (" -- identifiers in the following list."); - New_Line; - - P (" -- Note: this type cannot be represented accurately in Ada"); - New_Line; - - P (" -- type Character is"); - New_Line; - - P (" -- (nul, soh, stx, etx, eot, enq, ack, bel,"); - P (" -- bs, ht, lf, vt, ff, cr, so, si,"); - New_Line; - - P (" -- dle, dc1, dc2, dc3, dc4, nak, syn, etb,"); - P (" -- can, em, sub, esc, fs, gs, rs, us,"); - New_Line; - - P (" -- ' ', '!', '""', '#', '$', '%', '&', ''',"); - P (" -- '(', ')', '*', '+', ',', '-', '.', '/',"); - New_Line; - - P (" -- '0', '1', '2', '3', '4', '5', '6', '7',"); - P (" -- '8', '9', ':', ';', '<', '=', '>', '?',"); - New_Line; - - P (" -- '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',"); - P (" -- 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',"); - New_Line; - - P (" -- 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',"); - P (" -- 'X', 'Y', 'Z', '[', '\', ']', '^', '_',"); - New_Line; - - P (" -- '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',"); - P (" -- 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',"); - New_Line; - - P (" -- 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',"); - P (" -- 'x', 'y', 'z', '{', '|', '}', '~', del,"); - New_Line; - - P (" -- reserved_128, reserved_129, bph, nbh,"); - P (" -- reserved_132, nel, ssa, esa,"); - New_Line; - - P (" -- hts, htj, vts, pld, plu, ri, ss2, ss3,"); - New_Line; - - P (" -- dcs, pu1, pu2, sts, cch, mw, spa, epa,"); - New_Line; - - P (" -- sos, reserved_153, sci, csi,"); - P (" -- st, osc, pm, apc,"); - New_Line; - - P (" -- ... );"); - New_Line; - - P (" -- The declaration of type Wide_Character is based " & - "on the standard"); - P (" -- ISO 10646 BMP character set."); - New_Line; - - P (" -- Note: this type cannot be represented accurately in Ada"); - New_Line; - - P (" -- The first 256 positions have the same contents as " & - "type Character"); - New_Line; - - P (" -- type Wide_Character is (nul, soh ... FFFE, FFFF);"); - New_Line; - - P (" package ASCII is"); - New_Line; - - P (" -- Control characters:"); - New_Line; - - P (" NUL : constant Character := Character'Val (16#00#);"); - P (" SOH : constant Character := Character'Val (16#01#);"); - P (" STX : constant Character := Character'Val (16#02#);"); - P (" ETX : constant Character := Character'Val (16#03#);"); - P (" EOT : constant Character := Character'Val (16#04#);"); - P (" ENQ : constant Character := Character'Val (16#05#);"); - P (" ACK : constant Character := Character'Val (16#06#);"); - P (" BEL : constant Character := Character'Val (16#07#);"); - P (" BS : constant Character := Character'Val (16#08#);"); - P (" HT : constant Character := Character'Val (16#09#);"); - P (" LF : constant Character := Character'Val (16#0A#);"); - P (" VT : constant Character := Character'Val (16#0B#);"); - P (" FF : constant Character := Character'Val (16#0C#);"); - P (" CR : constant Character := Character'Val (16#0D#);"); - P (" SO : constant Character := Character'Val (16#0E#);"); - P (" SI : constant Character := Character'Val (16#0F#);"); - P (" DLE : constant Character := Character'Val (16#10#);"); - P (" DC1 : constant Character := Character'Val (16#11#);"); - P (" DC2 : constant Character := Character'Val (16#12#);"); - P (" DC3 : constant Character := Character'Val (16#13#);"); - P (" DC4 : constant Character := Character'Val (16#14#);"); - P (" NAK : constant Character := Character'Val (16#15#);"); - P (" SYN : constant Character := Character'Val (16#16#);"); - P (" ETB : constant Character := Character'Val (16#17#);"); - P (" CAN : constant Character := Character'Val (16#18#);"); - P (" EM : constant Character := Character'Val (16#19#);"); - P (" SUB : constant Character := Character'Val (16#1A#);"); - P (" ESC : constant Character := Character'Val (16#1B#);"); - P (" FS : constant Character := Character'Val (16#1C#);"); - P (" GS : constant Character := Character'Val (16#1D#);"); - P (" RS : constant Character := Character'Val (16#1E#);"); - P (" US : constant Character := Character'Val (16#1F#);"); - P (" DEL : constant Character := Character'Val (16#7F#);"); - New_Line; - - P (" -- Other characters:"); - New_Line; - - P (" Exclam : constant Character := '!';"); - P (" Quotation : constant Character := '""';"); - P (" Sharp : constant Character := '#';"); - P (" Dollar : constant Character := '$';"); - P (" Percent : constant Character := '%';"); - P (" Ampersand : constant Character := '&';"); - P (" Colon : constant Character := ':';"); - P (" Semicolon : constant Character := ';';"); - P (" Query : constant Character := '?';"); - P (" At_Sign : constant Character := '@';"); - P (" L_Bracket : constant Character := '[';"); - P (" Back_Slash : constant Character := '\';"); - P (" R_Bracket : constant Character := ']';"); - P (" Circumflex : constant Character := '^';"); - P (" Underline : constant Character := '_';"); - P (" Grave : constant Character := '`';"); - P (" L_Brace : constant Character := '{';"); - P (" Bar : constant Character := '|';"); - P (" R_Brace : constant Character := '}';"); - P (" Tilde : constant Character := '~';"); - New_Line; - - P (" -- Lower case letters:"); - New_Line; - - for C in Character range 'a' .. 'z' loop - P (" LC_" & Character'Val (Character'Pos (C) - 32) & - " : constant Character := '" & C & "';"); - end loop; - New_Line; - - P (" end ASCII;"); - New_Line; - - P (" type String is array (Positive range <>) of Character;"); - P (" pragma Pack (String);"); - New_Line; - - P (" type Wide_String is array (Positive range <>) of Wide_Character;"); - P (" pragma Pack (Wide_String);"); - New_Line; - - -- Here it's OK to use the Duration type of the host compiler since - -- the implementation of Duration in GNAT is target independent. - - P (" type Duration is delta" & - Duration'Image (Duration'Delta)); - P (" range -((2 **" & Natural'Image (Duration'Size - 1) & - " - 1) *" & Duration'Image (Duration'Delta) & ") .."); - P (" +((2 **" & Natural'Image (Duration'Size - 1) & - " - 1) *" & Duration'Image (Duration'Delta) & ");"); - P (" for Duration'Small use" & Duration'Image (Duration'Small) & ";"); - New_Line; - - P (" Constraint_Error : exception;"); - P (" Program_Error : exception;"); - P (" Storage_Error : exception;"); - P (" Tasking_Error : exception;"); - New_Line; - - P ("end Standard;"); -end GnatPsta; diff --git a/gcc/ada/i-vthrea.adb b/gcc/ada/i-vthrea.adb deleted file mode 100644 index 049e1c4bf68..00000000000 --- a/gcc/ada/i-vthrea.adb +++ /dev/null @@ -1,386 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- I N T E R F A C E S . V T H R E A D S -- --- -- --- B o d y -- --- -- --- Copyright (C) 2002-2003, Free Software Foundation, Inc. -- --- -- --- GNARL is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNARL; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- Implement APEX process registration for AE653 - -with Ada.Exceptions; use Ada.Exceptions; -with Ada.Unchecked_Conversion; - -with Interfaces.C; - -with System.Secondary_Stack; -with System.Soft_Links; -with System.Task_Primitives.Ae_653; -with System.Task_Primitives.Operations; use System.Task_Primitives.Operations; -with System.Tasking; use System.Tasking; -with System.Task_Info; -with System.Tasking.Initialization; - -package body Interfaces.Vthreads is - - use System.OS_Interface; - - ----------------------- - -- Local Subprograms -- - ----------------------- - - procedure Enter_Task (T : Task_ID; Thread : Thread_Id); - -- Duplicate and generalize - -- System.Task_Primitives.Operations.Enter_Task - - procedure GNAT_Error_Handler (Sig : Signal); - -- Signal handler for ARINC processes - - procedure Init_Float; - pragma Import (C, Init_Float, "__gnat_init_float"); - -- Properly initializes the FPU for PPC systems. - - procedure Install_Handler; - -- Install signal handlers for the calling ARINC process - - function Register_Foreign_Thread (Thread : Thread_Id) return Task_ID; - -- Duplicate and generalize - -- System.Task_Primitives.Operations.Register_Foreign_Thread - - ----------------------------- - -- Install_Signal_Handlers -- - ----------------------------- - - function Install_Signal_Handlers return Interfaces.C.int is - begin - Install_Handler; - Init_Float; - return 0; - end Install_Signal_Handlers; - - ---------------------- - -- Register_Foreign -- - ---------------------- - - -- Create Ada task data structures for an ARINC process. All dynamic - -- allocation of related data structures must be done via this routine. - - function Register_Foreign (T : OSI.Thread_Id) return OSI.STATUS is - use Interfaces.C; - use System.Task_Primitives.Ae_653; - - pragma Assert (taskVarGet (T, ATCB_Key_Addr) = ERROR); - -- "T" is not yet registered - - Result : OSI.STATUS := taskIdVerify (T); - Status : OSI.STATUS := OK; - Temp_Id : Task_ID; - - begin - if Result = OK then - Status := taskVarGet (T, ATCB_Key_Addr); - - -- Error of already registered - - if Status /= ERROR then - Result := ERROR; - - else - -- Create a TCB - - declare - -- Make sure the caller has a TCB, since it's possible to have - -- pure C APEX processes that create ones calling Ada code - - Caller : Task_ID; - - begin - Status := taskVarGet (taskIdSelf, ATCB_Key_Addr); - - if Status = ERROR then - Caller := Register_Foreign_Thread (taskIdSelf); - end if; - end; - - if taskIdSelf /= T then - Temp_Id := Register_Foreign_Thread (T); - end if; - - Result := OK; - end if; - end if; - - return Result; - end Register_Foreign; - - ------------------- - -- Reset_Foreign -- - ------------------- - - -- Reinitialize Ada task data structures. No dynamic allocation - -- may occur via this routine. - - function Reset_Foreign (T : Thread_Id) return STATUS is - use Interfaces.C; - use System.Secondary_Stack; - use System.Task_Primitives.Ae_653; - use type System.Address; - - pragma Assert (taskVarGet (T, ATCB_Key_Addr) /= ERROR); - -- "T" has already been registered - - Result : STATUS := taskVarGet (T, ATCB_Key_Addr); - function To_Address is new Ada.Unchecked_Conversion - (Interfaces.C.int, System.Address); - - pragma Assert ( - To_Task_Id - (To_Address (Result)).Common.Compiler_Data.Sec_Stack_Addr - /= System.Null_Address); - -- "T" already has a secondary stack - - begin - if Result /= ERROR then - - -- Just reset the secondary stack pointer. The implementation here - -- assumes that the fixed secondary stack implementation is used. - -- If not, there will be a memory leak (along with allocation, which - -- is prohibited for ARINC processes once the system enters "normal" - -- mode). - - SS_Init - (To_Task_Id - (To_Address (Result)).Common.Compiler_Data.Sec_Stack_Addr); - Result := OK; - end if; - - return Result; - end Reset_Foreign; - - ------------------ - -- Setup_Thread -- - ------------------ - - function Setup_Thread return System.Address is - Result : System.Address := System.Null_Address; - Status : OSI.STATUS; - - begin - if Is_Valid_Task then - Status := Reset_Foreign (taskIdSelf); - Result := - To_Address (System.Task_Primitives.Operations.Self); - else - Status := Register_Foreign (taskIdSelf); - Install_Handler; - Init_Float; - Result := - To_Address (System.Task_Primitives.Operations.Self); - end if; - - return Result; - end Setup_Thread; - - ---------------- - -- Enter_Task -- - ---------------- - - procedure Enter_Task (T : Task_ID; Thread : Thread_Id) is - use System.Task_Primitives.Ae_653; - - begin - Set_Task_Thread (T, Thread); - end Enter_Task; - - ------------------------ - -- GNAT_Error_Handler -- - ------------------------ - - procedure GNAT_Error_Handler (Sig : Signal) is - Mask : aliased sigset_t; - Result : int; - - begin - -- This code is the Ada replacement for init.c in the - -- AE653 level B runtime. - - -- VxWorks will always mask out the signal during the signal - -- handler and will reenable it on a longjmp. GNAT does not - -- generate a longjmp to return from a signal handler so the - -- signal will still be masked unless we unmask it. - - Result := pthread_sigmask (SIG_SETMASK, null, Mask'Unchecked_Access); - Result := sigdelset (Mask'Access, Sig); - Result := pthread_sigmask (SIG_SETMASK, Mask'Unchecked_Access, null); - - case Sig is - when SIGFPE => - Raise_Exception (Constraint_Error'Identity, "SIGFPE"); - when SIGILL => - Raise_Exception (Constraint_Error'Identity, "SIGILL"); - when SIGSEGV => - Raise_Exception - (Program_Error'Identity, - "erroneous memory access"); - when SIGBUS => - -- SIGBUS indicates stack overflow when it occurs - -- in an application domain (but not in the Core - -- OS under AE653, or in the kernel domain under - -- AE 1.1). - Raise_Exception - (Storage_Error'Identity, - "stack overflow or SIGBUS"); - when others => - Raise_Exception (Program_Error'Identity, "unhandled signal"); - end case; - end GNAT_Error_Handler; - - --------------------- - -- Install_Handler -- - --------------------- - - procedure Install_Handler is - Mask : aliased sigset_t; - Signal_Action : aliased struct_sigaction; - Result : Interfaces.C.int; - - begin - -- Set up signal handler to map synchronous signals to appropriate - -- exceptions. Make sure that the handler isn't interrupted by - -- another signal that might cause a scheduling event! - - -- This code is the Ada replacement for init.c in the - -- AE653 level B runtime. - Signal_Action.sa_handler := GNAT_Error_Handler'Address; - Signal_Action.sa_flags := SA_ONSTACK; - Result := sigemptyset (Mask'Access); - Signal_Action.sa_mask := Mask; - - Result := sigaction - (Signal (SIGFPE), Signal_Action'Unchecked_Access, null); - - Result := sigaction - (Signal (SIGILL), Signal_Action'Unchecked_Access, null); - - Result := sigaction - (Signal (SIGSEGV), Signal_Action'Unchecked_Access, null); - - Result := sigaction - (Signal (SIGBUS), Signal_Action'Unchecked_Access, null); - - end Install_Handler; - - ----------------------------- - -- Register_Foreign_Thread -- - ----------------------------- - - Foreign_Task_Elaborated : aliased Boolean := True; - - function Register_Foreign_Thread (Thread : Thread_Id) return Task_ID is - pragma Assert (Thread = taskIdSelf or else Is_Valid_Task); - -- Ensure that allocation will work - - Local_ATCB : aliased Ada_Task_Control_Block (0); - New_Id : Task_ID; - Succeeded : Boolean; - - use type Interfaces.C.unsigned; - use type System.Address; - use System.Task_Info; - use System.Task_Primitives.Ae_653; - - begin - if taskIdSelf = Thread then - declare - Self : Task_ID := Local_ATCB'Unchecked_Access; - -- Temporarily record this as the Task_ID for the thread - - begin - Set_Current_Priority (Self, System.Priority'First); - Set_Task_Thread (Self, Thread); - end; - end if; - - pragma Assert (Is_Valid_Task); - -- It is now safe to use an allocator for the real TCB - - New_Id := new Ada_Task_Control_Block (0); - - -- Finish initialization - - System.Tasking.Initialize_ATCB - (New_Id, null, System.Null_Address, Null_Task, - Foreign_Task_Elaborated'Access, - System.Priority'First, - System.Task_Info.Unspecified_Task_Info, 0, New_Id, - Succeeded); - pragma Assert (Succeeded); - - New_Id.Master_of_Task := 0; - New_Id.Master_Within := New_Id.Master_of_Task + 1; - - for L in New_Id.Entry_Calls'Range loop - New_Id.Entry_Calls (L).Self := New_Id; - New_Id.Entry_Calls (L).Level := L; - end loop; - - New_Id.Common.State := Runnable; - New_Id.Awake_Count := 1; - - -- Since this is not an ordinary Ada task, we will start out undeferred - - New_Id.Deferral_Level := 0; - - System.Soft_Links.Create_TSD (New_Id.Common.Compiler_Data); - - -- Allocate a fixed secondary stack - - pragma Assert - (New_Id.Common.Compiler_Data.Sec_Stack_Addr = System.Null_Address); - System.Secondary_Stack.SS_Init - (New_Id.Common.Compiler_Data.Sec_Stack_Addr); - - Enter_Task (New_Id, Thread); - - return New_Id; - end Register_Foreign_Thread; - - -- Force use of tasking versions of secondary stack routines: - - procedure Force_Closure renames - System.Tasking.Initialization.Defer_Abortion; - pragma Unreferenced (Force_Closure); - --- Package elaboration code - -begin - -- Register the exported routines with the vThreads ARINC API - - procCreateHookAdd (Register_Foreign'Access); - procStartHookAdd (Reset_Foreign'Access); -end Interfaces.Vthreads; diff --git a/gcc/ada/i-vthrea.ads b/gcc/ada/i-vthrea.ads deleted file mode 100644 index d4a79757cfe..00000000000 --- a/gcc/ada/i-vthrea.ads +++ /dev/null @@ -1,93 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- I N T E R F A C E S . V T H R E A D S -- --- -- --- S p e c -- --- -- --- Copyright (C) 2002-2003, Free Software Foundation, Inc. -- --- -- --- GNARL is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNARL; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- Implement APEX process registration for AE653. The routines exported --- by this package are only called from the APEX CREATE and START routines --- in the AE653 vThreads API. A context clause for this unit must appear in --- the Ada APEX binding. --- --- If this package appears in a context clause for an application that will --- be run in a non-AE653 version of VxWorks, or in a non-vThreads AE653 --- partition, link or load errors for the symbols procCreateHookAdd and --- procStartHookAdd will occur, unless these routines are defined --- in the application. This is used when simulating AE653 in AE 1.1. - -with System.OS_Interface; -with Interfaces.C; - -package Interfaces.Vthreads is - - function Setup_Thread return System.Address; - -- Register an existing vxWorks task. This routine is used - -- under AE 1.1 when simulating AE 653. - - function Install_Signal_Handlers return Interfaces.C.int; - pragma Export (C, Install_Signal_Handlers, - "__gnat_install_signal_handlers"); - -- Map the synchronous signals SIGSEGV, SIGFPE, SIGILL and - -- SIGBUS to Ada exceptions for the calling ARINC process. - -- This routine should be called as early as possible in - -- each ARINC process body. - -- C declaration: - -- extern int __gnat_install_signal_handlers (); - -- This call is unnecessary on AE 1.1. - -private - package OSI renames System.OS_Interface; - - function Register_Foreign (T : OSI.Thread_Id) return OSI.STATUS; - -- Create runtime structures necessary for Ada language support for - -- an ARINC process. Called from APEX CREATE routine. - - function Reset_Foreign (T : OSI.Thread_Id) return OSI.STATUS; - -- Reset runtime structures upon an AE653 process restart. Called from - -- APEX START routine. - - -- When defining the following routines for export in an AE 1.1 - -- simulation of AE653, Interfaces.C.int may be used for the - -- parameters of FUNCPTR. - type FUNCPTR is access function (T : OSI.Thread_Id) return OSI.STATUS; - - -------------------------------- - -- Imported vThreads Routines -- - -------------------------------- - - procedure procCreateHookAdd (createHookFunction : FUNCPTR); - pragma Import (C, procCreateHookAdd, "procCreateHookAdd"); - -- Registers task registration routine for AE653 - - procedure procStartHookAdd (StartHookFunction : FUNCPTR); - pragma Import (C, procStartHookAdd, "procStartHookAdd"); - -- Registers task restart routine for AE653 - -end Interfaces.Vthreads; diff --git a/gcc/ada/nmake.adb b/gcc/ada/nmake.adb deleted file mode 100644 index 9b199faa0d0..00000000000 --- a/gcc/ada/nmake.adb +++ /dev/null @@ -1,2858 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- N M A K E -- --- -- --- B o d y -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - -pragma Style_Checks (All_Checks); --- Turn off subprogram order checking, since the routines here are --- generated automatically in order. - - -with Atree; use Atree; -with Sinfo; use Sinfo; -with Snames; use Snames; -with Stand; use Stand; - -package body Nmake is - - function Make_Unused_At_Start (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Unused_At_Start, Sloc); - begin - return N; - end Make_Unused_At_Start; - - function Make_Unused_At_End (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Unused_At_End, Sloc); - begin - return N; - end Make_Unused_At_End; - - function Make_Identifier (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Identifier, Sloc); - begin - Set_Chars (N, Chars); - return N; - end Make_Identifier; - - function Make_Integer_Literal (Sloc : Source_Ptr; - Intval : Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Integer_Literal, Sloc); - begin - Set_Intval (N, Intval); - return N; - end Make_Integer_Literal; - - function Make_Real_Literal (Sloc : Source_Ptr; - Realval : Ureal) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Real_Literal, Sloc); - begin - Set_Realval (N, Realval); - return N; - end Make_Real_Literal; - - function Make_Character_Literal (Sloc : Source_Ptr; - Chars : Name_Id; - Char_Literal_Value : Char_Code) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Character_Literal, Sloc); - begin - Set_Chars (N, Chars); - Set_Char_Literal_Value (N, Char_Literal_Value); - return N; - end Make_Character_Literal; - - function Make_String_Literal (Sloc : Source_Ptr; - Strval : String_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_String_Literal, Sloc); - begin - Set_Strval (N, Strval); - return N; - end Make_String_Literal; - - function Make_Pragma (Sloc : Source_Ptr; - Chars : Name_Id; - Pragma_Argument_Associations : List_Id := No_List; - Debug_Statement : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Pragma, Sloc); - begin - Set_Chars (N, Chars); - Set_Pragma_Argument_Associations - (N, Pragma_Argument_Associations); - Set_Debug_Statement (N, Debug_Statement); - return N; - end Make_Pragma; - - function Make_Pragma_Argument_Association (Sloc : Source_Ptr; - Chars : Name_Id := No_Name; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Pragma_Argument_Association, Sloc); - begin - Set_Chars (N, Chars); - Set_Expression (N, Expression); - return N; - end Make_Pragma_Argument_Association; - - function Make_Defining_Identifier (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id - is - N : constant Node_Id := - New_Entity (N_Defining_Identifier, Sloc); - begin - Set_Chars (N, Chars); - return N; - end Make_Defining_Identifier; - - function Make_Full_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Type_Definition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Full_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Type_Definition (N, Type_Definition); - return N; - end Make_Full_Type_Declaration; - - function Make_Subtype_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Subtype_Indication : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subtype_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Subtype_Indication (N, Subtype_Indication); - return N; - end Make_Subtype_Declaration; - - function Make_Subtype_Indication (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Constraint : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subtype_Indication, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - Set_Constraint (N, Constraint); - return N; - end Make_Subtype_Indication; - - function Make_Object_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Aliased_Present : Boolean := False; - Constant_Present : Boolean := False; - Object_Definition : Node_Id; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Object_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Aliased_Present (N, Aliased_Present); - Set_Constant_Present (N, Constant_Present); - Set_Object_Definition (N, Object_Definition); - Set_Expression (N, Expression); - return N; - end Make_Object_Declaration; - - function Make_Number_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Number_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Expression (N, Expression); - return N; - end Make_Number_Declaration; - - function Make_Derived_Type_Definition (Sloc : Source_Ptr; - Abstract_Present : Boolean := False; - Subtype_Indication : Node_Id; - Record_Extension_Part : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Derived_Type_Definition, Sloc); - begin - Set_Abstract_Present (N, Abstract_Present); - Set_Subtype_Indication (N, Subtype_Indication); - Set_Record_Extension_Part (N, Record_Extension_Part); - return N; - end Make_Derived_Type_Definition; - - function Make_Range_Constraint (Sloc : Source_Ptr; - Range_Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Range_Constraint, Sloc); - begin - Set_Range_Expression (N, Range_Expression); - return N; - end Make_Range_Constraint; - - function Make_Range (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id; - Includes_Infinities : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Range, Sloc); - begin - Set_Low_Bound (N, Low_Bound); - Set_High_Bound (N, High_Bound); - Set_Includes_Infinities (N, Includes_Infinities); - return N; - end Make_Range; - - function Make_Enumeration_Type_Definition (Sloc : Source_Ptr; - Literals : List_Id; - End_Label : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Enumeration_Type_Definition, Sloc); - begin - Set_Literals (N, Literals); - Set_End_Label (N, End_Label); - return N; - end Make_Enumeration_Type_Definition; - - function Make_Defining_Character_Literal (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id - is - N : constant Node_Id := - New_Entity (N_Defining_Character_Literal, Sloc); - begin - Set_Chars (N, Chars); - return N; - end Make_Defining_Character_Literal; - - function Make_Signed_Integer_Type_Definition (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Signed_Integer_Type_Definition, Sloc); - begin - Set_Low_Bound (N, Low_Bound); - Set_High_Bound (N, High_Bound); - return N; - end Make_Signed_Integer_Type_Definition; - - function Make_Modular_Type_Definition (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Modular_Type_Definition, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Modular_Type_Definition; - - function Make_Floating_Point_Definition (Sloc : Source_Ptr; - Digits_Expression : Node_Id; - Real_Range_Specification : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Floating_Point_Definition, Sloc); - begin - Set_Digits_Expression (N, Digits_Expression); - Set_Real_Range_Specification (N, Real_Range_Specification); - return N; - end Make_Floating_Point_Definition; - - function Make_Real_Range_Specification (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Real_Range_Specification, Sloc); - begin - Set_Low_Bound (N, Low_Bound); - Set_High_Bound (N, High_Bound); - return N; - end Make_Real_Range_Specification; - - function Make_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Real_Range_Specification : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Ordinary_Fixed_Point_Definition, Sloc); - begin - Set_Delta_Expression (N, Delta_Expression); - Set_Real_Range_Specification (N, Real_Range_Specification); - return N; - end Make_Ordinary_Fixed_Point_Definition; - - function Make_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Digits_Expression : Node_Id; - Real_Range_Specification : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Decimal_Fixed_Point_Definition, Sloc); - begin - Set_Delta_Expression (N, Delta_Expression); - Set_Digits_Expression (N, Digits_Expression); - Set_Real_Range_Specification (N, Real_Range_Specification); - return N; - end Make_Decimal_Fixed_Point_Definition; - - function Make_Digits_Constraint (Sloc : Source_Ptr; - Digits_Expression : Node_Id; - Range_Constraint : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Digits_Constraint, Sloc); - begin - Set_Digits_Expression (N, Digits_Expression); - Set_Range_Constraint (N, Range_Constraint); - return N; - end Make_Digits_Constraint; - - function Make_Unconstrained_Array_Definition (Sloc : Source_Ptr; - Subtype_Marks : List_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Unconstrained_Array_Definition, Sloc); - begin - Set_Subtype_Marks (N, Subtype_Marks); - Set_Aliased_Present (N, Aliased_Present); - Set_Subtype_Indication (N, Subtype_Indication); - return N; - end Make_Unconstrained_Array_Definition; - - function Make_Constrained_Array_Definition (Sloc : Source_Ptr; - Discrete_Subtype_Definitions : List_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Constrained_Array_Definition, Sloc); - begin - Set_Discrete_Subtype_Definitions - (N, Discrete_Subtype_Definitions); - Set_Aliased_Present (N, Aliased_Present); - Set_Subtype_Indication (N, Subtype_Indication); - return N; - end Make_Constrained_Array_Definition; - - function Make_Discriminant_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Type : Node_Id; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Discriminant_Specification, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Type (N, Discriminant_Type); - Set_Expression (N, Expression); - return N; - end Make_Discriminant_Specification; - - function Make_Index_Or_Discriminant_Constraint (Sloc : Source_Ptr; - Constraints : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Index_Or_Discriminant_Constraint, Sloc); - begin - Set_Constraints (N, Constraints); - return N; - end Make_Index_Or_Discriminant_Constraint; - - function Make_Discriminant_Association (Sloc : Source_Ptr; - Selector_Names : List_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Discriminant_Association, Sloc); - begin - Set_Selector_Names (N, Selector_Names); - Set_Expression (N, Expression); - return N; - end Make_Discriminant_Association; - - function Make_Record_Definition (Sloc : Source_Ptr; - End_Label : Node_Id := Empty; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False; - Component_List : Node_Id; - Null_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Record_Definition, Sloc); - begin - Set_End_Label (N, End_Label); - Set_Abstract_Present (N, Abstract_Present); - Set_Tagged_Present (N, Tagged_Present); - Set_Limited_Present (N, Limited_Present); - Set_Component_List (N, Component_List); - Set_Null_Present (N, Null_Present); - return N; - end Make_Record_Definition; - - function Make_Component_List (Sloc : Source_Ptr; - Component_Items : List_Id; - Variant_Part : Node_Id := Empty; - Null_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Component_List, Sloc); - begin - Set_Component_Items (N, Component_Items); - Set_Variant_Part (N, Variant_Part); - Set_Null_Present (N, Null_Present); - return N; - end Make_Component_List; - - function Make_Component_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Component_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Aliased_Present (N, Aliased_Present); - Set_Subtype_Indication (N, Subtype_Indication); - Set_Expression (N, Expression); - return N; - end Make_Component_Declaration; - - function Make_Variant_Part (Sloc : Source_Ptr; - Name : Node_Id; - Variants : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Variant_Part, Sloc); - begin - Set_Name (N, Name); - Set_Variants (N, Variants); - return N; - end Make_Variant_Part; - - function Make_Variant (Sloc : Source_Ptr; - Discrete_Choices : List_Id; - Component_List : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Variant, Sloc); - begin - Set_Discrete_Choices (N, Discrete_Choices); - Set_Component_List (N, Component_List); - return N; - end Make_Variant; - - function Make_Others_Choice (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Others_Choice, Sloc); - begin - return N; - end Make_Others_Choice; - - function Make_Access_To_Object_Definition (Sloc : Source_Ptr; - All_Present : Boolean := False; - Subtype_Indication : Node_Id; - Constant_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Access_To_Object_Definition, Sloc); - begin - Set_All_Present (N, All_Present); - Set_Subtype_Indication (N, Subtype_Indication); - Set_Constant_Present (N, Constant_Present); - return N; - end Make_Access_To_Object_Definition; - - function Make_Access_Function_Definition (Sloc : Source_Ptr; - Protected_Present : Boolean := False; - Parameter_Specifications : List_Id := No_List; - Subtype_Mark : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Access_Function_Definition, Sloc); - begin - Set_Protected_Present (N, Protected_Present); - Set_Parameter_Specifications (N, Parameter_Specifications); - Set_Subtype_Mark (N, Subtype_Mark); - return N; - end Make_Access_Function_Definition; - - function Make_Access_Procedure_Definition (Sloc : Source_Ptr; - Protected_Present : Boolean := False; - Parameter_Specifications : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Access_Procedure_Definition, Sloc); - begin - Set_Protected_Present (N, Protected_Present); - Set_Parameter_Specifications (N, Parameter_Specifications); - return N; - end Make_Access_Procedure_Definition; - - function Make_Access_Definition (Sloc : Source_Ptr; - Subtype_Mark : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Access_Definition, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - return N; - end Make_Access_Definition; - - function Make_Incomplete_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Incomplete_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Unknown_Discriminants_Present - (N, Unknown_Discriminants_Present); - return N; - end Make_Incomplete_Type_Declaration; - - function Make_Explicit_Dereference (Sloc : Source_Ptr; - Prefix : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Explicit_Dereference, Sloc); - begin - Set_Prefix (N, Prefix); - return N; - end Make_Explicit_Dereference; - - function Make_Indexed_Component (Sloc : Source_Ptr; - Prefix : Node_Id; - Expressions : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Indexed_Component, Sloc); - begin - Set_Prefix (N, Prefix); - Set_Expressions (N, Expressions); - return N; - end Make_Indexed_Component; - - function Make_Slice (Sloc : Source_Ptr; - Prefix : Node_Id; - Discrete_Range : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Slice, Sloc); - begin - Set_Prefix (N, Prefix); - Set_Discrete_Range (N, Discrete_Range); - return N; - end Make_Slice; - - function Make_Selected_Component (Sloc : Source_Ptr; - Prefix : Node_Id; - Selector_Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Selected_Component, Sloc); - begin - Set_Prefix (N, Prefix); - Set_Selector_Name (N, Selector_Name); - return N; - end Make_Selected_Component; - - function Make_Attribute_Reference (Sloc : Source_Ptr; - Prefix : Node_Id; - Attribute_Name : Name_Id; - Expressions : List_Id := No_List; - Must_Be_Byte_Aligned : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Attribute_Reference, Sloc); - begin - Set_Prefix (N, Prefix); - Set_Attribute_Name (N, Attribute_Name); - Set_Expressions (N, Expressions); - Set_Must_Be_Byte_Aligned (N, Must_Be_Byte_Aligned); - return N; - end Make_Attribute_Reference; - - function Make_Aggregate (Sloc : Source_Ptr; - Expressions : List_Id := No_List; - Component_Associations : List_Id := No_List; - Null_Record_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Aggregate, Sloc); - begin - Set_Expressions (N, Expressions); - Set_Component_Associations (N, Component_Associations); - Set_Null_Record_Present (N, Null_Record_Present); - return N; - end Make_Aggregate; - - function Make_Component_Association (Sloc : Source_Ptr; - Choices : List_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Component_Association, Sloc); - begin - Set_Choices (N, Choices); - Set_Expression (N, Expression); - return N; - end Make_Component_Association; - - function Make_Extension_Aggregate (Sloc : Source_Ptr; - Ancestor_Part : Node_Id; - Expressions : List_Id := No_List; - Component_Associations : List_Id := No_List; - Null_Record_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Extension_Aggregate, Sloc); - begin - Set_Ancestor_Part (N, Ancestor_Part); - Set_Expressions (N, Expressions); - Set_Component_Associations (N, Component_Associations); - Set_Null_Record_Present (N, Null_Record_Present); - return N; - end Make_Extension_Aggregate; - - function Make_Null (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Null, Sloc); - begin - return N; - end Make_Null; - - function Make_And_Then (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_And_Then, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - return N; - end Make_And_Then; - - function Make_Or_Else (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Or_Else, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - return N; - end Make_Or_Else; - - function Make_In (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_In, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - return N; - end Make_In; - - function Make_Not_In (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Not_In, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - return N; - end Make_Not_In; - - function Make_Op_And (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_And, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_And); - Set_Entity (N, Standard_Op_And); - return N; - end Make_Op_And; - - function Make_Op_Or (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Or, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Or); - Set_Entity (N, Standard_Op_Or); - return N; - end Make_Op_Or; - - function Make_Op_Xor (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Xor, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Xor); - Set_Entity (N, Standard_Op_Xor); - return N; - end Make_Op_Xor; - - function Make_Op_Eq (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Eq, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Eq); - Set_Entity (N, Standard_Op_Eq); - return N; - end Make_Op_Eq; - - function Make_Op_Ne (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Ne, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Ne); - Set_Entity (N, Standard_Op_Ne); - return N; - end Make_Op_Ne; - - function Make_Op_Lt (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Lt, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Lt); - Set_Entity (N, Standard_Op_Lt); - return N; - end Make_Op_Lt; - - function Make_Op_Le (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Le, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Le); - Set_Entity (N, Standard_Op_Le); - return N; - end Make_Op_Le; - - function Make_Op_Gt (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Gt, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Gt); - Set_Entity (N, Standard_Op_Gt); - return N; - end Make_Op_Gt; - - function Make_Op_Ge (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Ge, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Ge); - Set_Entity (N, Standard_Op_Ge); - return N; - end Make_Op_Ge; - - function Make_Op_Add (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Add, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Add); - Set_Entity (N, Standard_Op_Add); - return N; - end Make_Op_Add; - - function Make_Op_Subtract (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Subtract, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Subtract); - Set_Entity (N, Standard_Op_Subtract); - return N; - end Make_Op_Subtract; - - function Make_Op_Concat (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Concat, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Concat); - Set_Entity (N, Standard_Op_Concat); - return N; - end Make_Op_Concat; - - function Make_Op_Multiply (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Multiply, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Multiply); - Set_Entity (N, Standard_Op_Multiply); - return N; - end Make_Op_Multiply; - - function Make_Op_Divide (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Divide, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Divide); - Set_Entity (N, Standard_Op_Divide); - return N; - end Make_Op_Divide; - - function Make_Op_Mod (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Mod, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Mod); - Set_Entity (N, Standard_Op_Mod); - return N; - end Make_Op_Mod; - - function Make_Op_Rem (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Rem, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Rem); - Set_Entity (N, Standard_Op_Rem); - return N; - end Make_Op_Rem; - - function Make_Op_Expon (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Expon, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Expon); - Set_Entity (N, Standard_Op_Expon); - return N; - end Make_Op_Expon; - - function Make_Op_Plus (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Plus, Sloc); - begin - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Add); - Set_Entity (N, Standard_Op_Plus); - return N; - end Make_Op_Plus; - - function Make_Op_Minus (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Minus, Sloc); - begin - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Subtract); - Set_Entity (N, Standard_Op_Minus); - return N; - end Make_Op_Minus; - - function Make_Op_Abs (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Abs, Sloc); - begin - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Abs); - Set_Entity (N, Standard_Op_Abs); - return N; - end Make_Op_Abs; - - function Make_Op_Not (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Not, Sloc); - begin - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Op_Not); - Set_Entity (N, Standard_Op_Not); - return N; - end Make_Op_Not; - - function Make_Type_Conversion (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Type_Conversion, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - Set_Expression (N, Expression); - return N; - end Make_Type_Conversion; - - function Make_Qualified_Expression (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Qualified_Expression, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - Set_Expression (N, Expression); - return N; - end Make_Qualified_Expression; - - function Make_Allocator (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Allocator, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Allocator; - - function Make_Null_Statement (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Null_Statement, Sloc); - begin - return N; - end Make_Null_Statement; - - function Make_Label (Sloc : Source_Ptr; - Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Label, Sloc); - begin - Set_Identifier (N, Identifier); - return N; - end Make_Label; - - function Make_Assignment_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Assignment_Statement, Sloc); - begin - Set_Name (N, Name); - Set_Expression (N, Expression); - return N; - end Make_Assignment_Statement; - - function Make_If_Statement (Sloc : Source_Ptr; - Condition : Node_Id; - Then_Statements : List_Id; - Elsif_Parts : List_Id := No_List; - Else_Statements : List_Id := No_List; - End_Span : Uint := No_Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_If_Statement, Sloc); - begin - Set_Condition (N, Condition); - Set_Then_Statements (N, Then_Statements); - Set_Elsif_Parts (N, Elsif_Parts); - Set_Else_Statements (N, Else_Statements); - Set_End_Span (N, End_Span); - return N; - end Make_If_Statement; - - function Make_Elsif_Part (Sloc : Source_Ptr; - Condition : Node_Id; - Then_Statements : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Elsif_Part, Sloc); - begin - Set_Condition (N, Condition); - Set_Then_Statements (N, Then_Statements); - return N; - end Make_Elsif_Part; - - function Make_Case_Statement (Sloc : Source_Ptr; - Expression : Node_Id; - Alternatives : List_Id; - End_Span : Uint := No_Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Case_Statement, Sloc); - begin - Set_Expression (N, Expression); - Set_Alternatives (N, Alternatives); - Set_End_Span (N, End_Span); - return N; - end Make_Case_Statement; - - function Make_Case_Statement_Alternative (Sloc : Source_Ptr; - Discrete_Choices : List_Id; - Statements : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Case_Statement_Alternative, Sloc); - begin - Set_Discrete_Choices (N, Discrete_Choices); - Set_Statements (N, Statements); - return N; - end Make_Case_Statement_Alternative; - - function Make_Loop_Statement (Sloc : Source_Ptr; - Identifier : Node_Id := Empty; - Iteration_Scheme : Node_Id := Empty; - Statements : List_Id; - End_Label : Node_Id; - Has_Created_Identifier : Boolean := False; - Is_Null_Loop : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Loop_Statement, Sloc); - begin - Set_Identifier (N, Identifier); - Set_Iteration_Scheme (N, Iteration_Scheme); - Set_Statements (N, Statements); - Set_End_Label (N, End_Label); - Set_Has_Created_Identifier (N, Has_Created_Identifier); - Set_Is_Null_Loop (N, Is_Null_Loop); - return N; - end Make_Loop_Statement; - - function Make_Iteration_Scheme (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Loop_Parameter_Specification : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Iteration_Scheme, Sloc); - begin - Set_Condition (N, Condition); - Set_Loop_Parameter_Specification - (N, Loop_Parameter_Specification); - return N; - end Make_Iteration_Scheme; - - function Make_Loop_Parameter_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Reverse_Present : Boolean := False; - Discrete_Subtype_Definition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Loop_Parameter_Specification, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Reverse_Present (N, Reverse_Present); - Set_Discrete_Subtype_Definition (N, Discrete_Subtype_Definition); - return N; - end Make_Loop_Parameter_Specification; - - function Make_Block_Statement (Sloc : Source_Ptr; - Identifier : Node_Id := Empty; - Declarations : List_Id := No_List; - Handled_Statement_Sequence : Node_Id; - Has_Created_Identifier : Boolean := False; - Is_Task_Allocation_Block : Boolean := False; - Is_Asynchronous_Call_Block : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Block_Statement, Sloc); - begin - Set_Identifier (N, Identifier); - Set_Declarations (N, Declarations); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - Set_Has_Created_Identifier (N, Has_Created_Identifier); - Set_Is_Task_Allocation_Block (N, Is_Task_Allocation_Block); - Set_Is_Asynchronous_Call_Block (N, Is_Asynchronous_Call_Block); - return N; - end Make_Block_Statement; - - function Make_Exit_Statement (Sloc : Source_Ptr; - Name : Node_Id := Empty; - Condition : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Exit_Statement, Sloc); - begin - Set_Name (N, Name); - Set_Condition (N, Condition); - return N; - end Make_Exit_Statement; - - function Make_Goto_Statement (Sloc : Source_Ptr; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Goto_Statement, Sloc); - begin - Set_Name (N, Name); - return N; - end Make_Goto_Statement; - - function Make_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subprogram_Declaration, Sloc); - begin - Set_Specification (N, Specification); - return N; - end Make_Subprogram_Declaration; - - function Make_Abstract_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Abstract_Subprogram_Declaration, Sloc); - begin - Set_Specification (N, Specification); - return N; - end Make_Abstract_Subprogram_Declaration; - - function Make_Function_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Parameter_Specifications : List_Id := No_List; - Subtype_Mark : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Function_Specification, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Parameter_Specifications (N, Parameter_Specifications); - Set_Subtype_Mark (N, Subtype_Mark); - return N; - end Make_Function_Specification; - - function Make_Procedure_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Parameter_Specifications : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Procedure_Specification, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Parameter_Specifications (N, Parameter_Specifications); - return N; - end Make_Procedure_Specification; - - function Make_Designator (Sloc : Source_Ptr; - Name : Node_Id; - Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Designator, Sloc); - begin - Set_Name (N, Name); - Set_Identifier (N, Identifier); - return N; - end Make_Designator; - - function Make_Defining_Program_Unit_Name (Sloc : Source_Ptr; - Name : Node_Id; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Defining_Program_Unit_Name, Sloc); - begin - Set_Name (N, Name); - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Defining_Program_Unit_Name; - - function Make_Operator_Symbol (Sloc : Source_Ptr; - Chars : Name_Id; - Strval : String_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Operator_Symbol, Sloc); - begin - Set_Chars (N, Chars); - Set_Strval (N, Strval); - return N; - end Make_Operator_Symbol; - - function Make_Defining_Operator_Symbol (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id - is - N : constant Node_Id := - New_Entity (N_Defining_Operator_Symbol, Sloc); - begin - Set_Chars (N, Chars); - return N; - end Make_Defining_Operator_Symbol; - - function Make_Parameter_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - In_Present : Boolean := False; - Out_Present : Boolean := False; - Parameter_Type : Node_Id; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Parameter_Specification, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_In_Present (N, In_Present); - Set_Out_Present (N, Out_Present); - Set_Parameter_Type (N, Parameter_Type); - Set_Expression (N, Expression); - return N; - end Make_Parameter_Specification; - - function Make_Subprogram_Body (Sloc : Source_Ptr; - Specification : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id; - Bad_Is_Detected : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subprogram_Body, Sloc); - begin - Set_Specification (N, Specification); - Set_Declarations (N, Declarations); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - Set_Bad_Is_Detected (N, Bad_Is_Detected); - return N; - end Make_Subprogram_Body; - - function Make_Procedure_Call_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Procedure_Call_Statement, Sloc); - begin - Set_Name (N, Name); - Set_Parameter_Associations (N, Parameter_Associations); - return N; - end Make_Procedure_Call_Statement; - - function Make_Function_Call (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Function_Call, Sloc); - begin - Set_Name (N, Name); - Set_Parameter_Associations (N, Parameter_Associations); - return N; - end Make_Function_Call; - - function Make_Parameter_Association (Sloc : Source_Ptr; - Selector_Name : Node_Id; - Explicit_Actual_Parameter : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Parameter_Association, Sloc); - begin - Set_Selector_Name (N, Selector_Name); - Set_Explicit_Actual_Parameter (N, Explicit_Actual_Parameter); - return N; - end Make_Parameter_Association; - - function Make_Return_Statement (Sloc : Source_Ptr; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Return_Statement, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Return_Statement; - - function Make_Package_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Declaration, Sloc); - begin - Set_Specification (N, Specification); - return N; - end Make_Package_Declaration; - - function Make_Package_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Specification, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Visible_Declarations (N, Visible_Declarations); - Set_Private_Declarations (N, Private_Declarations); - Set_End_Label (N, End_Label); - return N; - end Make_Package_Specification; - - function Make_Package_Body (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Body, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Declarations (N, Declarations); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - return N; - end Make_Package_Body; - - function Make_Private_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Private_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Unknown_Discriminants_Present - (N, Unknown_Discriminants_Present); - Set_Abstract_Present (N, Abstract_Present); - Set_Tagged_Present (N, Tagged_Present); - Set_Limited_Present (N, Limited_Present); - return N; - end Make_Private_Type_Declaration; - - function Make_Private_Extension_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False; - Abstract_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Private_Extension_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Unknown_Discriminants_Present - (N, Unknown_Discriminants_Present); - Set_Abstract_Present (N, Abstract_Present); - Set_Subtype_Indication (N, Subtype_Indication); - return N; - end Make_Private_Extension_Declaration; - - function Make_Use_Package_Clause (Sloc : Source_Ptr; - Names : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Use_Package_Clause, Sloc); - begin - Set_Names (N, Names); - return N; - end Make_Use_Package_Clause; - - function Make_Use_Type_Clause (Sloc : Source_Ptr; - Subtype_Marks : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Use_Type_Clause, Sloc); - begin - Set_Subtype_Marks (N, Subtype_Marks); - return N; - end Make_Use_Type_Clause; - - function Make_Object_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Subtype_Mark : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Object_Renaming_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Subtype_Mark (N, Subtype_Mark); - Set_Name (N, Name); - return N; - end Make_Object_Renaming_Declaration; - - function Make_Exception_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Exception_Renaming_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Name (N, Name); - return N; - end Make_Exception_Renaming_Declaration; - - function Make_Package_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Renaming_Declaration, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - return N; - end Make_Package_Renaming_Declaration; - - function Make_Subprogram_Renaming_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subprogram_Renaming_Declaration, Sloc); - begin - Set_Specification (N, Specification); - Set_Name (N, Name); - return N; - end Make_Subprogram_Renaming_Declaration; - - function Make_Generic_Package_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Package_Renaming_Declaration, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - return N; - end Make_Generic_Package_Renaming_Declaration; - - function Make_Generic_Procedure_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Procedure_Renaming_Declaration, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - return N; - end Make_Generic_Procedure_Renaming_Declaration; - - function Make_Generic_Function_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Function_Renaming_Declaration, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - return N; - end Make_Generic_Function_Renaming_Declaration; - - function Make_Task_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Task_Definition : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Task_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Task_Definition (N, Task_Definition); - return N; - end Make_Task_Type_Declaration; - - function Make_Single_Task_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Task_Definition : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Single_Task_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Task_Definition (N, Task_Definition); - return N; - end Make_Single_Task_Declaration; - - function Make_Task_Definition (Sloc : Source_Ptr; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Task_Definition, Sloc); - begin - Set_Visible_Declarations (N, Visible_Declarations); - Set_Private_Declarations (N, Private_Declarations); - Set_End_Label (N, End_Label); - return N; - end Make_Task_Definition; - - function Make_Task_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Task_Body, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Declarations (N, Declarations); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - return N; - end Make_Task_Body; - - function Make_Protected_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Protected_Definition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Protected_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Protected_Definition (N, Protected_Definition); - return N; - end Make_Protected_Type_Declaration; - - function Make_Single_Protected_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Protected_Definition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Single_Protected_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Protected_Definition (N, Protected_Definition); - return N; - end Make_Single_Protected_Declaration; - - function Make_Protected_Definition (Sloc : Source_Ptr; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Protected_Definition, Sloc); - begin - Set_Visible_Declarations (N, Visible_Declarations); - Set_Private_Declarations (N, Private_Declarations); - Set_End_Label (N, End_Label); - return N; - end Make_Protected_Definition; - - function Make_Protected_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Declarations : List_Id; - End_Label : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Protected_Body, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Declarations (N, Declarations); - Set_End_Label (N, End_Label); - return N; - end Make_Protected_Body; - - function Make_Entry_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discrete_Subtype_Definition : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discrete_Subtype_Definition (N, Discrete_Subtype_Definition); - Set_Parameter_Specifications (N, Parameter_Specifications); - return N; - end Make_Entry_Declaration; - - function Make_Accept_Statement (Sloc : Source_Ptr; - Entry_Direct_Name : Node_Id; - Entry_Index : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List; - Handled_Statement_Sequence : Node_Id; - Declarations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Accept_Statement, Sloc); - begin - Set_Entry_Direct_Name (N, Entry_Direct_Name); - Set_Entry_Index (N, Entry_Index); - Set_Parameter_Specifications (N, Parameter_Specifications); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - Set_Declarations (N, Declarations); - return N; - end Make_Accept_Statement; - - function Make_Entry_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Entry_Body_Formal_Part : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Body, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Entry_Body_Formal_Part (N, Entry_Body_Formal_Part); - Set_Declarations (N, Declarations); - Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence); - return N; - end Make_Entry_Body; - - function Make_Entry_Body_Formal_Part (Sloc : Source_Ptr; - Entry_Index_Specification : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List; - Condition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Body_Formal_Part, Sloc); - begin - Set_Entry_Index_Specification (N, Entry_Index_Specification); - Set_Parameter_Specifications (N, Parameter_Specifications); - Set_Condition (N, Condition); - return N; - end Make_Entry_Body_Formal_Part; - - function Make_Entry_Index_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discrete_Subtype_Definition : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Index_Specification, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Discrete_Subtype_Definition (N, Discrete_Subtype_Definition); - return N; - end Make_Entry_Index_Specification; - - function Make_Entry_Call_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Call_Statement, Sloc); - begin - Set_Name (N, Name); - Set_Parameter_Associations (N, Parameter_Associations); - return N; - end Make_Entry_Call_Statement; - - function Make_Requeue_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Abort_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Requeue_Statement, Sloc); - begin - Set_Name (N, Name); - Set_Abort_Present (N, Abort_Present); - return N; - end Make_Requeue_Statement; - - function Make_Delay_Until_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Delay_Until_Statement, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Delay_Until_Statement; - - function Make_Delay_Relative_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Delay_Relative_Statement, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Delay_Relative_Statement; - - function Make_Selective_Accept (Sloc : Source_Ptr; - Select_Alternatives : List_Id; - Else_Statements : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Selective_Accept, Sloc); - begin - Set_Select_Alternatives (N, Select_Alternatives); - Set_Else_Statements (N, Else_Statements); - return N; - end Make_Selective_Accept; - - function Make_Accept_Alternative (Sloc : Source_Ptr; - Accept_Statement : Node_Id; - Condition : Node_Id := Empty; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Accept_Alternative, Sloc); - begin - Set_Accept_Statement (N, Accept_Statement); - Set_Condition (N, Condition); - Set_Statements (N, Statements); - Set_Pragmas_Before (N, Pragmas_Before); - return N; - end Make_Accept_Alternative; - - function Make_Delay_Alternative (Sloc : Source_Ptr; - Delay_Statement : Node_Id; - Condition : Node_Id := Empty; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Delay_Alternative, Sloc); - begin - Set_Delay_Statement (N, Delay_Statement); - Set_Condition (N, Condition); - Set_Statements (N, Statements); - Set_Pragmas_Before (N, Pragmas_Before); - return N; - end Make_Delay_Alternative; - - function Make_Terminate_Alternative (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Pragmas_Before : List_Id := No_List; - Pragmas_After : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Terminate_Alternative, Sloc); - begin - Set_Condition (N, Condition); - Set_Pragmas_Before (N, Pragmas_Before); - Set_Pragmas_After (N, Pragmas_After); - return N; - end Make_Terminate_Alternative; - - function Make_Timed_Entry_Call (Sloc : Source_Ptr; - Entry_Call_Alternative : Node_Id; - Delay_Alternative : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Timed_Entry_Call, Sloc); - begin - Set_Entry_Call_Alternative (N, Entry_Call_Alternative); - Set_Delay_Alternative (N, Delay_Alternative); - return N; - end Make_Timed_Entry_Call; - - function Make_Entry_Call_Alternative (Sloc : Source_Ptr; - Entry_Call_Statement : Node_Id; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Entry_Call_Alternative, Sloc); - begin - Set_Entry_Call_Statement (N, Entry_Call_Statement); - Set_Statements (N, Statements); - Set_Pragmas_Before (N, Pragmas_Before); - return N; - end Make_Entry_Call_Alternative; - - function Make_Conditional_Entry_Call (Sloc : Source_Ptr; - Entry_Call_Alternative : Node_Id; - Else_Statements : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Conditional_Entry_Call, Sloc); - begin - Set_Entry_Call_Alternative (N, Entry_Call_Alternative); - Set_Else_Statements (N, Else_Statements); - return N; - end Make_Conditional_Entry_Call; - - function Make_Asynchronous_Select (Sloc : Source_Ptr; - Triggering_Alternative : Node_Id; - Abortable_Part : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Asynchronous_Select, Sloc); - begin - Set_Triggering_Alternative (N, Triggering_Alternative); - Set_Abortable_Part (N, Abortable_Part); - return N; - end Make_Asynchronous_Select; - - function Make_Triggering_Alternative (Sloc : Source_Ptr; - Triggering_Statement : Node_Id; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Triggering_Alternative, Sloc); - begin - Set_Triggering_Statement (N, Triggering_Statement); - Set_Statements (N, Statements); - Set_Pragmas_Before (N, Pragmas_Before); - return N; - end Make_Triggering_Alternative; - - function Make_Abortable_Part (Sloc : Source_Ptr; - Statements : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Abortable_Part, Sloc); - begin - Set_Statements (N, Statements); - return N; - end Make_Abortable_Part; - - function Make_Abort_Statement (Sloc : Source_Ptr; - Names : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Abort_Statement, Sloc); - begin - Set_Names (N, Names); - return N; - end Make_Abort_Statement; - - function Make_Compilation_Unit (Sloc : Source_Ptr; - Context_Items : List_Id; - Private_Present : Boolean := False; - Unit : Node_Id; - Aux_Decls_Node : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Compilation_Unit, Sloc); - begin - Set_Context_Items (N, Context_Items); - Set_Private_Present (N, Private_Present); - Set_Unit (N, Unit); - Set_Aux_Decls_Node (N, Aux_Decls_Node); - return N; - end Make_Compilation_Unit; - - function Make_Compilation_Unit_Aux (Sloc : Source_Ptr; - Declarations : List_Id := No_List; - Actions : List_Id := No_List; - Pragmas_After : List_Id := No_List; - Config_Pragmas : List_Id := Empty_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Compilation_Unit_Aux, Sloc); - begin - Set_Declarations (N, Declarations); - Set_Actions (N, Actions); - Set_Pragmas_After (N, Pragmas_After); - Set_Config_Pragmas (N, Config_Pragmas); - return N; - end Make_Compilation_Unit_Aux; - - function Make_With_Clause (Sloc : Source_Ptr; - Name : Node_Id; - First_Name : Boolean := True; - Last_Name : Boolean := True; - Limited_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_With_Clause, Sloc); - begin - Set_Name (N, Name); - Set_First_Name (N, First_Name); - Set_Last_Name (N, Last_Name); - Set_Limited_Present (N, Limited_Present); - return N; - end Make_With_Clause; - - function Make_With_Type_Clause (Sloc : Source_Ptr; - Name : Node_Id; - Tagged_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_With_Type_Clause, Sloc); - begin - Set_Name (N, Name); - Set_Tagged_Present (N, Tagged_Present); - return N; - end Make_With_Type_Clause; - - function Make_Subprogram_Body_Stub (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subprogram_Body_Stub, Sloc); - begin - Set_Specification (N, Specification); - return N; - end Make_Subprogram_Body_Stub; - - function Make_Package_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Body_Stub, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Package_Body_Stub; - - function Make_Task_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Task_Body_Stub, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Task_Body_Stub; - - function Make_Protected_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Protected_Body_Stub, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Protected_Body_Stub; - - function Make_Subunit (Sloc : Source_Ptr; - Name : Node_Id; - Proper_Body : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subunit, Sloc); - begin - Set_Name (N, Name); - Set_Proper_Body (N, Proper_Body); - return N; - end Make_Subunit; - - function Make_Exception_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Exception_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Exception_Declaration; - - function Make_Handled_Sequence_Of_Statements (Sloc : Source_Ptr; - Statements : List_Id; - End_Label : Node_Id := Empty; - Exception_Handlers : List_Id := No_List; - At_End_Proc : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Handled_Sequence_Of_Statements, Sloc); - begin - Set_Statements (N, Statements); - Set_End_Label (N, End_Label); - Set_Exception_Handlers (N, Exception_Handlers); - Set_At_End_Proc (N, At_End_Proc); - return N; - end Make_Handled_Sequence_Of_Statements; - - function Make_Exception_Handler (Sloc : Source_Ptr; - Choice_Parameter : Node_Id := Empty; - Exception_Choices : List_Id; - Statements : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Exception_Handler, Sloc); - begin - Set_Choice_Parameter (N, Choice_Parameter); - Set_Exception_Choices (N, Exception_Choices); - Set_Statements (N, Statements); - return N; - end Make_Exception_Handler; - - function Make_Raise_Statement (Sloc : Source_Ptr; - Name : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Raise_Statement, Sloc); - begin - Set_Name (N, Name); - return N; - end Make_Raise_Statement; - - function Make_Generic_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Generic_Formal_Declarations : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Subprogram_Declaration, Sloc); - begin - Set_Specification (N, Specification); - Set_Generic_Formal_Declarations (N, Generic_Formal_Declarations); - return N; - end Make_Generic_Subprogram_Declaration; - - function Make_Generic_Package_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Generic_Formal_Declarations : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Package_Declaration, Sloc); - begin - Set_Specification (N, Specification); - Set_Generic_Formal_Declarations (N, Generic_Formal_Declarations); - return N; - end Make_Generic_Package_Declaration; - - function Make_Package_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Package_Instantiation, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - Set_Generic_Associations (N, Generic_Associations); - return N; - end Make_Package_Instantiation; - - function Make_Procedure_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Procedure_Instantiation, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - Set_Generic_Associations (N, Generic_Associations); - return N; - end Make_Procedure_Instantiation; - - function Make_Function_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Function_Instantiation, Sloc); - begin - Set_Defining_Unit_Name (N, Defining_Unit_Name); - Set_Name (N, Name); - Set_Generic_Associations (N, Generic_Associations); - return N; - end Make_Function_Instantiation; - - function Make_Generic_Association (Sloc : Source_Ptr; - Selector_Name : Node_Id := Empty; - Explicit_Generic_Actual_Parameter : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Generic_Association, Sloc); - begin - Set_Selector_Name (N, Selector_Name); - Set_Explicit_Generic_Actual_Parameter - (N, Explicit_Generic_Actual_Parameter); - return N; - end Make_Generic_Association; - - function Make_Formal_Object_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - In_Present : Boolean := False; - Out_Present : Boolean := False; - Subtype_Mark : Node_Id; - Expression : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Object_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_In_Present (N, In_Present); - Set_Out_Present (N, Out_Present); - Set_Subtype_Mark (N, Subtype_Mark); - Set_Expression (N, Expression); - return N; - end Make_Formal_Object_Declaration; - - function Make_Formal_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Formal_Type_Definition : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Type_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Formal_Type_Definition (N, Formal_Type_Definition); - Set_Discriminant_Specifications (N, Discriminant_Specifications); - Set_Unknown_Discriminants_Present - (N, Unknown_Discriminants_Present); - return N; - end Make_Formal_Type_Declaration; - - function Make_Formal_Private_Type_Definition (Sloc : Source_Ptr; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Private_Type_Definition, Sloc); - begin - Set_Abstract_Present (N, Abstract_Present); - Set_Tagged_Present (N, Tagged_Present); - Set_Limited_Present (N, Limited_Present); - return N; - end Make_Formal_Private_Type_Definition; - - function Make_Formal_Derived_Type_Definition (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Private_Present : Boolean := False; - Abstract_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Derived_Type_Definition, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - Set_Private_Present (N, Private_Present); - Set_Abstract_Present (N, Abstract_Present); - return N; - end Make_Formal_Derived_Type_Definition; - - function Make_Formal_Discrete_Type_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Discrete_Type_Definition, Sloc); - begin - return N; - end Make_Formal_Discrete_Type_Definition; - - function Make_Formal_Signed_Integer_Type_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Signed_Integer_Type_Definition, Sloc); - begin - return N; - end Make_Formal_Signed_Integer_Type_Definition; - - function Make_Formal_Modular_Type_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Modular_Type_Definition, Sloc); - begin - return N; - end Make_Formal_Modular_Type_Definition; - - function Make_Formal_Floating_Point_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Floating_Point_Definition, Sloc); - begin - return N; - end Make_Formal_Floating_Point_Definition; - - function Make_Formal_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Ordinary_Fixed_Point_Definition, Sloc); - begin - return N; - end Make_Formal_Ordinary_Fixed_Point_Definition; - - function Make_Formal_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Decimal_Fixed_Point_Definition, Sloc); - begin - return N; - end Make_Formal_Decimal_Fixed_Point_Definition; - - function Make_Formal_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Default_Name : Node_Id := Empty; - Box_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Subprogram_Declaration, Sloc); - begin - Set_Specification (N, Specification); - Set_Default_Name (N, Default_Name); - Set_Box_Present (N, Box_Present); - return N; - end Make_Formal_Subprogram_Declaration; - - function Make_Formal_Package_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List; - Box_Present : Boolean := False) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Formal_Package_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - Set_Name (N, Name); - Set_Generic_Associations (N, Generic_Associations); - Set_Box_Present (N, Box_Present); - return N; - end Make_Formal_Package_Declaration; - - function Make_Attribute_Definition_Clause (Sloc : Source_Ptr; - Name : Node_Id; - Chars : Name_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Attribute_Definition_Clause, Sloc); - begin - Set_Name (N, Name); - Set_Chars (N, Chars); - Set_Expression (N, Expression); - return N; - end Make_Attribute_Definition_Clause; - - function Make_Enumeration_Representation_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Array_Aggregate : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Enumeration_Representation_Clause, Sloc); - begin - Set_Identifier (N, Identifier); - Set_Array_Aggregate (N, Array_Aggregate); - return N; - end Make_Enumeration_Representation_Clause; - - function Make_Record_Representation_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Mod_Clause : Node_Id := Empty; - Component_Clauses : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Record_Representation_Clause, Sloc); - begin - Set_Identifier (N, Identifier); - Set_Mod_Clause (N, Mod_Clause); - Set_Component_Clauses (N, Component_Clauses); - return N; - end Make_Record_Representation_Clause; - - function Make_Component_Clause (Sloc : Source_Ptr; - Component_Name : Node_Id; - Position : Node_Id; - First_Bit : Node_Id; - Last_Bit : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Component_Clause, Sloc); - begin - Set_Component_Name (N, Component_Name); - Set_Position (N, Position); - Set_First_Bit (N, First_Bit); - Set_Last_Bit (N, Last_Bit); - return N; - end Make_Component_Clause; - - function Make_Code_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Code_Statement, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Code_Statement; - - function Make_Op_Rotate_Left (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Rotate_Left, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Rotate_Left); - Set_Entity (N, Standard_Op_Rotate_Left); - return N; - end Make_Op_Rotate_Left; - - function Make_Op_Rotate_Right (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Rotate_Right, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Rotate_Right); - Set_Entity (N, Standard_Op_Rotate_Right); - return N; - end Make_Op_Rotate_Right; - - function Make_Op_Shift_Left (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Shift_Left, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Shift_Left); - Set_Entity (N, Standard_Op_Shift_Left); - return N; - end Make_Op_Shift_Left; - - function Make_Op_Shift_Right_Arithmetic (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Shift_Right_Arithmetic, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Shift_Right_Arithmetic); - Set_Entity (N, Standard_Op_Shift_Right_Arithmetic); - return N; - end Make_Op_Shift_Right_Arithmetic; - - function Make_Op_Shift_Right (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Op_Shift_Right, Sloc); - begin - Set_Left_Opnd (N, Left_Opnd); - Set_Right_Opnd (N, Right_Opnd); - Set_Chars (N, Name_Shift_Right); - Set_Entity (N, Standard_Op_Shift_Right); - return N; - end Make_Op_Shift_Right; - - function Make_Delta_Constraint (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Range_Constraint : Node_Id := Empty) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Delta_Constraint, Sloc); - begin - Set_Delta_Expression (N, Delta_Expression); - Set_Range_Constraint (N, Range_Constraint); - return N; - end Make_Delta_Constraint; - - function Make_At_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_At_Clause, Sloc); - begin - Set_Identifier (N, Identifier); - Set_Expression (N, Expression); - return N; - end Make_At_Clause; - - function Make_Mod_Clause (Sloc : Source_Ptr; - Expression : Node_Id; - Pragmas_Before : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Mod_Clause, Sloc); - begin - Set_Expression (N, Expression); - Set_Pragmas_Before (N, Pragmas_Before); - return N; - end Make_Mod_Clause; - - function Make_Conditional_Expression (Sloc : Source_Ptr; - Expressions : List_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Conditional_Expression, Sloc); - begin - Set_Expressions (N, Expressions); - return N; - end Make_Conditional_Expression; - - function Make_Expanded_Name (Sloc : Source_Ptr; - Chars : Name_Id; - Prefix : Node_Id; - Selector_Name : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Expanded_Name, Sloc); - begin - Set_Chars (N, Chars); - Set_Prefix (N, Prefix); - Set_Selector_Name (N, Selector_Name); - return N; - end Make_Expanded_Name; - - function Make_Free_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Free_Statement, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Free_Statement; - - function Make_Freeze_Entity (Sloc : Source_Ptr; - Actions : List_Id := No_List) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Freeze_Entity, Sloc); - begin - Set_Actions (N, Actions); - return N; - end Make_Freeze_Entity; - - function Make_Implicit_Label_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Implicit_Label_Declaration, Sloc); - begin - Set_Defining_Identifier (N, Defining_Identifier); - return N; - end Make_Implicit_Label_Declaration; - - function Make_Itype_Reference (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Itype_Reference, Sloc); - begin - return N; - end Make_Itype_Reference; - - function Make_Raise_Constraint_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Raise_Constraint_Error, Sloc); - begin - Set_Condition (N, Condition); - Set_Reason (N, Reason); - return N; - end Make_Raise_Constraint_Error; - - function Make_Raise_Program_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Raise_Program_Error, Sloc); - begin - Set_Condition (N, Condition); - Set_Reason (N, Reason); - return N; - end Make_Raise_Program_Error; - - function Make_Raise_Storage_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Raise_Storage_Error, Sloc); - begin - Set_Condition (N, Condition); - Set_Reason (N, Reason); - return N; - end Make_Raise_Storage_Error; - - function Make_Reference (Sloc : Source_Ptr; - Prefix : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Reference, Sloc); - begin - Set_Prefix (N, Prefix); - return N; - end Make_Reference; - - function Make_Subprogram_Info (Sloc : Source_Ptr; - Identifier : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Subprogram_Info, Sloc); - begin - Set_Identifier (N, Identifier); - return N; - end Make_Subprogram_Info; - - function Make_Unchecked_Expression (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Unchecked_Expression, Sloc); - begin - Set_Expression (N, Expression); - return N; - end Make_Unchecked_Expression; - - function Make_Unchecked_Type_Conversion (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Unchecked_Type_Conversion, Sloc); - begin - Set_Subtype_Mark (N, Subtype_Mark); - Set_Expression (N, Expression); - return N; - end Make_Unchecked_Type_Conversion; - - function Make_Validate_Unchecked_Conversion (Sloc : Source_Ptr) - return Node_Id - is - N : constant Node_Id := - New_Node (N_Validate_Unchecked_Conversion, Sloc); - begin - return N; - end Make_Validate_Unchecked_Conversion; - -end Nmake; diff --git a/gcc/ada/nmake.ads b/gcc/ada/nmake.ads deleted file mode 100644 index be05e7940b3..00000000000 --- a/gcc/ada/nmake.ads +++ /dev/null @@ -1,1347 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- N M A K E -- --- -- --- S p e c -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - -pragma Style_Checks (All_Checks); --- Turn off subprogram order checking, since the routines here are --- generated automatically in order. - - -with Nlists; use Nlists; -with Types; use Types; -with Uintp; use Uintp; -with Urealp; use Urealp; - -package Nmake is - --- This package contains a set of routines used to construct tree nodes --- using a functional style. There is one routine for each node type defined --- in Sinfo with the general interface: - --- function Make_xxx (Sloc : Source_Ptr, --- Field_Name_1 : Field_Name_1_Type [:= default] --- Field_Name_2 : Field_Name_2_Type [:= default] --- ...) --- return Node_Id - --- Only syntactic fields are included (i.e. fields marked as "-Sem" or "-Lib" --- in the Sinfo spec are excluded). In addition, the following four syntactic --- fields are excluded: - --- Prev_Ids --- More_Ids --- Comes_From_Source --- Paren_Count - --- since they are very rarely set in expanded code. If they need to be set, --- to other than the default values (False, False, False, zero), then the --- appropriate Set_xxx procedures must be used on the returned value. - --- Default values are provided only for flag fields (where the default is --- False), and for optional fields. An optional field is one where the --- comment line describing the field contains the string "(set to xxx if". --- For such fields, a default value of xxx is provided." - --- Warning: since calls to Make_xxx routines are normal function calls, the --- arguments can be evaluated in any order. This means that at most one such --- argument can have side effects (e.g. be a call to a parse routine). - - function Make_Unused_At_Start (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Unused_At_Start); - - function Make_Unused_At_End (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Unused_At_End); - - function Make_Identifier (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id; - pragma Inline (Make_Identifier); - - function Make_Integer_Literal (Sloc : Source_Ptr; - Intval : Uint) - return Node_Id; - pragma Inline (Make_Integer_Literal); - - function Make_Real_Literal (Sloc : Source_Ptr; - Realval : Ureal) - return Node_Id; - pragma Inline (Make_Real_Literal); - - function Make_Character_Literal (Sloc : Source_Ptr; - Chars : Name_Id; - Char_Literal_Value : Char_Code) - return Node_Id; - pragma Inline (Make_Character_Literal); - - function Make_String_Literal (Sloc : Source_Ptr; - Strval : String_Id) - return Node_Id; - pragma Inline (Make_String_Literal); - - function Make_Pragma (Sloc : Source_Ptr; - Chars : Name_Id; - Pragma_Argument_Associations : List_Id := No_List; - Debug_Statement : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Pragma); - - function Make_Pragma_Argument_Association (Sloc : Source_Ptr; - Chars : Name_Id := No_Name; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Pragma_Argument_Association); - - function Make_Defining_Identifier (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id; - pragma Inline (Make_Defining_Identifier); - - function Make_Full_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Type_Definition : Node_Id) - return Node_Id; - pragma Inline (Make_Full_Type_Declaration); - - function Make_Subtype_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Subtype_Indication : Node_Id) - return Node_Id; - pragma Inline (Make_Subtype_Declaration); - - function Make_Subtype_Indication (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Constraint : Node_Id) - return Node_Id; - pragma Inline (Make_Subtype_Indication); - - function Make_Object_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Aliased_Present : Boolean := False; - Constant_Present : Boolean := False; - Object_Definition : Node_Id; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Object_Declaration); - - function Make_Number_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Number_Declaration); - - function Make_Derived_Type_Definition (Sloc : Source_Ptr; - Abstract_Present : Boolean := False; - Subtype_Indication : Node_Id; - Record_Extension_Part : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Derived_Type_Definition); - - function Make_Range_Constraint (Sloc : Source_Ptr; - Range_Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Range_Constraint); - - function Make_Range (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id; - Includes_Infinities : Boolean := False) - return Node_Id; - pragma Inline (Make_Range); - - function Make_Enumeration_Type_Definition (Sloc : Source_Ptr; - Literals : List_Id; - End_Label : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Enumeration_Type_Definition); - - function Make_Defining_Character_Literal (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id; - pragma Inline (Make_Defining_Character_Literal); - - function Make_Signed_Integer_Type_Definition (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id) - return Node_Id; - pragma Inline (Make_Signed_Integer_Type_Definition); - - function Make_Modular_Type_Definition (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Modular_Type_Definition); - - function Make_Floating_Point_Definition (Sloc : Source_Ptr; - Digits_Expression : Node_Id; - Real_Range_Specification : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Floating_Point_Definition); - - function Make_Real_Range_Specification (Sloc : Source_Ptr; - Low_Bound : Node_Id; - High_Bound : Node_Id) - return Node_Id; - pragma Inline (Make_Real_Range_Specification); - - function Make_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Real_Range_Specification : Node_Id) - return Node_Id; - pragma Inline (Make_Ordinary_Fixed_Point_Definition); - - function Make_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Digits_Expression : Node_Id; - Real_Range_Specification : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Decimal_Fixed_Point_Definition); - - function Make_Digits_Constraint (Sloc : Source_Ptr; - Digits_Expression : Node_Id; - Range_Constraint : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Digits_Constraint); - - function Make_Unconstrained_Array_Definition (Sloc : Source_Ptr; - Subtype_Marks : List_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id; - pragma Inline (Make_Unconstrained_Array_Definition); - - function Make_Constrained_Array_Definition (Sloc : Source_Ptr; - Discrete_Subtype_Definitions : List_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id; - pragma Inline (Make_Constrained_Array_Definition); - - function Make_Discriminant_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Type : Node_Id; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Discriminant_Specification); - - function Make_Index_Or_Discriminant_Constraint (Sloc : Source_Ptr; - Constraints : List_Id) - return Node_Id; - pragma Inline (Make_Index_Or_Discriminant_Constraint); - - function Make_Discriminant_Association (Sloc : Source_Ptr; - Selector_Names : List_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Discriminant_Association); - - function Make_Record_Definition (Sloc : Source_Ptr; - End_Label : Node_Id := Empty; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False; - Component_List : Node_Id; - Null_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Record_Definition); - - function Make_Component_List (Sloc : Source_Ptr; - Component_Items : List_Id; - Variant_Part : Node_Id := Empty; - Null_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Component_List); - - function Make_Component_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Aliased_Present : Boolean := False; - Subtype_Indication : Node_Id; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Component_Declaration); - - function Make_Variant_Part (Sloc : Source_Ptr; - Name : Node_Id; - Variants : List_Id) - return Node_Id; - pragma Inline (Make_Variant_Part); - - function Make_Variant (Sloc : Source_Ptr; - Discrete_Choices : List_Id; - Component_List : Node_Id) - return Node_Id; - pragma Inline (Make_Variant); - - function Make_Others_Choice (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Others_Choice); - - function Make_Access_To_Object_Definition (Sloc : Source_Ptr; - All_Present : Boolean := False; - Subtype_Indication : Node_Id; - Constant_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Access_To_Object_Definition); - - function Make_Access_Function_Definition (Sloc : Source_Ptr; - Protected_Present : Boolean := False; - Parameter_Specifications : List_Id := No_List; - Subtype_Mark : Node_Id) - return Node_Id; - pragma Inline (Make_Access_Function_Definition); - - function Make_Access_Procedure_Definition (Sloc : Source_Ptr; - Protected_Present : Boolean := False; - Parameter_Specifications : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Access_Procedure_Definition); - - function Make_Access_Definition (Sloc : Source_Ptr; - Subtype_Mark : Node_Id) - return Node_Id; - pragma Inline (Make_Access_Definition); - - function Make_Incomplete_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Incomplete_Type_Declaration); - - function Make_Explicit_Dereference (Sloc : Source_Ptr; - Prefix : Node_Id) - return Node_Id; - pragma Inline (Make_Explicit_Dereference); - - function Make_Indexed_Component (Sloc : Source_Ptr; - Prefix : Node_Id; - Expressions : List_Id) - return Node_Id; - pragma Inline (Make_Indexed_Component); - - function Make_Slice (Sloc : Source_Ptr; - Prefix : Node_Id; - Discrete_Range : Node_Id) - return Node_Id; - pragma Inline (Make_Slice); - - function Make_Selected_Component (Sloc : Source_Ptr; - Prefix : Node_Id; - Selector_Name : Node_Id) - return Node_Id; - pragma Inline (Make_Selected_Component); - - function Make_Attribute_Reference (Sloc : Source_Ptr; - Prefix : Node_Id; - Attribute_Name : Name_Id; - Expressions : List_Id := No_List; - Must_Be_Byte_Aligned : Boolean := False) - return Node_Id; - pragma Inline (Make_Attribute_Reference); - - function Make_Aggregate (Sloc : Source_Ptr; - Expressions : List_Id := No_List; - Component_Associations : List_Id := No_List; - Null_Record_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Aggregate); - - function Make_Component_Association (Sloc : Source_Ptr; - Choices : List_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Component_Association); - - function Make_Extension_Aggregate (Sloc : Source_Ptr; - Ancestor_Part : Node_Id; - Expressions : List_Id := No_List; - Component_Associations : List_Id := No_List; - Null_Record_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Extension_Aggregate); - - function Make_Null (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Null); - - function Make_And_Then (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_And_Then); - - function Make_Or_Else (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Or_Else); - - function Make_In (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_In); - - function Make_Not_In (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Not_In); - - function Make_Op_And (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_And); - - function Make_Op_Or (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Or); - - function Make_Op_Xor (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Xor); - - function Make_Op_Eq (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Eq); - - function Make_Op_Ne (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Ne); - - function Make_Op_Lt (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Lt); - - function Make_Op_Le (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Le); - - function Make_Op_Gt (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Gt); - - function Make_Op_Ge (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Ge); - - function Make_Op_Add (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Add); - - function Make_Op_Subtract (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Subtract); - - function Make_Op_Concat (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Concat); - - function Make_Op_Multiply (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Multiply); - - function Make_Op_Divide (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Divide); - - function Make_Op_Mod (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Mod); - - function Make_Op_Rem (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Rem); - - function Make_Op_Expon (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Expon); - - function Make_Op_Plus (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Plus); - - function Make_Op_Minus (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Minus); - - function Make_Op_Abs (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Abs); - - function Make_Op_Not (Sloc : Source_Ptr; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Not); - - function Make_Type_Conversion (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Type_Conversion); - - function Make_Qualified_Expression (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Qualified_Expression); - - function Make_Allocator (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Allocator); - - function Make_Null_Statement (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Null_Statement); - - function Make_Label (Sloc : Source_Ptr; - Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Label); - - function Make_Assignment_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Assignment_Statement); - - function Make_If_Statement (Sloc : Source_Ptr; - Condition : Node_Id; - Then_Statements : List_Id; - Elsif_Parts : List_Id := No_List; - Else_Statements : List_Id := No_List; - End_Span : Uint := No_Uint) - return Node_Id; - pragma Inline (Make_If_Statement); - - function Make_Elsif_Part (Sloc : Source_Ptr; - Condition : Node_Id; - Then_Statements : List_Id) - return Node_Id; - pragma Inline (Make_Elsif_Part); - - function Make_Case_Statement (Sloc : Source_Ptr; - Expression : Node_Id; - Alternatives : List_Id; - End_Span : Uint := No_Uint) - return Node_Id; - pragma Inline (Make_Case_Statement); - - function Make_Case_Statement_Alternative (Sloc : Source_Ptr; - Discrete_Choices : List_Id; - Statements : List_Id) - return Node_Id; - pragma Inline (Make_Case_Statement_Alternative); - - function Make_Loop_Statement (Sloc : Source_Ptr; - Identifier : Node_Id := Empty; - Iteration_Scheme : Node_Id := Empty; - Statements : List_Id; - End_Label : Node_Id; - Has_Created_Identifier : Boolean := False; - Is_Null_Loop : Boolean := False) - return Node_Id; - pragma Inline (Make_Loop_Statement); - - function Make_Iteration_Scheme (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Loop_Parameter_Specification : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Iteration_Scheme); - - function Make_Loop_Parameter_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Reverse_Present : Boolean := False; - Discrete_Subtype_Definition : Node_Id) - return Node_Id; - pragma Inline (Make_Loop_Parameter_Specification); - - function Make_Block_Statement (Sloc : Source_Ptr; - Identifier : Node_Id := Empty; - Declarations : List_Id := No_List; - Handled_Statement_Sequence : Node_Id; - Has_Created_Identifier : Boolean := False; - Is_Task_Allocation_Block : Boolean := False; - Is_Asynchronous_Call_Block : Boolean := False) - return Node_Id; - pragma Inline (Make_Block_Statement); - - function Make_Exit_Statement (Sloc : Source_Ptr; - Name : Node_Id := Empty; - Condition : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Exit_Statement); - - function Make_Goto_Statement (Sloc : Source_Ptr; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Goto_Statement); - - function Make_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id; - pragma Inline (Make_Subprogram_Declaration); - - function Make_Abstract_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id; - pragma Inline (Make_Abstract_Subprogram_Declaration); - - function Make_Function_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Parameter_Specifications : List_Id := No_List; - Subtype_Mark : Node_Id) - return Node_Id; - pragma Inline (Make_Function_Specification); - - function Make_Procedure_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Parameter_Specifications : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Procedure_Specification); - - function Make_Designator (Sloc : Source_Ptr; - Name : Node_Id; - Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Designator); - - function Make_Defining_Program_Unit_Name (Sloc : Source_Ptr; - Name : Node_Id; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Defining_Program_Unit_Name); - - function Make_Operator_Symbol (Sloc : Source_Ptr; - Chars : Name_Id; - Strval : String_Id) - return Node_Id; - pragma Inline (Make_Operator_Symbol); - - function Make_Defining_Operator_Symbol (Sloc : Source_Ptr; - Chars : Name_Id) - return Node_Id; - pragma Inline (Make_Defining_Operator_Symbol); - - function Make_Parameter_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - In_Present : Boolean := False; - Out_Present : Boolean := False; - Parameter_Type : Node_Id; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Parameter_Specification); - - function Make_Subprogram_Body (Sloc : Source_Ptr; - Specification : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id; - Bad_Is_Detected : Boolean := False) - return Node_Id; - pragma Inline (Make_Subprogram_Body); - - function Make_Procedure_Call_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Procedure_Call_Statement); - - function Make_Function_Call (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Function_Call); - - function Make_Parameter_Association (Sloc : Source_Ptr; - Selector_Name : Node_Id; - Explicit_Actual_Parameter : Node_Id) - return Node_Id; - pragma Inline (Make_Parameter_Association); - - function Make_Return_Statement (Sloc : Source_Ptr; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Return_Statement); - - function Make_Package_Declaration (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id; - pragma Inline (Make_Package_Declaration); - - function Make_Package_Specification (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id; - pragma Inline (Make_Package_Specification); - - function Make_Package_Body (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Package_Body); - - function Make_Private_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Private_Type_Declaration); - - function Make_Private_Extension_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False; - Abstract_Present : Boolean := False; - Subtype_Indication : Node_Id) - return Node_Id; - pragma Inline (Make_Private_Extension_Declaration); - - function Make_Use_Package_Clause (Sloc : Source_Ptr; - Names : List_Id) - return Node_Id; - pragma Inline (Make_Use_Package_Clause); - - function Make_Use_Type_Clause (Sloc : Source_Ptr; - Subtype_Marks : List_Id) - return Node_Id; - pragma Inline (Make_Use_Type_Clause); - - function Make_Object_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Subtype_Mark : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Object_Renaming_Declaration); - - function Make_Exception_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Exception_Renaming_Declaration); - - function Make_Package_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Package_Renaming_Declaration); - - function Make_Subprogram_Renaming_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Subprogram_Renaming_Declaration); - - function Make_Generic_Package_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Generic_Package_Renaming_Declaration); - - function Make_Generic_Procedure_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Generic_Procedure_Renaming_Declaration); - - function Make_Generic_Function_Renaming_Declaration (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id) - return Node_Id; - pragma Inline (Make_Generic_Function_Renaming_Declaration); - - function Make_Task_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Task_Definition : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Task_Type_Declaration); - - function Make_Single_Task_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Task_Definition : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Single_Task_Declaration); - - function Make_Task_Definition (Sloc : Source_Ptr; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id; - pragma Inline (Make_Task_Definition); - - function Make_Task_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id) - return Node_Id; - pragma Inline (Make_Task_Body); - - function Make_Protected_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Protected_Definition : Node_Id) - return Node_Id; - pragma Inline (Make_Protected_Type_Declaration); - - function Make_Single_Protected_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Protected_Definition : Node_Id) - return Node_Id; - pragma Inline (Make_Single_Protected_Declaration); - - function Make_Protected_Definition (Sloc : Source_Ptr; - Visible_Declarations : List_Id; - Private_Declarations : List_Id := No_List; - End_Label : Node_Id) - return Node_Id; - pragma Inline (Make_Protected_Definition); - - function Make_Protected_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Declarations : List_Id; - End_Label : Node_Id) - return Node_Id; - pragma Inline (Make_Protected_Body); - - function Make_Entry_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discrete_Subtype_Definition : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Entry_Declaration); - - function Make_Accept_Statement (Sloc : Source_Ptr; - Entry_Direct_Name : Node_Id; - Entry_Index : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List; - Handled_Statement_Sequence : Node_Id; - Declarations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Accept_Statement); - - function Make_Entry_Body (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Entry_Body_Formal_Part : Node_Id; - Declarations : List_Id; - Handled_Statement_Sequence : Node_Id) - return Node_Id; - pragma Inline (Make_Entry_Body); - - function Make_Entry_Body_Formal_Part (Sloc : Source_Ptr; - Entry_Index_Specification : Node_Id := Empty; - Parameter_Specifications : List_Id := No_List; - Condition : Node_Id) - return Node_Id; - pragma Inline (Make_Entry_Body_Formal_Part); - - function Make_Entry_Index_Specification (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Discrete_Subtype_Definition : Node_Id) - return Node_Id; - pragma Inline (Make_Entry_Index_Specification); - - function Make_Entry_Call_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Parameter_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Entry_Call_Statement); - - function Make_Requeue_Statement (Sloc : Source_Ptr; - Name : Node_Id; - Abort_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Requeue_Statement); - - function Make_Delay_Until_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Delay_Until_Statement); - - function Make_Delay_Relative_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Delay_Relative_Statement); - - function Make_Selective_Accept (Sloc : Source_Ptr; - Select_Alternatives : List_Id; - Else_Statements : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Selective_Accept); - - function Make_Accept_Alternative (Sloc : Source_Ptr; - Accept_Statement : Node_Id; - Condition : Node_Id := Empty; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Accept_Alternative); - - function Make_Delay_Alternative (Sloc : Source_Ptr; - Delay_Statement : Node_Id; - Condition : Node_Id := Empty; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Delay_Alternative); - - function Make_Terminate_Alternative (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Pragmas_Before : List_Id := No_List; - Pragmas_After : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Terminate_Alternative); - - function Make_Timed_Entry_Call (Sloc : Source_Ptr; - Entry_Call_Alternative : Node_Id; - Delay_Alternative : Node_Id) - return Node_Id; - pragma Inline (Make_Timed_Entry_Call); - - function Make_Entry_Call_Alternative (Sloc : Source_Ptr; - Entry_Call_Statement : Node_Id; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Entry_Call_Alternative); - - function Make_Conditional_Entry_Call (Sloc : Source_Ptr; - Entry_Call_Alternative : Node_Id; - Else_Statements : List_Id) - return Node_Id; - pragma Inline (Make_Conditional_Entry_Call); - - function Make_Asynchronous_Select (Sloc : Source_Ptr; - Triggering_Alternative : Node_Id; - Abortable_Part : Node_Id) - return Node_Id; - pragma Inline (Make_Asynchronous_Select); - - function Make_Triggering_Alternative (Sloc : Source_Ptr; - Triggering_Statement : Node_Id; - Statements : List_Id := Empty_List; - Pragmas_Before : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Triggering_Alternative); - - function Make_Abortable_Part (Sloc : Source_Ptr; - Statements : List_Id) - return Node_Id; - pragma Inline (Make_Abortable_Part); - - function Make_Abort_Statement (Sloc : Source_Ptr; - Names : List_Id) - return Node_Id; - pragma Inline (Make_Abort_Statement); - - function Make_Compilation_Unit (Sloc : Source_Ptr; - Context_Items : List_Id; - Private_Present : Boolean := False; - Unit : Node_Id; - Aux_Decls_Node : Node_Id) - return Node_Id; - pragma Inline (Make_Compilation_Unit); - - function Make_Compilation_Unit_Aux (Sloc : Source_Ptr; - Declarations : List_Id := No_List; - Actions : List_Id := No_List; - Pragmas_After : List_Id := No_List; - Config_Pragmas : List_Id := Empty_List) - return Node_Id; - pragma Inline (Make_Compilation_Unit_Aux); - - function Make_With_Clause (Sloc : Source_Ptr; - Name : Node_Id; - First_Name : Boolean := True; - Last_Name : Boolean := True; - Limited_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_With_Clause); - - function Make_With_Type_Clause (Sloc : Source_Ptr; - Name : Node_Id; - Tagged_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_With_Type_Clause); - - function Make_Subprogram_Body_Stub (Sloc : Source_Ptr; - Specification : Node_Id) - return Node_Id; - pragma Inline (Make_Subprogram_Body_Stub); - - function Make_Package_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Package_Body_Stub); - - function Make_Task_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Task_Body_Stub); - - function Make_Protected_Body_Stub (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Protected_Body_Stub); - - function Make_Subunit (Sloc : Source_Ptr; - Name : Node_Id; - Proper_Body : Node_Id) - return Node_Id; - pragma Inline (Make_Subunit); - - function Make_Exception_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Exception_Declaration); - - function Make_Handled_Sequence_Of_Statements (Sloc : Source_Ptr; - Statements : List_Id; - End_Label : Node_Id := Empty; - Exception_Handlers : List_Id := No_List; - At_End_Proc : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Handled_Sequence_Of_Statements); - - function Make_Exception_Handler (Sloc : Source_Ptr; - Choice_Parameter : Node_Id := Empty; - Exception_Choices : List_Id; - Statements : List_Id) - return Node_Id; - pragma Inline (Make_Exception_Handler); - - function Make_Raise_Statement (Sloc : Source_Ptr; - Name : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Raise_Statement); - - function Make_Generic_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Generic_Formal_Declarations : List_Id) - return Node_Id; - pragma Inline (Make_Generic_Subprogram_Declaration); - - function Make_Generic_Package_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Generic_Formal_Declarations : List_Id) - return Node_Id; - pragma Inline (Make_Generic_Package_Declaration); - - function Make_Package_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Package_Instantiation); - - function Make_Procedure_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Procedure_Instantiation); - - function Make_Function_Instantiation (Sloc : Source_Ptr; - Defining_Unit_Name : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Function_Instantiation); - - function Make_Generic_Association (Sloc : Source_Ptr; - Selector_Name : Node_Id := Empty; - Explicit_Generic_Actual_Parameter : Node_Id) - return Node_Id; - pragma Inline (Make_Generic_Association); - - function Make_Formal_Object_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - In_Present : Boolean := False; - Out_Present : Boolean := False; - Subtype_Mark : Node_Id; - Expression : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Formal_Object_Declaration); - - function Make_Formal_Type_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Formal_Type_Definition : Node_Id; - Discriminant_Specifications : List_Id := No_List; - Unknown_Discriminants_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Formal_Type_Declaration); - - function Make_Formal_Private_Type_Definition (Sloc : Source_Ptr; - Abstract_Present : Boolean := False; - Tagged_Present : Boolean := False; - Limited_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Formal_Private_Type_Definition); - - function Make_Formal_Derived_Type_Definition (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Private_Present : Boolean := False; - Abstract_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Formal_Derived_Type_Definition); - - function Make_Formal_Discrete_Type_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Discrete_Type_Definition); - - function Make_Formal_Signed_Integer_Type_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Signed_Integer_Type_Definition); - - function Make_Formal_Modular_Type_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Modular_Type_Definition); - - function Make_Formal_Floating_Point_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Floating_Point_Definition); - - function Make_Formal_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Ordinary_Fixed_Point_Definition); - - function Make_Formal_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Formal_Decimal_Fixed_Point_Definition); - - function Make_Formal_Subprogram_Declaration (Sloc : Source_Ptr; - Specification : Node_Id; - Default_Name : Node_Id := Empty; - Box_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Formal_Subprogram_Declaration); - - function Make_Formal_Package_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id; - Name : Node_Id; - Generic_Associations : List_Id := No_List; - Box_Present : Boolean := False) - return Node_Id; - pragma Inline (Make_Formal_Package_Declaration); - - function Make_Attribute_Definition_Clause (Sloc : Source_Ptr; - Name : Node_Id; - Chars : Name_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Attribute_Definition_Clause); - - function Make_Enumeration_Representation_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Array_Aggregate : Node_Id) - return Node_Id; - pragma Inline (Make_Enumeration_Representation_Clause); - - function Make_Record_Representation_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Mod_Clause : Node_Id := Empty; - Component_Clauses : List_Id) - return Node_Id; - pragma Inline (Make_Record_Representation_Clause); - - function Make_Component_Clause (Sloc : Source_Ptr; - Component_Name : Node_Id; - Position : Node_Id; - First_Bit : Node_Id; - Last_Bit : Node_Id) - return Node_Id; - pragma Inline (Make_Component_Clause); - - function Make_Code_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Code_Statement); - - function Make_Op_Rotate_Left (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Rotate_Left); - - function Make_Op_Rotate_Right (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Rotate_Right); - - function Make_Op_Shift_Left (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Shift_Left); - - function Make_Op_Shift_Right_Arithmetic (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Shift_Right_Arithmetic); - - function Make_Op_Shift_Right (Sloc : Source_Ptr; - Left_Opnd : Node_Id; - Right_Opnd : Node_Id) - return Node_Id; - pragma Inline (Make_Op_Shift_Right); - - function Make_Delta_Constraint (Sloc : Source_Ptr; - Delta_Expression : Node_Id; - Range_Constraint : Node_Id := Empty) - return Node_Id; - pragma Inline (Make_Delta_Constraint); - - function Make_At_Clause (Sloc : Source_Ptr; - Identifier : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_At_Clause); - - function Make_Mod_Clause (Sloc : Source_Ptr; - Expression : Node_Id; - Pragmas_Before : List_Id) - return Node_Id; - pragma Inline (Make_Mod_Clause); - - function Make_Conditional_Expression (Sloc : Source_Ptr; - Expressions : List_Id) - return Node_Id; - pragma Inline (Make_Conditional_Expression); - - function Make_Expanded_Name (Sloc : Source_Ptr; - Chars : Name_Id; - Prefix : Node_Id; - Selector_Name : Node_Id) - return Node_Id; - pragma Inline (Make_Expanded_Name); - - function Make_Free_Statement (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Free_Statement); - - function Make_Freeze_Entity (Sloc : Source_Ptr; - Actions : List_Id := No_List) - return Node_Id; - pragma Inline (Make_Freeze_Entity); - - function Make_Implicit_Label_Declaration (Sloc : Source_Ptr; - Defining_Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Implicit_Label_Declaration); - - function Make_Itype_Reference (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Itype_Reference); - - function Make_Raise_Constraint_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id; - pragma Inline (Make_Raise_Constraint_Error); - - function Make_Raise_Program_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id; - pragma Inline (Make_Raise_Program_Error); - - function Make_Raise_Storage_Error (Sloc : Source_Ptr; - Condition : Node_Id := Empty; - Reason : Uint) - return Node_Id; - pragma Inline (Make_Raise_Storage_Error); - - function Make_Reference (Sloc : Source_Ptr; - Prefix : Node_Id) - return Node_Id; - pragma Inline (Make_Reference); - - function Make_Subprogram_Info (Sloc : Source_Ptr; - Identifier : Node_Id) - return Node_Id; - pragma Inline (Make_Subprogram_Info); - - function Make_Unchecked_Expression (Sloc : Source_Ptr; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Unchecked_Expression); - - function Make_Unchecked_Type_Conversion (Sloc : Source_Ptr; - Subtype_Mark : Node_Id; - Expression : Node_Id) - return Node_Id; - pragma Inline (Make_Unchecked_Type_Conversion); - - function Make_Validate_Unchecked_Conversion (Sloc : Source_Ptr) - return Node_Id; - pragma Inline (Make_Validate_Unchecked_Conversion); - -end Nmake; diff --git a/gcc/ada/s-tpae65.adb b/gcc/ada/s-tpae65.adb deleted file mode 100644 index b0438b00fa3..00000000000 --- a/gcc/ada/s-tpae65.adb +++ /dev/null @@ -1,87 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . T A S K _ P R I M I T I V E S . A E _ 6 5 3 -- --- -- --- B o d y -- --- -- --- Copyright (C) 2002-2003, Free Software Foundation, Inc. -- --- -- --- GNARL is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNARL; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- Export certain tasking-related routines for use by Interfaces.Vthreads - -with Interfaces.C; -package body System.Task_Primitives.Ae_653 is - - ------------------- - -- ATCB_Key_Addr -- - ------------------- - - function ATCB_Key_Addr return Address_Access is - Key_Addr : Address_Access; - pragma Import (Ada, Key_Addr, "__gnat_ATCB_key_addr"); - -- Done this way to minimize impact on other targets. This - -- implementation is temporary, and specific to AE653 - begin - return Key_Addr; - end ATCB_Key_Addr; - - -------------------------- - -- Set_Current_Priority -- - -------------------------- - - procedure Set_Current_Priority - (T : System.Tasking.Task_ID; - Prio : System.Priority) - is - begin - T.Common.Current_Priority := Prio; - end Set_Current_Priority; - - --------------------- - -- Set_Task_Thread -- - --------------------- - - procedure Set_Task_Thread - (T : System.Tasking.Task_ID; - Thread : System.OS_Interface.Thread_Id) - is - use System.OS_Interface; - use System.Tasking; - use type Interfaces.C.int; - Result : STATUS; - begin - T.Common.LL.Thread := Thread; - if taskVarGet (Thread, ATCB_Key_Addr) = ERROR then - Result := taskVarAdd (Thread, ATCB_Key_Addr); - pragma Assert (Result = OK); - end if; - - Result := taskVarSet (Thread, ATCB_Key_Addr, To_Address (T)); - pragma Assert (Result = OK); - end Set_Task_Thread; - -end System.Task_Primitives.Ae_653; diff --git a/gcc/ada/s-tpae65.ads b/gcc/ada/s-tpae65.ads deleted file mode 100644 index 641f17187d8..00000000000 --- a/gcc/ada/s-tpae65.ads +++ /dev/null @@ -1,54 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- --- -- --- S Y S T E M . T A S K _ P R I M I T I V E S . A E _ 6 5 3 -- --- -- --- S p e c -- --- -- --- Copyright (C) 2002-2003, Free Software Foundation, Inc. -- --- -- --- GNARL is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNARL; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNARL was developed by the GNARL team at Florida State University. -- --- Extensive contributions were provided by Ada Core Technologies, Inc. -- --- -- ------------------------------------------------------------------------------- - --- Export certain tasking-related routines for use by Interfaces.Vthreads - -with System.Tasking; -with System.OS_Interface; -package System.Task_Primitives.Ae_653 is - type Address_Access is access System.Address; - - function ATCB_Key_Addr return Address_Access; - pragma Inline (ATCB_Key_Addr); - -- Address of ATCB_Key taskvar - - procedure Set_Current_Priority - (T : System.Tasking.Task_ID; Prio : System.Priority); - -- Set priority - - procedure Set_Task_Thread - (T : System.Tasking.Task_ID; - Thread : System.OS_Interface.Thread_Id); - -- Set "Thread" as the underlying OS thread implementing "T" - -end System.Task_Primitives.Ae_653; diff --git a/gcc/ada/sinfo.h b/gcc/ada/sinfo.h deleted file mode 100644 index fd5d13d2b89..00000000000 --- a/gcc/ada/sinfo.h +++ /dev/null @@ -1,840 +0,0 @@ -/*--------------------------------------------------------------------------*/ -/* */ -/* GNAT COMPILER COMPONENTS */ -/* */ -/* S I N F O */ -/* */ -/* C Header File */ -/* */ -/* Copyright (C) 1992-2003, Free Software Foundation, Inc. */ -/* */ -/* GNAT is free software; you can redistribute it and/or modify it under */ -/* terms of the GNU General Public License as published by the Free Soft- */ -/* ware Foundation; either version 2, or (at your option) any later ver- */ -/* sion. GNAT is distributed in the hope that it will be useful, but WITH- */ -/* OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY */ -/* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License */ -/* for more details. You should have received a copy of the GNU General */ -/* Public License distributed with GNAT; see file COPYING. If not, write */ -/* to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, */ -/* MA 02111-1307, USA. */ -/* */ -/* As a special exception, if other files instantiate generics from this */ -/* unit, or you link this unit with other files to produce an executable, */ -/* this unit does not by itself cause the resulting executable to be */ -/* covered by the GNU General Public License. This exception does not */ -/* however invalidate any other reasons why the executable file might be */ -/* covered by the GNU Public License. */ -/* */ -/* GNAT was originally developed by the GNAT team at New York University. */ -/* Extensive contributions were provided by Ada Core Technologies Inc. */ -/* */ -/*--------------------------------------------------------------------------*/ - - #define N_Unused_At_Start 0 - #define N_At_Clause 1 - #define N_Component_Clause 2 - #define N_Enumeration_Representation_Clause 3 - #define N_Mod_Clause 4 - #define N_Record_Representation_Clause 5 - #define N_Attribute_Definition_Clause 6 - #define N_Empty 7 - #define N_Pragma 8 - #define N_Pragma_Argument_Association 9 - #define N_Error 10 - #define N_Defining_Character_Literal 11 - #define N_Defining_Identifier 12 - #define N_Defining_Operator_Symbol 13 - #define N_Expanded_Name 14 - #define N_Identifier 15 - #define N_Operator_Symbol 16 - #define N_Character_Literal 17 - #define N_Op_Add 18 - #define N_Op_Concat 19 - #define N_Op_Expon 20 - #define N_Op_Subtract 21 - #define N_Op_Divide 22 - #define N_Op_Mod 23 - #define N_Op_Multiply 24 - #define N_Op_Rem 25 - #define N_Op_And 26 - #define N_Op_Eq 27 - #define N_Op_Ge 28 - #define N_Op_Gt 29 - #define N_Op_Le 30 - #define N_Op_Lt 31 - #define N_Op_Ne 32 - #define N_Op_Or 33 - #define N_Op_Xor 34 - #define N_Op_Rotate_Left 35 - #define N_Op_Rotate_Right 36 - #define N_Op_Shift_Left 37 - #define N_Op_Shift_Right 38 - #define N_Op_Shift_Right_Arithmetic 39 - #define N_Op_Abs 40 - #define N_Op_Minus 41 - #define N_Op_Not 42 - #define N_Op_Plus 43 - #define N_Attribute_Reference 44 - #define N_And_Then 45 - #define N_Conditional_Expression 46 - #define N_Explicit_Dereference 47 - #define N_Function_Call 48 - #define N_In 49 - #define N_Indexed_Component 50 - #define N_Integer_Literal 51 - #define N_Not_In 52 - #define N_Null 53 - #define N_Or_Else 54 - #define N_Procedure_Call_Statement 55 - #define N_Qualified_Expression 56 - #define N_Raise_Constraint_Error 57 - #define N_Raise_Program_Error 58 - #define N_Raise_Storage_Error 59 - #define N_Aggregate 60 - #define N_Allocator 61 - #define N_Extension_Aggregate 62 - #define N_Range 63 - #define N_Real_Literal 64 - #define N_Reference 65 - #define N_Selected_Component 66 - #define N_Slice 67 - #define N_String_Literal 68 - #define N_Subprogram_Info 69 - #define N_Type_Conversion 70 - #define N_Unchecked_Expression 71 - #define N_Unchecked_Type_Conversion 72 - #define N_Subtype_Indication 73 - #define N_Component_Declaration 74 - #define N_Entry_Declaration 75 - #define N_Formal_Object_Declaration 76 - #define N_Formal_Type_Declaration 77 - #define N_Full_Type_Declaration 78 - #define N_Incomplete_Type_Declaration 79 - #define N_Loop_Parameter_Specification 80 - #define N_Object_Declaration 81 - #define N_Protected_Type_Declaration 82 - #define N_Private_Extension_Declaration 83 - #define N_Private_Type_Declaration 84 - #define N_Subtype_Declaration 85 - #define N_Function_Specification 86 - #define N_Procedure_Specification 87 - #define N_Entry_Index_Specification 88 - #define N_Freeze_Entity 89 - #define N_Access_Function_Definition 90 - #define N_Access_Procedure_Definition 91 - #define N_Task_Type_Declaration 92 - #define N_Package_Body_Stub 93 - #define N_Protected_Body_Stub 94 - #define N_Subprogram_Body_Stub 95 - #define N_Task_Body_Stub 96 - #define N_Function_Instantiation 97 - #define N_Package_Instantiation 98 - #define N_Procedure_Instantiation 99 - #define N_Package_Body 100 - #define N_Subprogram_Body 101 - #define N_Protected_Body 102 - #define N_Task_Body 103 - #define N_Implicit_Label_Declaration 104 - #define N_Package_Declaration 105 - #define N_Single_Task_Declaration 106 - #define N_Subprogram_Declaration 107 - #define N_Use_Package_Clause 108 - #define N_Generic_Package_Declaration 109 - #define N_Generic_Subprogram_Declaration 110 - #define N_Constrained_Array_Definition 111 - #define N_Unconstrained_Array_Definition 112 - #define N_Exception_Renaming_Declaration 113 - #define N_Object_Renaming_Declaration 114 - #define N_Package_Renaming_Declaration 115 - #define N_Subprogram_Renaming_Declaration 116 - #define N_Generic_Function_Renaming_Declaration 117 - #define N_Generic_Package_Renaming_Declaration 118 - #define N_Generic_Procedure_Renaming_Declaration 119 - #define N_Abort_Statement 120 - #define N_Accept_Statement 121 - #define N_Assignment_Statement 122 - #define N_Asynchronous_Select 123 - #define N_Block_Statement 124 - #define N_Case_Statement 125 - #define N_Code_Statement 126 - #define N_Conditional_Entry_Call 127 - #define N_Delay_Relative_Statement 128 - #define N_Delay_Until_Statement 129 - #define N_Entry_Call_Statement 130 - #define N_Free_Statement 131 - #define N_Goto_Statement 132 - #define N_Loop_Statement 133 - #define N_Null_Statement 134 - #define N_Raise_Statement 135 - #define N_Requeue_Statement 136 - #define N_Return_Statement 137 - #define N_Selective_Accept 138 - #define N_Timed_Entry_Call 139 - #define N_Exit_Statement 140 - #define N_If_Statement 141 - #define N_Accept_Alternative 142 - #define N_Delay_Alternative 143 - #define N_Elsif_Part 144 - #define N_Entry_Body_Formal_Part 145 - #define N_Iteration_Scheme 146 - #define N_Terminate_Alternative 147 - #define N_Abortable_Part 148 - #define N_Abstract_Subprogram_Declaration 149 - #define N_Access_Definition 150 - #define N_Access_To_Object_Definition 151 - #define N_Case_Statement_Alternative 152 - #define N_Compilation_Unit 153 - #define N_Compilation_Unit_Aux 154 - #define N_Component_Association 155 - #define N_Component_List 156 - #define N_Derived_Type_Definition 157 - #define N_Decimal_Fixed_Point_Definition 158 - #define N_Defining_Program_Unit_Name 159 - #define N_Delta_Constraint 160 - #define N_Designator 161 - #define N_Digits_Constraint 162 - #define N_Discriminant_Association 163 - #define N_Discriminant_Specification 164 - #define N_Enumeration_Type_Definition 165 - #define N_Entry_Body 166 - #define N_Entry_Call_Alternative 167 - #define N_Exception_Declaration 168 - #define N_Exception_Handler 169 - #define N_Floating_Point_Definition 170 - #define N_Formal_Decimal_Fixed_Point_Definition 171 - #define N_Formal_Derived_Type_Definition 172 - #define N_Formal_Discrete_Type_Definition 173 - #define N_Formal_Floating_Point_Definition 174 - #define N_Formal_Modular_Type_Definition 175 - #define N_Formal_Ordinary_Fixed_Point_Definition 176 - #define N_Formal_Package_Declaration 177 - #define N_Formal_Private_Type_Definition 178 - #define N_Formal_Signed_Integer_Type_Definition 179 - #define N_Formal_Subprogram_Declaration 180 - #define N_Generic_Association 181 - #define N_Handled_Sequence_Of_Statements 182 - #define N_Index_Or_Discriminant_Constraint 183 - #define N_Itype_Reference 184 - #define N_Label 185 - #define N_Modular_Type_Definition 186 - #define N_Number_Declaration 187 - #define N_Ordinary_Fixed_Point_Definition 188 - #define N_Others_Choice 189 - #define N_Package_Specification 190 - #define N_Parameter_Association 191 - #define N_Parameter_Specification 192 - #define N_Protected_Definition 193 - #define N_Range_Constraint 194 - #define N_Real_Range_Specification 195 - #define N_Record_Definition 196 - #define N_Signed_Integer_Type_Definition 197 - #define N_Single_Protected_Declaration 198 - #define N_Subunit 199 - #define N_Task_Definition 200 - #define N_Triggering_Alternative 201 - #define N_Use_Type_Clause 202 - #define N_Validate_Unchecked_Conversion 203 - #define N_Variant 204 - #define N_Variant_Part 205 - #define N_With_Clause 206 - #define N_With_Type_Clause 207 - #define N_Unused_At_End 208 - - #define Number_Node_Kinds 209 - SUBTYPE (N_Access_To_Subprogram_Definition, Node_Kind, - N_Access_Function_Definition, - N_Access_Procedure_Definition) - SUBTYPE (N_Array_Type_Definition, Node_Kind, - N_Constrained_Array_Definition, - N_Unconstrained_Array_Definition) - SUBTYPE (N_Binary_Op, Node_Kind, - N_Op_Add, - N_Op_Shift_Right_Arithmetic) - SUBTYPE (N_Body_Stub, Node_Kind, - N_Package_Body_Stub, - N_Task_Body_Stub) - SUBTYPE (N_Declaration, Node_Kind, - N_Component_Declaration, - N_Procedure_Specification) - SUBTYPE (N_Direct_Name, Node_Kind, - N_Identifier, - N_Character_Literal) - SUBTYPE (N_Entity, Node_Kind, - N_Defining_Character_Literal, - N_Defining_Operator_Symbol) - SUBTYPE (N_Generic_Declaration, Node_Kind, - N_Generic_Package_Declaration, - N_Generic_Subprogram_Declaration) - SUBTYPE (N_Generic_Instantiation, Node_Kind, - N_Function_Instantiation, - N_Procedure_Instantiation) - SUBTYPE (N_Generic_Renaming_Declaration, Node_Kind, - N_Generic_Function_Renaming_Declaration, - N_Generic_Procedure_Renaming_Declaration) - SUBTYPE (N_Has_Chars, Node_Kind, - N_Attribute_Definition_Clause, - N_Op_Plus) - SUBTYPE (N_Has_Entity, Node_Kind, - N_Expanded_Name, - N_Attribute_Reference) - SUBTYPE (N_Has_Etype, Node_Kind, - N_Error, - N_Subtype_Indication) - SUBTYPE (N_Has_Treat_Fixed_As_Integer, Node_Kind, - N_Op_Divide, - N_Op_Rem) - SUBTYPE (N_Later_Decl_Item, Node_Kind, - N_Task_Type_Declaration, - N_Generic_Subprogram_Declaration) - SUBTYPE (N_Op, Node_Kind, - N_Op_Add, - N_Op_Plus) - SUBTYPE (N_Op_Boolean, Node_Kind, - N_Op_And, - N_Op_Xor) - SUBTYPE (N_Op_Compare, Node_Kind, - N_Op_Eq, - N_Op_Ne) - SUBTYPE (N_Op_Shift, Node_Kind, - N_Op_Rotate_Left, - N_Op_Shift_Right_Arithmetic) - SUBTYPE (N_Proper_Body, Node_Kind, - N_Package_Body, - N_Task_Body) - SUBTYPE (N_Raise_xxx_Error, Node_Kind, - N_Raise_Constraint_Error, - N_Raise_Storage_Error) - SUBTYPE (N_Renaming_Declaration, Node_Kind, - N_Exception_Renaming_Declaration, - N_Generic_Procedure_Renaming_Declaration) - SUBTYPE (N_Representation_Clause, Node_Kind, - N_At_Clause, - N_Attribute_Definition_Clause) - SUBTYPE (N_Statement_Other_Than_Procedure_Call, Node_Kind, - N_Abort_Statement, - N_If_Statement) - SUBTYPE (N_Has_Condition, Node_Kind, - N_Exit_Statement, - N_Terminate_Alternative) - SUBTYPE (N_Subexpr, Node_Kind, - N_Expanded_Name, - N_Unchecked_Type_Conversion) - SUBTYPE (N_Subprogram_Specification, Node_Kind, - N_Function_Specification, - N_Procedure_Specification) - SUBTYPE (N_Unary_Op, Node_Kind, - N_Op_Abs, - N_Op_Plus) - SUBTYPE (N_Unit_Body, Node_Kind, - N_Package_Body, - N_Subprogram_Body) - INLINE Boolean ABE_Is_Certain (Node_Id N) - { return Flag18 (N); } - INLINE Boolean Abort_Present (Node_Id N) - { return Flag15 (N); } - INLINE Node_Id Abortable_Part (Node_Id N) - { return Node2 (N); } - INLINE Boolean Abstract_Present (Node_Id N) - { return Flag4 (N); } - INLINE List_Id Accept_Handler_Records (Node_Id N) - { return List5 (N); } - INLINE Node_Id Accept_Statement (Node_Id N) - { return Node2 (N); } - INLINE Elist_Id Access_Types_To_Process (Node_Id N) - { return Elist2 (N); } - INLINE List_Id Actions (Node_Id N) - { return List1 (N); } - INLINE Node_Id Activation_Chain_Entity (Node_Id N) - { return Node3 (N); } - INLINE Boolean Acts_As_Spec (Node_Id N) - { return Flag4 (N); } - INLINE Node_Id Aggregate_Bounds (Node_Id N) - { return Node3 (N); } - INLINE Boolean Aliased_Present (Node_Id N) - { return Flag4 (N); } - INLINE Boolean All_Others (Node_Id N) - { return Flag11 (N); } - INLINE Boolean All_Present (Node_Id N) - { return Flag15 (N); } - INLINE List_Id Alternatives (Node_Id N) - { return List4 (N); } - INLINE Node_Id Ancestor_Part (Node_Id N) - { return Node3 (N); } - INLINE Node_Id Array_Aggregate (Node_Id N) - { return Node3 (N); } - INLINE Boolean Assignment_OK (Node_Id N) - { return Flag15 (N); } - INLINE Node_Id Associated_Node (Node_Id N) - { return Node4 (N); } - INLINE Node_Id At_End_Proc (Node_Id N) - { return Node1 (N); } - INLINE Name_Id Attribute_Name (Node_Id N) - { return Name2 (N); } - INLINE Node_Id Aux_Decls_Node (Node_Id N) - { return Node5 (N); } - INLINE Boolean Backwards_OK (Node_Id N) - { return Flag6 (N); } - INLINE Boolean Bad_Is_Detected (Node_Id N) - { return Flag15 (N); } - INLINE Boolean By_Ref (Node_Id N) - { return Flag5 (N); } - INLINE Boolean Body_Required (Node_Id N) - { return Flag13 (N); } - INLINE Node_Id Body_To_Inline (Node_Id N) - { return Node3 (N); } - INLINE Boolean Box_Present (Node_Id N) - { return Flag15 (N); } - INLINE Char_Code Char_Literal_Value (Node_Id N) - { return Char_Code2 (N); } - INLINE Name_Id Chars (Node_Id N) - { return Name1 (N); } - INLINE Boolean Check_Address_Alignment (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Choice_Parameter (Node_Id N) - { return Node2 (N); } - INLINE List_Id Choices (Node_Id N) - { return List1 (N); } - INLINE Boolean Compile_Time_Known_Aggregate (Node_Id N) - { return Flag18 (N); } - INLINE List_Id Component_Associations (Node_Id N) - { return List2 (N); } - INLINE List_Id Component_Clauses (Node_Id N) - { return List3 (N); } - INLINE List_Id Component_Items (Node_Id N) - { return List3 (N); } - INLINE Node_Id Component_List (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Component_Name (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Condition (Node_Id N) - { return Node1 (N); } - INLINE List_Id Condition_Actions (Node_Id N) - { return List3 (N); } - INLINE List_Id Config_Pragmas (Node_Id N) - { return List4 (N); } - INLINE Boolean Constant_Present (Node_Id N) - { return Flag17 (N); } - INLINE Node_Id Constraint (Node_Id N) - { return Node3 (N); } - INLINE List_Id Constraints (Node_Id N) - { return List1 (N); } - INLINE Boolean Context_Installed (Node_Id N) - { return Flag13 (N); } - INLINE List_Id Context_Items (Node_Id N) - { return List1 (N); } - INLINE Node_Id Controlling_Argument (Node_Id N) - { return Node1 (N); } - INLINE Boolean Conversion_OK (Node_Id N) - { return Flag14 (N); } - INLINE Node_Id Corresponding_Body (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Corresponding_Generic_Association (Node_Id N) - { return Node5 (N); } - INLINE Uint Corresponding_Integer_Value (Node_Id N) - { return Uint4 (N); } - INLINE Node_Id Corresponding_Spec (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Corresponding_Stub (Node_Id N) - { return Node3 (N); } - INLINE Entity_Id Dcheck_Function (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Debug_Statement (Node_Id N) - { return Node3 (N); } - INLINE List_Id Declarations (Node_Id N) - { return List2 (N); } - INLINE Node_Id Default_Expression (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Default_Name (Node_Id N) - { return Node2 (N); } - INLINE Entity_Id Defining_Identifier (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Defining_Unit_Name (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Delay_Alternative (Node_Id N) - { return Node4 (N); } - INLINE Boolean Delay_Finalize_Attach (Node_Id N) - { return Flag14 (N); } - INLINE Node_Id Delay_Statement (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Delta_Expression (Node_Id N) - { return Node3 (N); } - INLINE Node_Id Digits_Expression (Node_Id N) - { return Node2 (N); } - INLINE Boolean Discr_Check_Funcs_Built (Node_Id N) - { return Flag11 (N); } - INLINE List_Id Discrete_Choices (Node_Id N) - { return List4 (N); } - INLINE Node_Id Discrete_Range (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Discrete_Subtype_Definition (Node_Id N) - { return Node4 (N); } - INLINE List_Id Discrete_Subtype_Definitions (Node_Id N) - { return List2 (N); } - INLINE List_Id Discriminant_Specifications (Node_Id N) - { return List4 (N); } - INLINE Node_Id Discriminant_Type (Node_Id N) - { return Node5 (N); } - INLINE Boolean Do_Accessibility_Check (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Do_Discriminant_Check (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Do_Division_Check (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Do_Length_Check (Node_Id N) - { return Flag4 (N); } - INLINE Boolean Do_Overflow_Check (Node_Id N) - { return Flag17 (N); } - INLINE Boolean Do_Range_Check (Node_Id N) - { return Flag9 (N); } - INLINE Boolean Do_Storage_Check (Node_Id N) - { return Flag17 (N); } - INLINE Boolean Do_Tag_Check (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Elaborate_All_Present (Node_Id N) - { return Flag15 (N); } - INLINE Boolean Elaborate_Present (Node_Id N) - { return Flag4 (N); } - INLINE Node_Id Elaboration_Boolean (Node_Id N) - { return Node2 (N); } - INLINE List_Id Else_Actions (Node_Id N) - { return List3 (N); } - INLINE List_Id Else_Statements (Node_Id N) - { return List4 (N); } - INLINE List_Id Elsif_Parts (Node_Id N) - { return List3 (N); } - INLINE Node_Id Enclosing_Variant (Node_Id N) - { return Node2 (N); } - INLINE Node_Id End_Label (Node_Id N) - { return Node4 (N); } - INLINE Uint End_Span (Node_Id N) - { return Uint5 (N); } - INLINE Node_Id Entity (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Entry_Body_Formal_Part (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Entry_Call_Alternative (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Entry_Call_Statement (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Entry_Direct_Name (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Entry_Index (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Entry_Index_Specification (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Etype (Node_Id N) - { return Node5 (N); } - INLINE List_Id Exception_Choices (Node_Id N) - { return List4 (N); } - INLINE List_Id Exception_Handlers (Node_Id N) - { return List5 (N); } - INLINE Boolean Exception_Junk (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Explicit_Actual_Parameter (Node_Id N) - { return Node3 (N); } - INLINE Boolean Expansion_Delayed (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Explicit_Generic_Actual_Parameter (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Expression (Node_Id N) - { return Node3 (N); } - INLINE List_Id Expressions (Node_Id N) - { return List1 (N); } - INLINE Node_Id First_Bit (Node_Id N) - { return Node3 (N); } - INLINE Entity_Id First_Inlined_Subprogram (Node_Id N) - { return Node3 (N); } - INLINE Boolean First_Name (Node_Id N) - { return Flag5 (N); } - INLINE Node_Id First_Named_Actual (Node_Id N) - { return Node4 (N); } - INLINE Node_Id First_Real_Statement (Node_Id N) - { return Node2 (N); } - INLINE Entity_Id First_Subtype_Link (Node_Id N) - { return Node5 (N); } - INLINE Boolean Float_Truncate (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Formal_Type_Definition (Node_Id N) - { return Node3 (N); } - INLINE Boolean Forwards_OK (Node_Id N) - { return Flag5 (N); } - INLINE Boolean From_At_Mod (Node_Id N) - { return Flag4 (N); } - INLINE List_Id Generic_Associations (Node_Id N) - { return List3 (N); } - INLINE List_Id Generic_Formal_Declarations (Node_Id N) - { return List2 (N); } - INLINE Node_Id Generic_Parent (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Generic_Parent_Type (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Handled_Statement_Sequence (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Handler_List_Entry (Node_Id N) - { return Node2 (N); } - INLINE Boolean Has_Created_Identifier (Node_Id N) - { return Flag15 (N); } - INLINE Boolean Has_Dynamic_Length_Check (Node_Id N) - { return Flag10 (N); } - INLINE Boolean Has_Dynamic_Range_Check (Node_Id N) - { return Flag12 (N); } - INLINE Boolean Has_No_Elaboration_Code (Node_Id N) - { return Flag17 (N); } - INLINE Boolean Has_Priority_Pragma (Node_Id N) - { return Flag6 (N); } - INLINE Boolean Has_Private_View (Node_Id N) - { return Flag11 (N); } - INLINE Boolean Has_Storage_Size_Pragma (Node_Id N) - { return Flag5 (N); } - INLINE Boolean Has_Task_Info_Pragma (Node_Id N) - { return Flag7 (N); } - INLINE Boolean Has_Task_Name_Pragma (Node_Id N) - { return Flag8 (N); } - INLINE Boolean Has_Wide_Character (Node_Id N) - { return Flag11 (N); } - INLINE Elist_Id Hidden_By_Use_Clause (Node_Id N) - { return Elist4 (N); } - INLINE Node_Id High_Bound (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Identifier (Node_Id N) - { return Node1 (N); } - INLINE Boolean Implicit_With (Node_Id N) - { return Flag16 (N); } - INLINE Boolean In_Present (Node_Id N) - { return Flag15 (N); } - INLINE Boolean Includes_Infinities (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Instance_Spec (Node_Id N) - { return Node5 (N); } - INLINE Uint Intval (Node_Id N) - { return Uint3 (N); } - INLINE Boolean Is_Asynchronous_Call_Block (Node_Id N) - { return Flag7 (N); } - INLINE Boolean Is_Component_Left_Opnd (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Is_Component_Right_Opnd (Node_Id N) - { return Flag14 (N); } - INLINE Boolean Is_Controlling_Actual (Node_Id N) - { return Flag16 (N); } - INLINE Boolean Is_In_Discriminant_Check (Node_Id N) - { return Flag11 (N); } - INLINE Boolean Is_Machine_Number (Node_Id N) - { return Flag11 (N); } - INLINE Boolean Is_Null_Loop (Node_Id N) - { return Flag16 (N); } - INLINE Boolean Is_Overloaded (Node_Id N) - { return Flag5 (N); } - INLINE Boolean Is_Power_Of_2_For_Shift (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Is_Protected_Subprogram_Body (Node_Id N) - { return Flag7 (N); } - INLINE Boolean Is_Static_Expression (Node_Id N) - { return Flag6 (N); } - INLINE Boolean Is_Subprogram_Descriptor (Node_Id N) - { return Flag16 (N); } - INLINE Boolean Is_Task_Allocation_Block (Node_Id N) - { return Flag6 (N); } - INLINE Boolean Is_Task_Master (Node_Id N) - { return Flag5 (N); } - INLINE Node_Id Iteration_Scheme (Node_Id N) - { return Node2 (N); } - INLINE Entity_Id Itype (Node_Id N) - { return Node1 (N); } - INLINE Boolean Kill_Range_Check (Node_Id N) - { return Flag11 (N); } - INLINE Node_Id Label_Construct (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Left_Opnd (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Last_Bit (Node_Id N) - { return Node4 (N); } - INLINE Boolean Last_Name (Node_Id N) - { return Flag6 (N); } - INLINE Node_Id Library_Unit (Node_Id N) - { return Node4 (N); } - INLINE Boolean Limited_View_Installed (Node_Id N) - { return Flag18 (N); } - INLINE Boolean Limited_Present (Node_Id N) - { return Flag17 (N); } - INLINE List_Id Literals (Node_Id N) - { return List1 (N); } - INLINE List_Id Loop_Actions (Node_Id N) - { return List2 (N); } - INLINE Node_Id Loop_Parameter_Specification (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Low_Bound (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Mod_Clause (Node_Id N) - { return Node2 (N); } - INLINE Boolean More_Ids (Node_Id N) - { return Flag5 (N); } - INLINE Boolean Must_Be_Byte_Aligned (Node_Id N) - { return Flag14 (N); } - INLINE Boolean Must_Not_Freeze (Node_Id N) - { return Flag8 (N); } - INLINE Node_Id Name (Node_Id N) - { return Node2 (N); } - INLINE List_Id Names (Node_Id N) - { return List2 (N); } - INLINE Node_Id Next_Entity (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Next_Named_Actual (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Next_Rep_Item (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Next_Use_Clause (Node_Id N) - { return Node3 (N); } - INLINE Boolean No_Ctrl_Actions (Node_Id N) - { return Flag7 (N); } - INLINE Boolean No_Entities_Ref_In_Spec (Node_Id N) - { return Flag8 (N); } - INLINE Boolean No_Initialization (Node_Id N) - { return Flag13 (N); } - INLINE Boolean No_Truncation (Node_Id N) - { return Flag17 (N); } - INLINE Boolean Null_Present (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Null_Record_Present (Node_Id N) - { return Flag17 (N); } - INLINE Node_Id Object_Definition (Node_Id N) - { return Node4 (N); } - INLINE Boolean OK_For_Stream (Node_Id N) - { return Flag4 (N); } - INLINE Node_Id Original_Discriminant (Node_Id N) - { return Node2 (N); } - INLINE Entity_Id Original_Entity (Node_Id N) - { return Node2 (N); } - INLINE List_Id Others_Discrete_Choices (Node_Id N) - { return List1 (N); } - INLINE Boolean Out_Present (Node_Id N) - { return Flag17 (N); } - INLINE List_Id Parameter_Associations (Node_Id N) - { return List3 (N); } - INLINE Boolean Parameter_List_Truncated (Node_Id N) - { return Flag17 (N); } - INLINE List_Id Parameter_Specifications (Node_Id N) - { return List3 (N); } - INLINE Node_Id Parameter_Type (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Parent_Spec (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Position (Node_Id N) - { return Node2 (N); } - INLINE List_Id Pragma_Argument_Associations (Node_Id N) - { return List2 (N); } - INLINE List_Id Pragmas_After (Node_Id N) - { return List5 (N); } - INLINE List_Id Pragmas_Before (Node_Id N) - { return List4 (N); } - INLINE Node_Id Prefix (Node_Id N) - { return Node3 (N); } - INLINE Uint Present_Expr (Node_Id N) - { return Uint3 (N); } - INLINE Boolean Prev_Ids (Node_Id N) - { return Flag6 (N); } - INLINE Boolean Print_In_Hex (Node_Id N) - { return Flag13 (N); } - INLINE List_Id Private_Declarations (Node_Id N) - { return List3 (N); } - INLINE Boolean Private_Present (Node_Id N) - { return Flag15 (N); } - INLINE Node_Id Procedure_To_Call (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Proper_Body (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Protected_Definition (Node_Id N) - { return Node3 (N); } - INLINE Boolean Protected_Present (Node_Id N) - { return Flag15 (N); } - INLINE Boolean Raises_Constraint_Error (Node_Id N) - { return Flag7 (N); } - INLINE Node_Id Range_Constraint (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Range_Expression (Node_Id N) - { return Node4 (N); } - INLINE Node_Id Real_Range_Specification (Node_Id N) - { return Node4 (N); } - INLINE Ureal Realval (Node_Id N) - { return Ureal3 (N); } - INLINE Uint Reason (Node_Id N) - { return Uint3 (N); } - INLINE Node_Id Record_Extension_Part (Node_Id N) - { return Node3 (N); } - INLINE Boolean Redundant_Use (Node_Id N) - { return Flag13 (N); } - INLINE Node_Id Return_Type (Node_Id N) - { return Node2 (N); } - INLINE Boolean Reverse_Present (Node_Id N) - { return Flag15 (N); } - INLINE Node_Id Right_Opnd (Node_Id N) - { return Node3 (N); } - INLINE Boolean Rounded_Result (Node_Id N) - { return Flag18 (N); } - INLINE Node_Id Scope (Node_Id N) - { return Node3 (N); } - INLINE List_Id Select_Alternatives (Node_Id N) - { return List1 (N); } - INLINE Node_Id Selector_Name (Node_Id N) - { return Node2 (N); } - INLINE List_Id Selector_Names (Node_Id N) - { return List1 (N); } - INLINE Boolean Shift_Count_OK (Node_Id N) - { return Flag4 (N); } - INLINE Entity_Id Source_Type (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Specification (Node_Id N) - { return Node1 (N); } - INLINE List_Id Statements (Node_Id N) - { return List3 (N); } - INLINE Boolean Static_Processing_OK (Node_Id N) - { return Flag4 (N); } - INLINE Node_Id Storage_Pool (Node_Id N) - { return Node1 (N); } - INLINE String_Id Strval (Node_Id N) - { return Str3 (N); } - INLINE Node_Id Subtype_Indication (Node_Id N) - { return Node5 (N); } - INLINE Node_Id Subtype_Mark (Node_Id N) - { return Node4 (N); } - INLINE List_Id Subtype_Marks (Node_Id N) - { return List2 (N); } - INLINE Boolean Tagged_Present (Node_Id N) - { return Flag15 (N); } - INLINE Entity_Id Target_Type (Node_Id N) - { return Node2 (N); } - INLINE Entity_Id Task_Body_Procedure (Node_Id N) - { return Node2 (N); } - INLINE Node_Id Task_Definition (Node_Id N) - { return Node3 (N); } - INLINE List_Id Then_Actions (Node_Id N) - { return List2 (N); } - INLINE List_Id Then_Statements (Node_Id N) - { return List2 (N); } - INLINE Boolean Treat_Fixed_As_Integer (Node_Id N) - { return Flag14 (N); } - INLINE Node_Id Triggering_Alternative (Node_Id N) - { return Node1 (N); } - INLINE Node_Id Triggering_Statement (Node_Id N) - { return Node1 (N); } - INLINE Elist_Id TSS_Elist (Node_Id N) - { return Elist3 (N); } - INLINE Node_Id Type_Definition (Node_Id N) - { return Node3 (N); } - INLINE Node_Id Unit (Node_Id N) - { return Node2 (N); } - INLINE Boolean Unknown_Discriminants_Present (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Unreferenced_In_Spec (Node_Id N) - { return Flag7 (N); } - INLINE Node_Id Variant_Part (Node_Id N) - { return Node4 (N); } - INLINE List_Id Variants (Node_Id N) - { return List1 (N); } - INLINE List_Id Visible_Declarations (Node_Id N) - { return List2 (N); } - INLINE Boolean Was_Originally_Stub (Node_Id N) - { return Flag13 (N); } - INLINE Boolean Zero_Cost_Handling (Node_Id N) - { return Flag5 (N); } - diff --git a/gcc/ada/treeprs.ads b/gcc/ada/treeprs.ads deleted file mode 100644 index 433cb081975..00000000000 --- a/gcc/ada/treeprs.ads +++ /dev/null @@ -1,796 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT COMPILER COMPONENTS -- --- -- --- T R E E P R S -- --- -- --- S p e c -- --- -- --- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - - --- This package contains the declaration of the string used by the Tree_Print --- package. It must be updated whenever the arrangements of the field names --- in package Sinfo is changed. The utility program XTREEPRS is used to --- do this update correctly using the template treeprs.adt as input. - -with Sinfo; use Sinfo; - -package Treeprs is - - -------------------------------- - -- String Data for Node Print -- - -------------------------------- - - -- String data for print out. The Pchars array is a long string with the - -- the entry for each node type consisting of a single blank, followed by - -- a series of entries, one for each Op or Flag field used for the node. - -- Each entry has a single character which identifies the field, followed - -- by the synonym name. The starting location for a given node type is - -- found from the corresponding entry in the Pchars_Pos_Array. - - -- The following characters identify the field. These are characters - -- which could never occur in a field name, so they also mark the - -- end of the previous name. - - subtype Fchar is Character range '#' .. '9'; - - F_Field1 : constant Fchar := '#'; -- Character'Val (16#23#) - F_Field2 : constant Fchar := '$'; -- Character'Val (16#24#) - F_Field3 : constant Fchar := '%'; -- Character'Val (16#25#) - F_Field4 : constant Fchar := '&'; -- Character'Val (16#26#) - F_Field5 : constant Fchar := '''; -- Character'Val (16#27#) - F_Flag1 : constant Fchar := '('; -- Character'Val (16#28#) - F_Flag2 : constant Fchar := ')'; -- Character'Val (16#29#) - F_Flag3 : constant Fchar := '*'; -- Character'Val (16#2A#) - F_Flag4 : constant Fchar := '+'; -- Character'Val (16#2B#) - F_Flag5 : constant Fchar := ','; -- Character'Val (16#2C#) - F_Flag6 : constant Fchar := '-'; -- Character'Val (16#2D#) - F_Flag7 : constant Fchar := '.'; -- Character'Val (16#2E#) - F_Flag8 : constant Fchar := '/'; -- Character'Val (16#2F#) - F_Flag9 : constant Fchar := '0'; -- Character'Val (16#30#) - F_Flag10 : constant Fchar := '1'; -- Character'Val (16#31#) - F_Flag11 : constant Fchar := '2'; -- Character'Val (16#32#) - F_Flag12 : constant Fchar := '3'; -- Character'Val (16#33#) - F_Flag13 : constant Fchar := '4'; -- Character'Val (16#34#) - F_Flag14 : constant Fchar := '5'; -- Character'Val (16#35#) - F_Flag15 : constant Fchar := '6'; -- Character'Val (16#36#) - F_Flag16 : constant Fchar := '7'; -- Character'Val (16#37#) - F_Flag17 : constant Fchar := '8'; -- Character'Val (16#38#) - F_Flag18 : constant Fchar := '9'; -- Character'Val (16#39#) - - -- Note this table does not include entity field and flags whose access - -- functions are in Einfo (these are handled by the Print_Entity_Info - -- procedure in Treepr, which uses the routines in Einfo to get the - -- proper symbolic information). In addition, the following fields are - -- handled by Treepr, and do not appear in the Pchars array: - - -- Analyzed - -- Cannot_Be_Constant - -- Chars - -- Comes_From_Source - -- Error_Posted - -- Etype - -- Is_Controlling_Actual - -- Is_Overloaded - -- Is_Static_Expression - -- Left_Opnd - -- Must_Check_Expr - -- Must_Not_Freeze - -- No_Overflow_Expr - -- Paren_Count - -- Raises_Constraint_Error - -- Right_Opnd - - Pchars : constant String := - -- Unused_At_Start - "" & - -- At_Clause - "#Identifier%Expression" & - -- Component_Clause - "#Component_Name$Position%First_Bit&Last_Bit" & - -- Enumeration_Representation_Clause - "#Identifier%Array_Aggregate&Next_Rep_Item" & - -- Mod_Clause - "%Expression&Pragmas_Before" & - -- Record_Representation_Clause - "#Identifier$Mod_Clause%Component_Clauses&Next_Rep_Item" & - -- Attribute_Definition_Clause - "$Name%Expression&Next_Rep_Item+From_At_Mod2Check_Address_Alignment" & - -- Empty - "" & - -- Pragma - "$Pragma_Argument_Associations%Debug_Statement&Next_Rep_Item" & - -- Pragma_Argument_Association - "%Expression" & - -- Error - "" & - -- Defining_Character_Literal - "$Next_Entity%Scope" & - -- Defining_Identifier - "$Next_Entity%Scope" & - -- Defining_Operator_Symbol - "$Next_Entity%Scope" & - -- Expanded_Name - "%Prefix$Selector_Name&Entity&Associated_Node4Redundant_Use2Has_Privat" & - "e_View" & - -- Identifier - "&Entity&Associated_Node$Original_Discriminant4Redundant_Use2Has_Priva" & - "te_View" & - -- Operator_Symbol - "%Strval&Entity&Associated_Node2Has_Private_View" & - -- Character_Literal - "$Char_Literal_Value&Entity&Associated_Node2Has_Private_View" & - -- Op_Add - "" & - -- Op_Concat - "4Is_Component_Left_Opnd5Is_Component_Right_Opnd" & - -- Op_Expon - "4Is_Power_Of_2_For_Shift" & - -- Op_Subtract - "" & - -- Op_Divide - "5Treat_Fixed_As_Integer4Do_Division_Check9Rounded_Result" & - -- Op_Mod - "5Treat_Fixed_As_Integer4Do_Division_Check" & - -- Op_Multiply - "5Treat_Fixed_As_Integer9Rounded_Result" & - -- Op_Rem - "5Treat_Fixed_As_Integer4Do_Division_Check" & - -- Op_And - "+Do_Length_Check" & - -- Op_Eq - "" & - -- Op_Ge - "" & - -- Op_Gt - "" & - -- Op_Le - "" & - -- Op_Lt - "" & - -- Op_Ne - "" & - -- Op_Or - "+Do_Length_Check" & - -- Op_Xor - "+Do_Length_Check" & - -- Op_Rotate_Left - "+Shift_Count_OK" & - -- Op_Rotate_Right - "+Shift_Count_OK" & - -- Op_Shift_Left - "+Shift_Count_OK" & - -- Op_Shift_Right - "+Shift_Count_OK" & - -- Op_Shift_Right_Arithmetic - "+Shift_Count_OK" & - -- Op_Abs - "" & - -- Op_Minus - "" & - -- Op_Not - "" & - -- Op_Plus - "" & - -- Attribute_Reference - "%Prefix$Attribute_Name#Expressions&Entity&Associated_Node8Do_Overflow" & - "_Check4Redundant_Use+OK_For_Stream5Must_Be_Byte_Aligned" & - -- And_Then - "#Actions" & - -- Conditional_Expression - "#Expressions$Then_Actions%Else_Actions" & - -- Explicit_Dereference - "%Prefix" & - -- Function_Call - "$Name%Parameter_Associations&First_Named_Actual#Controlling_Argument4" & - "Do_Tag_Check8Parameter_List_Truncated9ABE_Is_Certain" & - -- In - "" & - -- Indexed_Component - "%Prefix#Expressions" & - -- Integer_Literal - "$Original_Entity%Intval4Print_In_Hex" & - -- Not_In - "" & - -- Null - "" & - -- Or_Else - "#Actions" & - -- Procedure_Call_Statement - "$Name%Parameter_Associations&First_Named_Actual#Controlling_Argument4" & - "Do_Tag_Check8Parameter_List_Truncated9ABE_Is_Certain" & - -- Qualified_Expression - "&Subtype_Mark%Expression" & - -- Raise_Constraint_Error - "#Condition%Reason" & - -- Raise_Program_Error - "#Condition%Reason" & - -- Raise_Storage_Error - "#Condition%Reason" & - -- Aggregate - "#Expressions$Component_Associations8Null_Record_Present%Aggregate_Bou" & - "nds&Associated_Node+Static_Processing_OK9Compile_Time_Known_Aggreg" & - "ate2Expansion_Delayed" & - -- Allocator - "%Expression#Storage_Pool&Procedure_To_Call4No_Initialization8Do_Stora" & - "ge_Check" & - -- Extension_Aggregate - "%Ancestor_Part&Associated_Node#Expressions$Component_Associations8Nul" & - "l_Record_Present2Expansion_Delayed" & - -- Range - "#Low_Bound$High_Bound2Includes_Infinities" & - -- Real_Literal - "$Original_Entity%Realval&Corresponding_Integer_Value2Is_Machine_Numbe" & - "r" & - -- Reference - "%Prefix" & - -- Selected_Component - "%Prefix$Selector_Name&Associated_Node4Do_Discriminant_Check2Is_In_Dis" & - "criminant_Check" & - -- Slice - "%Prefix&Discrete_Range" & - -- String_Literal - "%Strval2Has_Wide_Character" & - -- Subprogram_Info - "#Identifier" & - -- Type_Conversion - "&Subtype_Mark%Expression4Do_Tag_Check+Do_Length_Check8Do_Overflow_Che" & - "ck2Float_Truncate9Rounded_Result5Conversion_OK" & - -- Unchecked_Expression - "%Expression" & - -- Unchecked_Type_Conversion - "&Subtype_Mark%Expression2Kill_Range_Check8No_Truncation" & - -- Subtype_Indication - "&Subtype_Mark%Constraint/Must_Not_Freeze" & - -- Component_Declaration - "#Defining_Identifier+Aliased_Present'Subtype_Indication%Expression,Mo" & - "re_Ids-Prev_Ids" & - -- Entry_Declaration - "#Defining_Identifier&Discrete_Subtype_Definition%Parameter_Specificat" & - "ions'Corresponding_Body" & - -- Formal_Object_Declaration - "#Defining_Identifier6In_Present8Out_Present&Subtype_Mark%Expression,M" & - "ore_Ids-Prev_Ids" & - -- Formal_Type_Declaration - "#Defining_Identifier%Formal_Type_Definition&Discriminant_Specificatio" & - "ns4Unknown_Discriminants_Present" & - -- Full_Type_Declaration - "#Defining_Identifier&Discriminant_Specifications%Type_Definition2Disc" & - "r_Check_Funcs_Built" & - -- Incomplete_Type_Declaration - "#Defining_Identifier&Discriminant_Specifications4Unknown_Discriminant" & - "s_Present" & - -- Loop_Parameter_Specification - "#Defining_Identifier6Reverse_Present&Discrete_Subtype_Definition" & - -- Object_Declaration - "#Defining_Identifier+Aliased_Present8Constant_Present&Object_Definiti" & - "on%Expression$Handler_List_Entry'Corresponding_Generic_Association" & - ",More_Ids-Prev_Ids4No_Initialization6Assignment_OK2Exception_Junk5" & - "Delay_Finalize_Attach7Is_Subprogram_Descriptor" & - -- Protected_Type_Declaration - "#Defining_Identifier&Discriminant_Specifications%Protected_Definition" & - "'Corresponding_Body" & - -- Private_Extension_Declaration - "#Defining_Identifier&Discriminant_Specifications4Unknown_Discriminant" & - "s_Present+Abstract_Present'Subtype_Indication" & - -- Private_Type_Declaration - "#Defining_Identifier&Discriminant_Specifications4Unknown_Discriminant" & - "s_Present+Abstract_Present6Tagged_Present8Limited_Present" & - -- Subtype_Declaration - "#Defining_Identifier'Subtype_Indication&Generic_Parent_Type2Exception" & - "_Junk" & - -- Function_Specification - "#Defining_Unit_Name$Elaboration_Boolean%Parameter_Specifications&Subt" & - "ype_Mark'Generic_Parent" & - -- Procedure_Specification - "#Defining_Unit_Name$Elaboration_Boolean%Parameter_Specifications'Gene" & - "ric_Parent" & - -- Entry_Index_Specification - "#Defining_Identifier&Discrete_Subtype_Definition" & - -- Freeze_Entity - "&Entity$Access_Types_To_Process%TSS_Elist#Actions'First_Subtype_Link" & - -- Access_Function_Definition - "6Protected_Present%Parameter_Specifications&Subtype_Mark" & - -- Access_Procedure_Definition - "6Protected_Present%Parameter_Specifications" & - -- Task_Type_Declaration - "#Defining_Identifier$Task_Body_Procedure&Discriminant_Specifications%" & - "Task_Definition'Corresponding_Body" & - -- Package_Body_Stub - "#Defining_Identifier&Library_Unit'Corresponding_Body" & - -- Protected_Body_Stub - "#Defining_Identifier&Library_Unit'Corresponding_Body" & - -- Subprogram_Body_Stub - "#Specification&Library_Unit'Corresponding_Body" & - -- Task_Body_Stub - "#Defining_Identifier&Library_Unit'Corresponding_Body" & - -- Function_Instantiation - "#Defining_Unit_Name$Name%Generic_Associations&Parent_Spec'Instance_Sp" & - "ec9ABE_Is_Certain" & - -- Package_Instantiation - "#Defining_Unit_Name$Name%Generic_Associations&Parent_Spec'Instance_Sp" & - "ec9ABE_Is_Certain" & - -- Procedure_Instantiation - "#Defining_Unit_Name$Name&Parent_Spec%Generic_Associations'Instance_Sp" & - "ec9ABE_Is_Certain" & - -- Package_Body - "#Defining_Unit_Name$Declarations&Handled_Statement_Sequence'Correspon" & - "ding_Spec4Was_Originally_Stub" & - -- Subprogram_Body - "#Specification$Declarations&Handled_Statement_Sequence%Activation_Cha" & - "in_Entity'Corresponding_Spec+Acts_As_Spec6Bad_Is_Detected8Do_Stora" & - "ge_Check-Has_Priority_Pragma.Is_Protected_Subprogram_Body,Is_Task_" & - "Master4Was_Originally_Stub" & - -- Protected_Body - "#Defining_Identifier$Declarations&End_Label'Corresponding_Spec4Was_Or" & - "iginally_Stub" & - -- Task_Body - "#Defining_Identifier$Declarations&Handled_Statement_Sequence,Is_Task_" & - "Master%Activation_Chain_Entity'Corresponding_Spec4Was_Originally_S" & - "tub" & - -- Implicit_Label_Declaration - "#Defining_Identifier$Label_Construct" & - -- Package_Declaration - "#Specification'Corresponding_Body&Parent_Spec%Activation_Chain_Entity" & - -- Single_Task_Declaration - "#Defining_Identifier%Task_Definition" & - -- Subprogram_Declaration - "#Specification%Body_To_Inline'Corresponding_Body&Parent_Spec" & - -- Use_Package_Clause - "$Names%Next_Use_Clause&Hidden_By_Use_Clause" & - -- Generic_Package_Declaration - "#Specification'Corresponding_Body$Generic_Formal_Declarations&Parent_" & - "Spec%Activation_Chain_Entity" & - -- Generic_Subprogram_Declaration - "#Specification'Corresponding_Body$Generic_Formal_Declarations&Parent_" & - "Spec" & - -- Constrained_Array_Definition - "$Discrete_Subtype_Definitions+Aliased_Present'Subtype_Indication" & - -- Unconstrained_Array_Definition - "$Subtype_Marks+Aliased_Present'Subtype_Indication" & - -- Exception_Renaming_Declaration - "#Defining_Identifier$Name" & - -- Object_Renaming_Declaration - "#Defining_Identifier&Subtype_Mark$Name'Corresponding_Generic_Associat" & - "ion" & - -- Package_Renaming_Declaration - "#Defining_Unit_Name$Name&Parent_Spec" & - -- Subprogram_Renaming_Declaration - "#Specification$Name&Parent_Spec'Corresponding_Spec" & - -- Generic_Function_Renaming_Declaration - "#Defining_Unit_Name$Name&Parent_Spec" & - -- Generic_Package_Renaming_Declaration - "#Defining_Unit_Name$Name&Parent_Spec" & - -- Generic_Procedure_Renaming_Declaration - "#Defining_Unit_Name$Name&Parent_Spec" & - -- Abort_Statement - "$Names" & - -- Accept_Statement - "#Entry_Direct_Name'Entry_Index%Parameter_Specifications&Handled_State" & - "ment_Sequence$Declarations" & - -- Assignment_Statement - "$Name%Expression4Do_Tag_Check+Do_Length_Check,Forwards_OK-Backwards_O" & - "K.No_Ctrl_Actions" & - -- Asynchronous_Select - "#Triggering_Alternative$Abortable_Part" & - -- Block_Statement - "#Identifier$Declarations&Handled_Statement_Sequence,Is_Task_Master%Ac" & - "tivation_Chain_Entity6Has_Created_Identifier-Is_Task_Allocation_Bl" & - "ock.Is_Asynchronous_Call_Block" & - -- Case_Statement - "%Expression&Alternatives'End_Span" & - -- Code_Statement - "%Expression" & - -- Conditional_Entry_Call - "#Entry_Call_Alternative&Else_Statements" & - -- Delay_Relative_Statement - "%Expression" & - -- Delay_Until_Statement - "%Expression" & - -- Entry_Call_Statement - "$Name%Parameter_Associations&First_Named_Actual" & - -- Free_Statement - "%Expression#Storage_Pool&Procedure_To_Call" & - -- Goto_Statement - "$Name2Exception_Junk" & - -- Loop_Statement - "#Identifier$Iteration_Scheme%Statements&End_Label6Has_Created_Identif" & - "ier7Is_Null_Loop" & - -- Null_Statement - "" & - -- Raise_Statement - "$Name" & - -- Requeue_Statement - "$Name6Abort_Present" & - -- Return_Statement - "%Expression#Storage_Pool&Procedure_To_Call4Do_Tag_Check$Return_Type,B" & - "y_Ref" & - -- Selective_Accept - "#Select_Alternatives&Else_Statements" & - -- Timed_Entry_Call - "#Entry_Call_Alternative&Delay_Alternative" & - -- Exit_Statement - "$Name#Condition" & - -- If_Statement - "#Condition$Then_Statements%Elsif_Parts&Else_Statements'End_Span" & - -- Accept_Alternative - "$Accept_Statement#Condition%Statements&Pragmas_Before'Accept_Handler_" & - "Records" & - -- Delay_Alternative - "$Delay_Statement#Condition%Statements&Pragmas_Before" & - -- Elsif_Part - "#Condition$Then_Statements%Condition_Actions" & - -- Entry_Body_Formal_Part - "&Entry_Index_Specification%Parameter_Specifications#Condition" & - -- Iteration_Scheme - "#Condition%Condition_Actions&Loop_Parameter_Specification" & - -- Terminate_Alternative - "#Condition&Pragmas_Before'Pragmas_After" & - -- Abortable_Part - "%Statements" & - -- Abstract_Subprogram_Declaration - "#Specification" & - -- Access_Definition - "&Subtype_Mark" & - -- Access_To_Object_Definition - "6All_Present'Subtype_Indication8Constant_Present" & - -- Case_Statement_Alternative - "&Discrete_Choices%Statements" & - -- Compilation_Unit - "&Library_Unit#Context_Items6Private_Present$Unit'Aux_Decls_Node8Has_N" & - "o_Elaboration_Code4Body_Required+Acts_As_Spec%First_Inlined_Subpro" & - "gram" & - -- Compilation_Unit_Aux - "$Declarations#Actions'Pragmas_After&Config_Pragmas" & - -- Component_Association - "#Choices$Loop_Actions%Expression" & - -- Component_List - "%Component_Items&Variant_Part4Null_Present" & - -- Derived_Type_Definition - "+Abstract_Present'Subtype_Indication%Record_Extension_Part" & - -- Decimal_Fixed_Point_Definition - "%Delta_Expression$Digits_Expression&Real_Range_Specification" & - -- Defining_Program_Unit_Name - "$Name#Defining_Identifier" & - -- Delta_Constraint - "%Delta_Expression&Range_Constraint" & - -- Designator - "$Name#Identifier" & - -- Digits_Constraint - "$Digits_Expression&Range_Constraint" & - -- Discriminant_Association - "#Selector_Names%Expression" & - -- Discriminant_Specification - "#Defining_Identifier'Discriminant_Type%Expression,More_Ids-Prev_Ids" & - -- Enumeration_Type_Definition - "#Literals&End_Label" & - -- Entry_Body - "#Defining_Identifier'Entry_Body_Formal_Part$Declarations&Handled_Stat" & - "ement_Sequence%Activation_Chain_Entity" & - -- Entry_Call_Alternative - "#Entry_Call_Statement%Statements&Pragmas_Before" & - -- Exception_Declaration - "#Defining_Identifier%Expression,More_Ids-Prev_Ids" & - -- Exception_Handler - "$Choice_Parameter&Exception_Choices%Statements,Zero_Cost_Handling" & - -- Floating_Point_Definition - "$Digits_Expression&Real_Range_Specification" & - -- Formal_Decimal_Fixed_Point_Definition - "" & - -- Formal_Derived_Type_Definition - "&Subtype_Mark6Private_Present+Abstract_Present" & - -- Formal_Discrete_Type_Definition - "" & - -- Formal_Floating_Point_Definition - "" & - -- Formal_Modular_Type_Definition - "" & - -- Formal_Ordinary_Fixed_Point_Definition - "" & - -- Formal_Package_Declaration - "#Defining_Identifier$Name%Generic_Associations6Box_Present'Instance_S" & - "pec9ABE_Is_Certain" & - -- Formal_Private_Type_Definition - "+Abstract_Present6Tagged_Present8Limited_Present" & - -- Formal_Signed_Integer_Type_Definition - "" & - -- Formal_Subprogram_Declaration - "#Specification$Default_Name6Box_Present" & - -- Generic_Association - "$Selector_Name#Explicit_Generic_Actual_Parameter" & - -- Handled_Sequence_Of_Statements - "%Statements&End_Label'Exception_Handlers#At_End_Proc$First_Real_State" & - "ment,Zero_Cost_Handling" & - -- Index_Or_Discriminant_Constraint - "#Constraints" & - -- Itype_Reference - "#Itype" & - -- Label - "#Identifier2Exception_Junk" & - -- Modular_Type_Definition - "%Expression" & - -- Number_Declaration - "#Defining_Identifier%Expression,More_Ids-Prev_Ids" & - -- Ordinary_Fixed_Point_Definition - "%Delta_Expression&Real_Range_Specification" & - -- Others_Choice - "#Others_Discrete_Choices2All_Others" & - -- Package_Specification - "#Defining_Unit_Name$Visible_Declarations%Private_Declarations&End_Lab" & - "el'Generic_Parent9Limited_View_Installed" & - -- Parameter_Association - "$Selector_Name%Explicit_Actual_Parameter&Next_Named_Actual" & - -- Parameter_Specification - "#Defining_Identifier6In_Present8Out_Present$Parameter_Type%Expression" & - "4Do_Accessibility_Check,More_Ids-Prev_Ids'Default_Expression" & - -- Protected_Definition - "$Visible_Declarations%Private_Declarations&End_Label-Has_Priority_Pra" & - "gma" & - -- Range_Constraint - "&Range_Expression" & - -- Real_Range_Specification - "#Low_Bound$High_Bound" & - -- Record_Definition - "&End_Label+Abstract_Present6Tagged_Present8Limited_Present#Component_" & - "List4Null_Present" & - -- Signed_Integer_Type_Definition - "#Low_Bound$High_Bound" & - -- Single_Protected_Declaration - "#Defining_Identifier%Protected_Definition" & - -- Subunit - "$Name#Proper_Body%Corresponding_Stub" & - -- Task_Definition - "$Visible_Declarations%Private_Declarations&End_Label-Has_Priority_Pra" & - "gma,Has_Storage_Size_Pragma.Has_Task_Info_Pragma/Has_Task_Name_Pra" & - "gma" & - -- Triggering_Alternative - "#Triggering_Statement%Statements&Pragmas_Before" & - -- Use_Type_Clause - "$Subtype_Marks%Next_Use_Clause&Hidden_By_Use_Clause" & - -- Validate_Unchecked_Conversion - "#Source_Type$Target_Type" & - -- Variant - "&Discrete_Choices#Component_List$Enclosing_Variant%Present_Expr'Dchec" & - "k_Function" & - -- Variant_Part - "$Name#Variants" & - -- With_Clause - "$Name&Library_Unit'Corresponding_Spec,First_Name-Last_Name4Context_In" & - "stalled+Elaborate_Present6Elaborate_All_Present7Implicit_With8Limi" & - "ted_Present9Limited_View_Installed.Unreferenced_In_Spec/No_Entitie" & - "s_Ref_In_Spec" & - -- With_Type_Clause - "$Name6Tagged_Present" & - -- Unused_At_End - ""; - - type Pchar_Pos_Array is array (Node_Kind) of Positive; - Pchar_Pos : constant Pchar_Pos_Array := Pchar_Pos_Array'( - N_Unused_At_Start => 1, - N_At_Clause => 1, - N_Component_Clause => 23, - N_Enumeration_Representation_Clause => 66, - N_Mod_Clause => 107, - N_Record_Representation_Clause => 133, - N_Attribute_Definition_Clause => 187, - N_Empty => 253, - N_Pragma => 253, - N_Pragma_Argument_Association => 312, - N_Error => 323, - N_Defining_Character_Literal => 323, - N_Defining_Identifier => 341, - N_Defining_Operator_Symbol => 359, - N_Expanded_Name => 377, - N_Identifier => 452, - N_Operator_Symbol => 528, - N_Character_Literal => 575, - N_Op_Add => 634, - N_Op_Concat => 634, - N_Op_Expon => 681, - N_Op_Subtract => 705, - N_Op_Divide => 705, - N_Op_Mod => 761, - N_Op_Multiply => 802, - N_Op_Rem => 840, - N_Op_And => 881, - N_Op_Eq => 897, - N_Op_Ge => 897, - N_Op_Gt => 897, - N_Op_Le => 897, - N_Op_Lt => 897, - N_Op_Ne => 897, - N_Op_Or => 897, - N_Op_Xor => 913, - N_Op_Rotate_Left => 929, - N_Op_Rotate_Right => 944, - N_Op_Shift_Left => 959, - N_Op_Shift_Right => 974, - N_Op_Shift_Right_Arithmetic => 989, - N_Op_Abs => 1004, - N_Op_Minus => 1004, - N_Op_Not => 1004, - N_Op_Plus => 1004, - N_Attribute_Reference => 1004, - N_And_Then => 1128, - N_Conditional_Expression => 1136, - N_Explicit_Dereference => 1174, - N_Function_Call => 1181, - N_In => 1302, - N_Indexed_Component => 1302, - N_Integer_Literal => 1321, - N_Not_In => 1357, - N_Null => 1357, - N_Or_Else => 1357, - N_Procedure_Call_Statement => 1365, - N_Qualified_Expression => 1486, - N_Raise_Constraint_Error => 1510, - N_Raise_Program_Error => 1527, - N_Raise_Storage_Error => 1544, - N_Aggregate => 1561, - N_Allocator => 1717, - N_Extension_Aggregate => 1794, - N_Range => 1897, - N_Real_Literal => 1938, - N_Reference => 2008, - N_Selected_Component => 2015, - N_Slice => 2099, - N_String_Literal => 2121, - N_Subprogram_Info => 2147, - N_Type_Conversion => 2158, - N_Unchecked_Expression => 2273, - N_Unchecked_Type_Conversion => 2284, - N_Subtype_Indication => 2339, - N_Component_Declaration => 2379, - N_Entry_Declaration => 2463, - N_Formal_Object_Declaration => 2555, - N_Formal_Type_Declaration => 2640, - N_Full_Type_Declaration => 2741, - N_Incomplete_Type_Declaration => 2829, - N_Loop_Parameter_Specification => 2907, - N_Object_Declaration => 2971, - N_Protected_Type_Declaration => 3218, - N_Private_Extension_Declaration => 3306, - N_Private_Type_Declaration => 3420, - N_Subtype_Declaration => 3546, - N_Function_Specification => 3620, - N_Procedure_Specification => 3712, - N_Entry_Index_Specification => 3791, - N_Freeze_Entity => 3839, - N_Access_Function_Definition => 3907, - N_Access_Procedure_Definition => 3963, - N_Task_Type_Declaration => 4006, - N_Package_Body_Stub => 4109, - N_Protected_Body_Stub => 4161, - N_Subprogram_Body_Stub => 4213, - N_Task_Body_Stub => 4259, - N_Function_Instantiation => 4311, - N_Package_Instantiation => 4397, - N_Procedure_Instantiation => 4483, - N_Package_Body => 4569, - N_Subprogram_Body => 4667, - N_Protected_Body => 4894, - N_Task_Body => 4976, - N_Implicit_Label_Declaration => 5114, - N_Package_Declaration => 5150, - N_Single_Task_Declaration => 5219, - N_Subprogram_Declaration => 5255, - N_Use_Package_Clause => 5315, - N_Generic_Package_Declaration => 5358, - N_Generic_Subprogram_Declaration => 5455, - N_Constrained_Array_Definition => 5528, - N_Unconstrained_Array_Definition => 5592, - N_Exception_Renaming_Declaration => 5641, - N_Object_Renaming_Declaration => 5666, - N_Package_Renaming_Declaration => 5738, - N_Subprogram_Renaming_Declaration => 5774, - N_Generic_Function_Renaming_Declaration => 5824, - N_Generic_Package_Renaming_Declaration => 5860, - N_Generic_Procedure_Renaming_Declaration => 5896, - N_Abort_Statement => 5932, - N_Accept_Statement => 5938, - N_Assignment_Statement => 6033, - N_Asynchronous_Select => 6119, - N_Block_Statement => 6157, - N_Case_Statement => 6322, - N_Code_Statement => 6355, - N_Conditional_Entry_Call => 6366, - N_Delay_Relative_Statement => 6405, - N_Delay_Until_Statement => 6416, - N_Entry_Call_Statement => 6427, - N_Free_Statement => 6474, - N_Goto_Statement => 6516, - N_Loop_Statement => 6536, - N_Null_Statement => 6621, - N_Raise_Statement => 6621, - N_Requeue_Statement => 6626, - N_Return_Statement => 6645, - N_Selective_Accept => 6719, - N_Timed_Entry_Call => 6755, - N_Exit_Statement => 6796, - N_If_Statement => 6811, - N_Accept_Alternative => 6874, - N_Delay_Alternative => 6950, - N_Elsif_Part => 7002, - N_Entry_Body_Formal_Part => 7046, - N_Iteration_Scheme => 7107, - N_Terminate_Alternative => 7164, - N_Abortable_Part => 7203, - N_Abstract_Subprogram_Declaration => 7214, - N_Access_Definition => 7228, - N_Access_To_Object_Definition => 7241, - N_Case_Statement_Alternative => 7289, - N_Compilation_Unit => 7317, - N_Compilation_Unit_Aux => 7456, - N_Component_Association => 7506, - N_Component_List => 7538, - N_Derived_Type_Definition => 7580, - N_Decimal_Fixed_Point_Definition => 7638, - N_Defining_Program_Unit_Name => 7698, - N_Delta_Constraint => 7723, - N_Designator => 7757, - N_Digits_Constraint => 7773, - N_Discriminant_Association => 7808, - N_Discriminant_Specification => 7834, - N_Enumeration_Type_Definition => 7901, - N_Entry_Body => 7920, - N_Entry_Call_Alternative => 8027, - N_Exception_Declaration => 8074, - N_Exception_Handler => 8123, - N_Floating_Point_Definition => 8188, - N_Formal_Decimal_Fixed_Point_Definition => 8231, - N_Formal_Derived_Type_Definition => 8231, - N_Formal_Discrete_Type_Definition => 8277, - N_Formal_Floating_Point_Definition => 8277, - N_Formal_Modular_Type_Definition => 8277, - N_Formal_Ordinary_Fixed_Point_Definition => 8277, - N_Formal_Package_Declaration => 8277, - N_Formal_Private_Type_Definition => 8364, - N_Formal_Signed_Integer_Type_Definition => 8412, - N_Formal_Subprogram_Declaration => 8412, - N_Generic_Association => 8451, - N_Handled_Sequence_Of_Statements => 8499, - N_Index_Or_Discriminant_Constraint => 8591, - N_Itype_Reference => 8603, - N_Label => 8609, - N_Modular_Type_Definition => 8635, - N_Number_Declaration => 8646, - N_Ordinary_Fixed_Point_Definition => 8695, - N_Others_Choice => 8737, - N_Package_Specification => 8772, - N_Parameter_Association => 8881, - N_Parameter_Specification => 8939, - N_Protected_Definition => 9068, - N_Range_Constraint => 9140, - N_Real_Range_Specification => 9157, - N_Record_Definition => 9178, - N_Signed_Integer_Type_Definition => 9264, - N_Single_Protected_Declaration => 9285, - N_Subunit => 9326, - N_Task_Definition => 9362, - N_Triggering_Alternative => 9500, - N_Use_Type_Clause => 9547, - N_Validate_Unchecked_Conversion => 9598, - N_Variant => 9622, - N_Variant_Part => 9701, - N_With_Clause => 9715, - N_With_Type_Clause => 9929, - N_Unused_At_End => 9949); - -end Treeprs; diff --git a/gcc/calls.c b/gcc/calls.c index 18df59a92c2..646a5d7910e 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -133,7 +133,8 @@ static int compute_argument_block_size (int, struct args_size *, int); static void initialize_argument_information (int, struct arg_data *, struct args_size *, int, tree, tree, CUMULATIVE_ARGS *, int, - rtx *, int *, int *, int *); + rtx *, int *, int *, int *, + bool); static void compute_argument_addresses (struct arg_data *, rtx, int); static rtx rtx_for_function_call (tree, tree); static void load_register_parameters (struct arg_data *, int, rtx *, int, @@ -1000,7 +1001,10 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals) and may be modified by this routine. OLD_PENDING_ADJ, MUST_PREALLOCATE and FLAGS are pointers to integer - flags which may may be modified by this routine. */ + flags which may may be modified by this routine. + + CALL_FROM_THUNK_P is true if this call is the jump from a thunk to + the thunked-to function. */ static void initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, @@ -1011,7 +1015,8 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, CUMULATIVE_ARGS *args_so_far, int reg_parm_stack_space, rtx *old_stack_level, int *old_pending_adj, - int *must_preallocate, int *ecf_flags) + int *must_preallocate, int *ecf_flags, + bool call_from_thunk_p) { /* 1 if scanning parms front to back, -1 if scanning back to front. */ int inc; @@ -1084,7 +1089,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, { /* If we're compiling a thunk, pass through invisible references instead of making a copy. */ - if (current_function_is_thunk + if (call_from_thunk_p #ifdef FUNCTION_ARG_CALLEE_COPIES || (FUNCTION_ARG_CALLEE_COPIES (*args_so_far, TYPE_MODE (type), type, argpos < n_named_args) @@ -2394,7 +2399,8 @@ expand_call (tree exp, rtx target, int ignore) n_named_args, actparms, fndecl, &args_so_far, reg_parm_stack_space, &old_stack_level, &old_pending_adj, - &must_preallocate, &flags); + &must_preallocate, &flags, + CALL_FROM_THUNK_P (exp)); if (args_size.var) { diff --git a/gcc/collect2.c b/gcc/collect2.c index 2d49cce3ffe..b60bbfa1831 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -30,23 +30,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "system.h" #include "coretypes.h" #include "tm.h" -#include <signal.h> -#if ! defined( SIGCHLD ) && defined( SIGCLD ) -# define SIGCHLD SIGCLD -#endif - -#ifdef vfork /* Autoconf may define this to fork for us. */ -# define VFORK_STRING "fork" +#ifdef _WIN32 +# define WIN32_LEAN_AND_MEAN +# include <windows.h> #else -# define VFORK_STRING "vfork" -#endif -#ifdef HAVE_VFORK_H -#include <vfork.h> -#endif -#ifdef VMS -#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \ - lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1) -#endif /* VMS */ +# include <signal.h> +# if ! defined( SIGCHLD ) && defined( SIGCLD ) +# define SIGCHLD SIGCLD +# endif +#endif #ifndef LIBRARY_PATH_ENV #define LIBRARY_PATH_ENV "LIBRARY_PATH" @@ -249,7 +241,17 @@ static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs, static const char *const libexts[3] = {"a", "so", NULL}; /* possible library extensions */ #endif -static void handler (int); +static void clean_up_temp_files (void); +#ifdef _WIN32 +static BOOL WINAPI handler (DWORD); +static LONG unhanded_filter (LPEXCEPTION_POINTERS); +#else +static void handler (int); +#endif +static void install_handlers (void); +static void disable_break (void); +static void enable_break (void); + static int is_ctor_dtor (const char *); static char *find_a_file (struct path_prefix *, const char *); static void add_prefix (struct path_prefix *, const char *); @@ -290,26 +292,6 @@ static char *resolve_lib_name (const char *); #endif static char *extract_string (const char **); -#ifndef HAVE_DUP2 -static int -dup2 (int oldfd, int newfd) -{ - int fdtmp[256]; - int fdx = 0; - int fd; - - if (oldfd == newfd) - return oldfd; - close (newfd); - while ((fd = dup (oldfd)) != newfd && fd >= 0) /* good enough for low fd's */ - fdtmp[fdx++] = fd; - while (fdx > 0) - close (fdtmp[--fdx]); - - return fd; -} -#endif /* ! HAVE_DUP2 */ - /* Delete tempfiles and exit function. */ void @@ -407,7 +389,7 @@ fancy_abort (void) } static void -handler (int signo) +clean_up_temp_files (void) { if (c_file != 0 && c_file[0]) maybe_unlink (c_file); @@ -422,11 +404,117 @@ handler (int signo) if (export_file != 0 && export_file[0]) maybe_unlink (export_file); #endif +} + +/* Signal handling needs to be drastically different between Windows + and Unix. */ +#ifdef _WIN32 + +static BOOL WINAPI +handler (DWORD signo ATTRIBUTE_UNUSED) +{ + clean_up_temp_files (); + return FALSE; /* not handled - default handler will terminate process */ +} + +static LONG +unhandled_filter (LPEXCEPTION_POINTERS pointers ATTRIBUTE_UNUSED) +{ + clean_up_temp_files (); + return EXCEPTION_CONTINUE_SEARCH; /* carry on and terminate process */ +} + + +static void +install_handlers (void) +{ + SetConsoleCtrlHandler (handler, TRUE); + /* This is not really the right way to do this; in fact I'm not + sure it will work. But it might. */ + SetUnhandledExceptionFilter (unhandled_filter); +} + +static void +disable_break (void) +{ + /* This only works on Windows NT, and only disables CTRL-C; + CTRL-BREAK is not disabled (but does get caught by the handler). */ + if (!(GetVersion() & 0x80000000)) + SetConsoleCtrlHandler (NULL, TRUE); +} +static void +enable_break (void) +{ + if (!(GetVersion() & 0x80000000)) + SetConsoleCtrlHandler (NULL, FALSE); +} + +#else /* not _WIN32 */ + +static void +handler (int signo) +{ + clean_up_temp_files (); signal (signo, SIG_DFL); kill (getpid (), signo); } +static void +install_handlers () +{ +#ifdef SIGQUIT + if (signal (SIGQUIT, SIG_IGN) != SIG_IGN) + signal (SIGQUIT, handler); +#endif + if (signal (SIGINT, SIG_IGN) != SIG_IGN) + signal (SIGINT, handler); +#ifdef SIGALRM + if (signal (SIGALRM, SIG_IGN) != SIG_IGN) + signal (SIGALRM, handler); +#endif +#ifdef SIGHUP + if (signal (SIGHUP, SIG_IGN) != SIG_IGN) + signal (SIGHUP, handler); +#endif + if (signal (SIGSEGV, SIG_IGN) != SIG_IGN) + signal (SIGSEGV, handler); +#ifdef SIGBUS + if (signal (SIGBUS, SIG_IGN) != SIG_IGN) + signal (SIGBUS, handler); +#endif +#ifdef SIGCHLD + /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will + receive the signal. A different setting is inheritable */ + signal (SIGCHLD, SIG_DFL); +#endif +} + +static void (*int_handler) PARAMS ((int)); +#ifdef SIGQUIT +static void (*quit_handler) PARAMS ((int)); +#endif + +static void +disable_break () +{ + int_handler = (void (*) PARAMS ((int))) signal (SIGINT, SIG_IGN); +#ifdef SIGQUIT + quit_handler = (void (*) PARAMS ((int))) signal (SIGQUIT, SIG_IGN); +#endif +} + +static void +enable_break () +{ + signal (SIGINT, int_handler); +#ifdef SIGQUIT + signal (SIGQUIT, quit_handler); +#endif +} + +#endif /* not _WIN32 */ + int file_exists (const char *name) @@ -821,6 +909,8 @@ main (int argc, char **argv) int first_file; int num_c_args = argc+9; + pexec_set_program_name (argv[0]); + no_demangle = !! getenv ("COLLECT_NO_DEMANGLE"); /* Suppress demangling by the real linker, which may be broken. */ @@ -831,12 +921,6 @@ main (int argc, char **argv) COLLECT2_HOST_INITIALIZATION; #endif -#ifdef SIGCHLD - /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will - receive the signal. A different setting is inheritable */ - signal (SIGCHLD, SIG_DFL); -#endif - gcc_init_libintl (); /* Do not invoke xcalloc before this point, since locale needs to be @@ -892,26 +976,7 @@ main (int argc, char **argv) if (argc < 2) fatal ("no arguments"); -#ifdef SIGQUIT - if (signal (SIGQUIT, SIG_IGN) != SIG_IGN) - signal (SIGQUIT, handler); -#endif - if (signal (SIGINT, SIG_IGN) != SIG_IGN) - signal (SIGINT, handler); -#ifdef SIGALRM - if (signal (SIGALRM, SIG_IGN) != SIG_IGN) - signal (SIGALRM, handler); -#endif -#ifdef SIGHUP - if (signal (SIGHUP, SIG_IGN) != SIG_IGN) - signal (SIGHUP, handler); -#endif - if (signal (SIGSEGV, SIG_IGN) != SIG_IGN) - signal (SIGSEGV, handler); -#ifdef SIGBUS - if (signal (SIGBUS, SIG_IGN) != SIG_IGN) - signal (SIGBUS, handler); -#endif + install_handlers (); /* Extract COMPILER_PATH and PATH into our prefix list. */ prefix_from_env ("COMPILER_PATH", &cpath); @@ -1492,11 +1557,7 @@ do_wait (const char *prog) void collect_execute (const char *prog, char **argv, const char *redir) { - char *errmsg_fmt; - char *errmsg_arg; int redir_handle = -1; - int stdout_save = -1; - int stderr_save = -1; if (vflag || debug) { @@ -1514,9 +1575,6 @@ collect_execute (const char *prog, char **argv, const char *redir) fprintf (stderr, "\n"); } - fflush (stdout); - fflush (stderr); - /* If we cannot find a program we need, complain error. Do this here since we might not end up needing something that we could not find. */ @@ -1524,39 +1582,12 @@ collect_execute (const char *prog, char **argv, const char *redir) fatal ("cannot find `%s'", prog); if (redir) - { - /* Open response file. */ - redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT); - - /* Duplicate the stdout and stderr file handles - so they can be restored later. */ - stdout_save = dup (STDOUT_FILENO); - if (stdout_save == -1) - fatal_perror ("redirecting stdout: %s", redir); - stderr_save = dup (STDERR_FILENO); - if (stderr_save == -1) - fatal_perror ("redirecting stdout: %s", redir); - - /* Redirect stdout & stderr to our response file. */ - dup2 (redir_handle, STDOUT_FILENO); - dup2 (redir_handle, STDERR_FILENO); - } + redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT); - pid = pexecute (argv[0], argv, argv[0], NULL, &errmsg_fmt, &errmsg_arg, - (PEXECUTE_FIRST | PEXECUTE_LAST | PEXECUTE_SEARCH)); + pid = pexec (argv[0], argv, 1, -1, redir_handle, -1); - if (redir) - { - /* Restore stdout and stderr to their previous settings. */ - dup2 (stdout_save, STDOUT_FILENO); - dup2 (stderr_save, STDERR_FILENO); - - /* Close response file. */ - close (redir_handle); - } - - if (pid == -1) - fatal_perror (errmsg_fmt, errmsg_arg); + if (pid == -1) + fatal_perror ("pexec"); } static void @@ -1984,8 +2015,6 @@ write_aix_file (FILE *stream, struct id *list) static void scan_prog_file (const char *prog_name, enum pass which_pass) { - void (*int_handler) (int); - void (*quit_handler) (int); char *real_nm_argv[4]; const char **nm_argv = (const char **) real_nm_argv; int argc = 0; @@ -2007,7 +2036,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass) nm_argv[argc++] = prog_name; nm_argv[argc++] = (char *) 0; - if (pipe (pipe_fd) < 0) + if (pmkpipe (pipe_fd) < 0) fatal_perror ("pipe"); inf = fdopen (pipe_fd[0], "r"); @@ -2026,38 +2055,14 @@ scan_prog_file (const char *prog_name, enum pass which_pass) fprintf (stderr, "\n"); } - fflush (stdout); - fflush (stderr); - /* Spawn child nm on pipe. */ - pid = vfork (); + pid = pexec (nm_file_name, real_nm_argv, 0, -1, pipe_fd[1], -1); + if (pid == -1) - fatal_perror (VFORK_STRING); - - if (pid == 0) /* child context */ - { - /* setup stdout */ - if (dup2 (pipe_fd[1], 1) < 0) - fatal_perror ("dup2 %d 1", pipe_fd[1]); - - if (close (pipe_fd[0]) < 0) - fatal_perror ("close %d", pipe_fd[0]); - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); - - execv (nm_file_name, real_nm_argv); - fatal_perror ("execv %s", nm_file_name); - } - + fatal_perror ("pexec"); + /* Parent context from here on. */ - int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); -#ifdef SIGQUIT - quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN); -#endif - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); + disable_break (); if (debug) fprintf (stderr, "\nnm output with constructors/destructors.\n"); @@ -2136,10 +2141,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass) do_wait (nm_file_name); - signal (SIGINT, int_handler); -#ifdef SIGQUIT - signal (SIGQUIT, quit_handler); -#endif + enable_break (); } #if SUNOS4_SHARED_LIBRARIES @@ -2416,8 +2418,6 @@ scan_libraries (const char *prog_name) { static struct head libraries; /* list of shared libraries found */ struct id *list; - void (*int_handler) (int); - void (*quit_handler) (int); char *real_ldd_argv[4]; const char **ldd_argv = (const char **) real_ldd_argv; int argc = 0; @@ -2436,7 +2436,7 @@ scan_libraries (const char *prog_name) ldd_argv[argc++] = prog_name; ldd_argv[argc++] = (char *) 0; - if (pipe (pipe_fd) < 0) + if (pmkpipe (pipe_fd) < 0) fatal_perror ("pipe"); inf = fdopen (pipe_fd[0], "r"); @@ -2455,38 +2455,14 @@ scan_libraries (const char *prog_name) fprintf (stderr, "\n"); } - fflush (stdout); - fflush (stderr); - /* Spawn child ldd on pipe. */ - pid = vfork (); - if (pid == -1) - fatal_perror (VFORK_STRING); - - if (pid == 0) /* child context */ - { - /* setup stdout */ - if (dup2 (pipe_fd[1], 1) < 0) - fatal_perror ("dup2 %d 1", pipe_fd[1]); - - if (close (pipe_fd[0]) < 0) - fatal_perror ("close %d", pipe_fd[0]); - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); - - execv (ldd_file_name, real_ldd_argv); - fatal_perror ("execv %s", ldd_file_name); - } + pexecute_pid = pexec (ldd_file_name, real_ldd_argv, 0, -1, infpipe[1], -1); + + if (pexecute_pid == -1) + fatal_perror ("pexec"); /* Parent context from here on. */ - int_handler = (void (*) (int))) signal (SIGINT, SIG_IGN; -#ifdef SIGQUIT - quit_handler = (void (*) (int))) signal (SIGQUIT, SIG_IGN; -#endif - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); + disable_break (); if (debug) notice ("\nldd output with constructors/destructors.\n"); @@ -2529,11 +2505,7 @@ scan_libraries (const char *prog_name) do_wait (ldd_file_name); - signal (SIGINT, int_handler); -#ifdef SIGQUIT - signal (SIGQUIT, quit_handler); -#endif - + enable_break (); /* now iterate through the library list adding their symbols to the list. */ for (list = libraries.first; list; list = list->next) diff --git a/gcc/config.guess b/gcc/config.guess deleted file mode 100755 index fd7602dabd9..00000000000 --- a/gcc/config.guess +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Use the top-level config.guess so that we don't have two of them. -guesssys=`echo $0 | sed 's|config.guess|../config.guess|'` -exec ${guesssys} "$@" diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index b2ff003a959..fd857491a1f 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -6712,13 +6712,10 @@ alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP) unsigned long fmask = 0; unsigned int i; - /* Irritatingly, there are two kinds of thunks -- those created with - TARGET_ASM_OUTPUT_MI_THUNK and those with DECL_THUNK_P that go - through the regular part of the compiler. In the - TARGET_ASM_OUTPUT_MI_THUNK case we don't have valid register life - info, but assemble_start_function wants to output .frame and - .mask directives. */ - if (current_function_is_thunk && !no_new_pseudos) + /* When outputting a thunk, we don't have valid register life info, + but assemble_start_function wants to output .frame and .mask + directives. */ + if (current_function_is_thunk) { *imaskP = 0; *fmaskP = 0; diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def new file mode 100644 index 00000000000..5f6309fc3ba --- /dev/null +++ b/gcc/config/arm/arm-cores.def @@ -0,0 +1,86 @@ +/* ARM CPU Cores + Copyright (C) 2003 Free Software Foundation, Inc. + Written by CodeSourcery, LLC + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +/* Before using #include to read this file, define a macro: + + ARM_CORE(CORE_NAME, FLAGS) + + The CORE_NAME is the name of the core, represented as an identifier + rather than a string constant. The FLAGS are the bitwise-or of the + traits that apply to that core. + + If you update this table, you must update the "tune" attribue in + arm.md. */ + +ARM_CORE(arm2, FL_CO_PROC | FL_MODE26) +ARM_CORE(arm250, FL_CO_PROC | FL_MODE26) +ARM_CORE(arm3, FL_CO_PROC | FL_MODE26) +ARM_CORE(arm6, FL_CO_PROC | FL_MODE26 | FL_MODE32) +ARM_CORE(arm60, FL_CO_PROC | FL_MODE26 | FL_MODE32) +ARM_CORE(arm600, FL_CO_PROC | FL_MODE26 | FL_MODE32) +ARM_CORE(arm610, FL_MODE26 | FL_MODE32) +ARM_CORE(arm620, FL_CO_PROC | FL_MODE26 | FL_MODE32) +ARM_CORE(arm7, FL_CO_PROC | FL_MODE26 | FL_MODE32) +/* arm7m doesn't exist on its own, but only with D, (and I), but + those don't alter the code, so arm7m is sometimes used. */ +ARM_CORE(arm7m, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT) +ARM_CORE(arm7d, FL_CO_PROC | FL_MODE26 | FL_MODE32) +ARM_CORE(arm7dm, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT) +ARM_CORE(arm7di, FL_CO_PROC | FL_MODE26 | FL_MODE32) +ARM_CORE(arm7dmi, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT) +ARM_CORE(arm70, FL_CO_PROC | FL_MODE26 | FL_MODE32) +ARM_CORE(arm700, FL_CO_PROC | FL_MODE26 | FL_MODE32) +ARM_CORE(arm700i, FL_CO_PROC | FL_MODE26 | FL_MODE32) +ARM_CORE(arm710, FL_MODE26 | FL_MODE32) +ARM_CORE(arm720, FL_MODE26 | FL_MODE32) +ARM_CORE(arm710c, FL_MODE26 | FL_MODE32) +ARM_CORE(arm7100, FL_MODE26 | FL_MODE32) +ARM_CORE(arm7500, FL_MODE26 | FL_MODE32) +/* Doesn't have an external co-proc, but does have embedded fpa. */ +ARM_CORE(arm7500fe, FL_CO_PROC | FL_MODE26 | FL_MODE32) +/* V4 Architecture Processors */ +ARM_CORE(arm7tdmi, FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB) +ARM_CORE(arm710t, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB) +ARM_CORE(arm720t, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB) +ARM_CORE(arm740t, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB) +ARM_CORE(arm8, FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED) +ARM_CORE(arm810, FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED) +ARM_CORE(arm9, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED) +ARM_CORE(arm920, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED) +ARM_CORE(arm920t, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED) +ARM_CORE(arm940t, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED) +ARM_CORE(arm9tdmi, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED) +ARM_CORE(arm9e, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED) +ARM_CORE(ep9312, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS) +ARM_CORE(strongarm, FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG) +ARM_CORE(strongarm110, FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG) +ARM_CORE(strongarm1100, FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG) +ARM_CORE(strongarm1110, FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG) +/* V5 Architecture Processors */ +ARM_CORE(arm10tdmi, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5) +ARM_CORE(arm1020t, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5) +ARM_CORE(arm926ejs, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E) +ARM_CORE(arm1026ejs, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E) +ARM_CORE(xscale, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE) +ARM_CORE(iwmmxt, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT) +/* V6 Architecture Processors */ +ARM_CORE(arm1136js, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J) +ARM_CORE(arm1136jfs, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J | FL_VFPV2) diff --git a/gcc/config/arm/arm-generic.md b/gcc/config/arm/arm-generic.md new file mode 100644 index 00000000000..ec2df47b465 --- /dev/null +++ b/gcc/config/arm/arm-generic.md @@ -0,0 +1,152 @@ +;; Generic ARM Pipeline Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GCC; see the file COPYING. If not, write to the Free +;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. */ + +(define_automaton "arm") + +;; Write buffer +; +; Strictly, we should model a 4-deep write buffer for ARM7xx based chips +; +; The write buffer on some of the arm6 processors is hard to model exactly. +; There is room in the buffer for up to two addresses and up to eight words +; of memory, but the two needn't be split evenly. When writing the two +; addresses are fully pipelined. However, a read from memory that is not +; currently in the cache will block until the writes have completed. +; It is normally the case that FCLK and MCLK will be in the ratio 2:1, so +; writes will take 2 FCLK cycles per word, if FCLK and MCLK are asynchronous +; (they aren't allowed to be at present) then there is a startup cost of 1MCLK +; cycle to add as well. +(define_cpu_unit "write_buf" "arm") + +;; Write blockage unit +; +; The write_blockage unit models (partially), the fact that reads will stall +; until the write buffer empties. +; The f_mem_r and r_mem_f could also block, but they are to the stack, +; so we don't model them here +(define_cpu_unit "write_blockage" "arm") + +;; Core +; +(define_cpu_unit "core" "arm") + +(define_insn_reservation "r_mem_f_wbuf" 5 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "r_mem_f"))) + "core+write_buf*3") + +(define_insn_reservation "store_wbuf" 5 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store1"))) + "core+write_buf*3+write_blockage*5") + +(define_insn_reservation "store2_wbuf" 7 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store2"))) + "core+write_buf*4+write_blockage*7") + +(define_insn_reservation "store3_wbuf" 9 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store3"))) + "core+write_buf*5+write_blockage*9") + +(define_insn_reservation "store4_wbuf" 11 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "yes") + (eq_attr "type" "store4"))) + "core+write_buf*6+write_blockage*11") + +(define_insn_reservation "store2" 3 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "no") + (eq_attr "type" "store2"))) + "core*3") + +(define_insn_reservation "store3" 4 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "no") + (eq_attr "type" "store3"))) + "core*4") + +(define_insn_reservation "store4" 5 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "model_wbuf" "no") + (eq_attr "type" "store4"))) + "core*5") + +(define_insn_reservation "store_ldsched" 1 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (eq_attr "type" "store1"))) + "core") + +(define_insn_reservation "load_ldsched_xscale" 3 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "type" "load_byte,load1") + (eq_attr "is_xscale" "yes")))) + "core") + +(define_insn_reservation "load_ldsched" 2 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "type" "load_byte,load1") + (eq_attr "is_xscale" "no")))) + "core") + +(define_insn_reservation "load_or_store" 2 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "!yes") + (eq_attr "type" "load_byte,load1,load2,load3,load4,store1"))) + "core*2") + +(define_insn_reservation "mult" 16 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "no") (eq_attr "type" "mult"))) + "core*16") + +(define_insn_reservation "mult_ldsched_strongarm" 3 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "is_strongarm" "yes") + (eq_attr "type" "mult")))) + "core*2") + +(define_insn_reservation "mult_ldsched" 4 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "ldsched" "yes") + (and (eq_attr "is_strongarm" "no") + (eq_attr "type" "mult")))) + "core*4") + +(define_insn_reservation "multi_cycle" 32 + (and (eq_attr "generic_sched" "yes") + (and (eq_attr "core_cycles" "multi") + (eq_attr "type" "!mult,load_byte,load1,load2,load3,load4,store1,store2,store3,store4"))) + "core*32") + +(define_insn_reservation "single_cycle" 1 + (and (eq_attr "generic_sched" "yes") + (eq_attr "core_cycles" "single")) + "core") diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 61c28be8629..232bde0d85c 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -95,6 +95,10 @@ extern int cirrus_general_operand (rtx, enum machine_mode); extern int cirrus_register_operand (rtx, enum machine_mode); extern int cirrus_shift_const (rtx, enum machine_mode); extern int cirrus_memory_offset (rtx); +extern int arm_no_early_store_addr_dep (rtx, rtx); +extern int arm_no_early_alu_shift_dep (rtx, rtx); +extern int arm_no_early_alu_shift_value_dep (rtx, rtx); +extern int arm_no_early_mul_dep (rtx, rtx); extern int symbol_mentioned_p (rtx); extern int label_mentioned_p (rtx); diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index f127b1d2904..147fb4a920a 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -251,17 +251,32 @@ int making_const_table; stored from the compare operation. */ rtx arm_compare_op0, arm_compare_op1; -/* What type of floating point are we tuning for? */ -enum fputype arm_fpu_tune; +/* The processor for which instructions should be scheduled. */ +enum processor_type arm_tune = arm_none; + +/* Which floating point model to use. */ +enum arm_fp_model arm_fp_model; -/* What type of floating point instructions are available? */ +/* Which floating point hardware is available. */ enum fputype arm_fpu_arch; +/* Which floating point hardware to schedule for. */ +enum fputype arm_fpu_tune; + +/* Whether to use floating point hardware. */ +enum float_abi_type arm_float_abi; + /* What program mode is the cpu running in? 26-bit mode or 32-bit mode. */ enum prog_mode_type arm_prgmode; -/* Set by the -mfp=... option. */ -const char * target_fp_name = NULL; +/* Set by the -mfpu=... option. */ +const char * target_fpu_name = NULL; + +/* Set by the -mfpe=... option. */ +const char * target_fpe_name = NULL; + +/* Set by the -mfloat-abi=... option. */ +const char * target_float_abi_name = NULL; /* Used to parse -mstructure_size_boundary command line option. */ const char * structure_size_string = NULL; @@ -328,9 +343,6 @@ int arm_tune_xscale = 0; /* Nonzero if this chip is an ARM6 or an ARM7. */ int arm_is_6_or_7 = 0; -/* Nonzero if this chip is a Cirrus/DSP. */ -int arm_is_cirrus = 0; - /* Nonzero if generating Thumb instructions. */ int thumb_code = 0; @@ -374,6 +386,7 @@ static const char * const arm_condition_codes[] = struct processors { const char *const name; + enum processor_type core; const unsigned long flags; }; @@ -382,83 +395,32 @@ struct processors static const struct processors all_cores[] = { /* ARM Cores */ - - {"arm2", FL_CO_PROC | FL_MODE26 }, - {"arm250", FL_CO_PROC | FL_MODE26 }, - {"arm3", FL_CO_PROC | FL_MODE26 }, - {"arm6", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm60", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm600", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm610", FL_MODE26 | FL_MODE32 }, - {"arm620", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm7", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - /* arm7m doesn't exist on its own, but only with D, (and I), but - those don't alter the code, so arm7m is sometimes used. */ - {"arm7m", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - {"arm7d", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm7dm", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - {"arm7di", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm7dmi", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - {"arm70", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm700", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm700i", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - {"arm710", FL_MODE26 | FL_MODE32 }, - {"arm720", FL_MODE26 | FL_MODE32 }, - {"arm710c", FL_MODE26 | FL_MODE32 }, - {"arm7100", FL_MODE26 | FL_MODE32 }, - {"arm7500", FL_MODE26 | FL_MODE32 }, - /* Doesn't have an external co-proc, but does have embedded fpa. */ - {"arm7500fe", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - /* V4 Architecture Processors */ - {"arm7tdmi", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm710t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm720t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm740t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - {"arm8", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"arm810", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"arm9", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm920", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"arm920t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm940t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm9tdmi", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED }, - {"arm9e", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED }, - {"ep9312", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS }, - {"strongarm", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - {"strongarm110", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - {"strongarm1100", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - {"strongarm1110", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG }, - /* V5 Architecture Processors */ - {"arm10tdmi", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 }, - {"arm1020t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 }, - {"arm926ejs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, - {"arm1026ejs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, - {"xscale", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE }, - {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT }, - /* V6 Architecture Processors */ - {"arm1136js", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J }, - {"arm1136jfs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J | FL_VFPV2 }, - {NULL, 0} +#define ARM_CORE(NAME, FLAGS) \ + {#NAME, arm_none, FLAGS}, +#include "arm-cores.def" +#undef ARM_CORE + {NULL, arm_none, 0} }; static const struct processors all_architectures[] = { /* ARM Architectures */ - { "armv2", FL_CO_PROC | FL_MODE26 }, - { "armv2a", FL_CO_PROC | FL_MODE26 }, - { "armv3", FL_CO_PROC | FL_MODE26 | FL_MODE32 }, - { "armv3m", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, - { "armv4", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 }, + { "armv2", arm2, FL_CO_PROC | FL_MODE26 }, + { "armv2a", arm2, FL_CO_PROC | FL_MODE26 }, + { "armv3", arm6, FL_CO_PROC | FL_MODE26 | FL_MODE32 }, + { "armv3m", arm7m, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT }, + { "armv4", arm7tdmi, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 }, /* Strictly, FL_MODE26 is a permitted option for v4t, but there are no implementations that support it, so we will leave it out for now. */ - { "armv4t", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, - { "armv5", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 }, - { "armv5t", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 }, - { "armv5te", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, - { "armv6j", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J }, - { "ep9312", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS }, - {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT }, - { NULL, 0 } + { "armv4t", arm7tdmi, FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB }, + { "armv5", arm10tdmi, FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 }, + { "armv5t", arm10tdmi, FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 }, + { "armv5te", arm1026ejs, FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E }, + { "armv6j", arm1136js, FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J }, + { "ep9312", ep9312, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS }, + {"iwmmxt", iwmmxt, FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT }, + { NULL, arm_none, 0 } }; /* This is a magic structure. The 'string' field is magically filled in @@ -473,6 +435,57 @@ struct arm_cpu_select arm_select[] = { NULL, "-mtune=", all_cores } }; +struct fpu_desc +{ + const char * name; + enum fputype fpu; +}; + + +/* Available values for for -mfpu=. */ + +static const struct fpu_desc all_fpus[] = +{ + {"fpa", FPUTYPE_FPA}, + {"fpe2", FPUTYPE_FPA_EMU2}, + {"fpe3", FPUTYPE_FPA_EMU2}, + {"maverick", FPUTYPE_MAVERICK}, + {"vfp", FPUTYPE_VFP} +}; + + +/* Floating point models used by the different hardware. + See fputype in arm.h. */ + +static const enum fputype fp_model_for_fpu[] = +{ + /* No FP hardware. */ + ARM_FP_MODEL_UNKNOWN, /* FPUTYPE_NONE */ + ARM_FP_MODEL_FPA, /* FPUTYPE_FPA */ + ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU2 */ + ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU3 */ + ARM_FP_MODEL_MAVERICK, /* FPUTYPE_MAVERICK */ + ARM_FP_MODEL_VFP /* FPUTYPE_VFP */ +}; + + +struct float_abi +{ + const char * name; + enum float_abi_type abi_type; +}; + + +/* Available values for -mfloat-abi=. */ + +static const struct float_abi all_float_abis[] = +{ + {"soft", ARM_FLOAT_ABI_SOFT}, + {"softfp", ARM_FLOAT_ABI_SOFTFP}, + {"hard", ARM_FLOAT_ABI_HARD} +}; + + /* Return the number of bits set in VALUE. */ static unsigned bit_count (unsigned long value) @@ -494,7 +507,7 @@ void arm_override_options (void) { unsigned i; - + /* Set up the flags based on the cpu/architecture selected by the user. */ for (i = ARRAY_SIZE (arm_select); i--;) { @@ -507,9 +520,19 @@ arm_override_options (void) for (sel = ptr->processors; sel->name != NULL; sel++) if (streq (ptr->string, sel->name)) { - if (i == 2) - tune_flags = sel->flags; - else + /* Determine the processor core for which we should + tune code-generation. */ + if (/* -mcpu= is a sensible default. */ + i == 0 + /* If -march= is used, and -mcpu= has not been used, + assume that we should tune for a representative + CPU from that architecture. */ + || i == 1 + /* -mtune= overrides -mcpu= and -march=. */ + || i == 2) + arm_tune = (enum processor_type) (sel - ptr->processors); + + if (i != 2) { /* If we have been given an architecture and a processor make sure that they are compatible. We only generate @@ -583,7 +606,7 @@ arm_override_options (void) abort (); insn_flags = sel->flags; - + /* Now check to see if the user has specified some command line switch that require certain abilities from the cpu. */ sought = 0; @@ -653,12 +676,16 @@ arm_override_options (void) insn_flags = sel->flags; } + if (arm_tune == arm_none) + arm_tune = (enum processor_type) (sel - all_cores); } - /* If tuning has not been specified, tune for whichever processor or - architecture has been selected. */ - if (tune_flags == 0) - tune_flags = insn_flags; + /* The processor for which we shoudl tune should now have been + chosen. */ + if (arm_tune == arm_none) + abort (); + + tune_flags = all_cores[(int)arm_tune].flags; /* Make sure that the processor choice does not conflict with any of the other command line choices. */ @@ -759,54 +786,94 @@ arm_override_options (void) arm_is_6_or_7 = (((tune_flags & (FL_MODE26 | FL_MODE32)) && !(tune_flags & FL_ARCH4))) != 0; arm_tune_xscale = (tune_flags & FL_XSCALE) != 0; - arm_is_cirrus = (tune_flags & FL_CIRRUS) != 0; arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0; if (TARGET_IWMMXT && (! TARGET_ATPCS)) target_flags |= ARM_FLAG_ATPCS; - if (arm_is_cirrus) + arm_fp_model = ARM_FP_MODEL_UNKNOWN; + if (target_fpu_name == NULL && target_fpe_name != NULL) { - arm_fpu_tune = FPUTYPE_MAVERICK; - - /* Ignore -mhard-float if -mcpu=ep9312. */ - if (TARGET_HARD_FLOAT) - target_flags ^= ARM_FLAG_SOFT_FLOAT; + if (streq (target_fpe_name, "2")) + target_fpu_name = "fpe2"; + else if (streq (target_fpe_name, "3")) + target_fpu_name = "fpe3"; + else + error ("invalid floating point emulation option: -mfpe=%s", + target_fpe_name); + } + if (target_fpu_name != NULL) + { + /* The user specified a FPU. */ + for (i = 0; i < ARRAY_SIZE (all_fpus); i++) + { + if (streq (all_fpus[i].name, target_fpu_name)) + { + arm_fpu_arch = all_fpus[i].fpu; + arm_fpu_tune = arm_fpu_arch; + arm_fp_model = fp_model_for_fpu[arm_fpu_arch]; + break; + } + } + if (arm_fp_model == ARM_FP_MODEL_UNKNOWN) + error ("invalid floating point option: -mfpu=%s", target_fpu_name); } else - /* Default value for floating point code... if no co-processor - bus, then schedule for emulated floating point. Otherwise, - assume the user has an FPA. - Note: this does not prevent use of floating point instructions, - -msoft-float does that. */ - arm_fpu_tune = (tune_flags & FL_CO_PROC) ? FPUTYPE_FPA : FPUTYPE_FPA_EMU3; - - if (target_fp_name) { - if (streq (target_fp_name, "2")) +#ifdef FPUTYPE_DEFAULT + /* Use the default is it is specified for this platform. */ + arm_fpu_arch = FPUTYPE_DEFAULT; + arm_fpu_tune = FPUTYPE_DEFAULT; +#else + /* Pick one based on CPU type. */ + if ((insn_flags & FL_VFP) != 0) + arm_fpu_arch = FPUTYPE_VFP; + else if (insn_flags & FL_CIRRUS) + arm_fpu_arch = FPUTYPE_MAVERICK; + else arm_fpu_arch = FPUTYPE_FPA_EMU2; - else if (streq (target_fp_name, "3")) - arm_fpu_arch = FPUTYPE_FPA_EMU3; +#endif + if (tune_flags & FL_CO_PROC && arm_fpu_arch == FPUTYPE_FPA_EMU2) + arm_fpu_tune = FPUTYPE_FPA; else - error ("invalid floating point emulation option: -mfpe-%s", - target_fp_name); + arm_fpu_tune = arm_fpu_arch; + arm_fp_model = fp_model_for_fpu[arm_fpu_arch]; + if (arm_fp_model == ARM_FP_MODEL_UNKNOWN) + abort (); + } + + if (target_float_abi_name != NULL) + { + /* The user specified a FP ABI. */ + for (i = 0; i < ARRAY_SIZE (all_float_abis); i++) + { + if (streq (all_float_abis[i].name, target_float_abi_name)) + arm_float_abi = all_float_abis[i].abi_type; + } + if (i == ARRAY_SIZE (all_float_abis)) + error ("invalud floating point abi: -ffloat-abi=%s", + target_float_abi_name); } else - arm_fpu_arch = FPUTYPE_DEFAULT; - - if (TARGET_FPE) { - if (arm_fpu_tune == FPUTYPE_FPA_EMU3) - arm_fpu_tune = FPUTYPE_FPA_EMU2; - else if (arm_fpu_tune == FPUTYPE_MAVERICK) - warning ("-mfpe switch not supported by ep9312 target cpu - ignored."); - else if (arm_fpu_tune != FPUTYPE_FPA) - arm_fpu_tune = FPUTYPE_FPA_EMU2; + /* Use soft-float target flag. */ + if (target_flags & ARM_FLAG_SOFT_FLOAT) + arm_float_abi = ARM_FLOAT_ABI_SOFT; + else + arm_float_abi = ARM_FLOAT_ABI_HARD; } + + if (arm_float_abi == ARM_FLOAT_ABI_SOFTFP) + sorry ("-mfloat-abi=softfp"); + /* If soft-float is specified then don't use FPU. */ + if (TARGET_SOFT_FLOAT) + arm_fpu_arch = FPUTYPE_NONE; /* For arm2/3 there is no need to do any scheduling if there is only a floating point emulator, or we are doing software floating-point. */ - if ((TARGET_SOFT_FLOAT || arm_fpu_tune != FPUTYPE_FPA) + if ((TARGET_SOFT_FLOAT + || arm_fpu_tune == FPUTYPE_FPA_EMU2 + || arm_fpu_tune == FPUTYPE_FPA_EMU3) && (tune_flags & FL_MODE32) == 0) flag_schedule_insns = flag_schedule_insns_after_reload = 0; @@ -1067,8 +1134,8 @@ use_return_insn (int iscond) /* Can't be done if any of the FPA regs are pushed, since this also requires an insn. */ - if (TARGET_HARD_FLOAT) - for (regno = FIRST_ARM_FP_REGNUM; regno <= LAST_ARM_FP_REGNUM; regno++) + if (TARGET_HARD_FLOAT && TARGET_FPA) + for (regno = FIRST_FPA_REGNUM; regno <= LAST_FPA_REGNUM; regno++) if (regs_ever_live[regno] && !call_used_regs[regno]) return 0; @@ -1972,15 +2039,14 @@ arm_return_in_memory (tree type) int arm_float_words_big_endian (void) { - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) return 0; /* For FPA, float words are always big-endian. For VFP, floats words follow the memory system mode. */ - if (TARGET_HARD_FLOAT) + if (TARGET_FPA) { - /* FIXME: TARGET_HARD_FLOAT currently implies FPA. */ return 1; } @@ -2769,12 +2835,12 @@ arm_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p) HOST_WIDE_INT range; enum rtx_code code = GET_CODE (index); - if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) + if (TARGET_HARD_FLOAT && TARGET_FPA && GET_MODE_CLASS (mode) == MODE_FLOAT) return (code == CONST_INT && INTVAL (index) < 1024 && INTVAL (index) > -1024 && (INTVAL (index) & 3) == 0); - if (TARGET_CIRRUS + if (TARGET_HARD_FLOAT && TARGET_MAVERICK && (GET_MODE_CLASS (mode) == MODE_FLOAT || mode == DImode)) return (code == CONST_INT && INTVAL (index) < 255 @@ -3523,7 +3589,8 @@ arm_adjust_cost (rtx insn, rtx link, rtx dep, int cost) operand for INSN. If we have a shifted input operand and the instruction we depend on is another ALU instruction, then we may have to account for an additional stall. */ - if (shift_opnum != 0 && attr_type == TYPE_NORMAL) + if (shift_opnum != 0 + && (attr_type == TYPE_ALU_SHIFT || attr_type == TYPE_ALU_SHIFT_REG)) { rtx shifted_operand; int opno; @@ -4200,7 +4267,7 @@ nonimmediate_di_operand (rtx op, enum machine_mode mode) return FALSE; } -/* Return TRUE for a valid operand of a DFmode operation when -msoft-float. +/* Return TRUE for a valid operand of a DFmode operation when soft-float. Either: REG, SUBREG, CONST_DOUBLE or MEM(DImode_address). Note that this disallows MEM(REG+REG), but allows MEM(PRE/POST_INC/DEC(REG)). */ @@ -5549,7 +5616,7 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y) case LE: case GT: case GE: - if (TARGET_CIRRUS) + if (TARGET_HARD_FLOAT && TARGET_MAVERICK) return CCFPmode; return CCFPEmode; @@ -8462,7 +8529,7 @@ arm_output_epilogue (int really_return) if (arm_fpu_arch == FPUTYPE_FPA_EMU2) { - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) if (regs_ever_live[reg] && !call_used_regs[reg]) { floats_offset += 12; @@ -8472,9 +8539,9 @@ arm_output_epilogue (int really_return) } else { - int start_reg = LAST_ARM_FP_REGNUM; + int start_reg = LAST_FPA_REGNUM; - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) { if (regs_ever_live[reg] && !call_used_regs[reg]) { @@ -8575,16 +8642,16 @@ arm_output_epilogue (int really_return) if (arm_fpu_arch == FPUTYPE_FPA_EMU2) { - for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++) + for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++) if (regs_ever_live[reg] && !call_used_regs[reg]) asm_fprintf (f, "\tldfe\t%r, [%r], #12\n", reg, SP_REGNUM); } else { - int start_reg = FIRST_ARM_FP_REGNUM; + int start_reg = FIRST_FPA_REGNUM; - for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++) + for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++) { if (regs_ever_live[reg] && !call_used_regs[reg]) { @@ -8995,7 +9062,7 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) /* If the hard floating point registers are going to be used then they must be saved on the stack as well. Each register occupies 12 bytes of stack space. */ - for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++) + for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++) if (regs_ever_live[reg] && ! call_used_regs[reg]) call_saved_registers += 12; @@ -9140,7 +9207,7 @@ arm_get_frame_size (void) /* Space for saved FPA registers. */ if (! IS_VOLATILE (func_type)) { - for (regno = FIRST_ARM_FP_REGNUM; regno <= LAST_ARM_FP_REGNUM; regno++) + for (regno = FIRST_FPA_REGNUM; regno <= LAST_FPA_REGNUM; regno++) if (regs_ever_live[regno] && ! call_used_regs[regno]) entry_size += 12; } @@ -9341,7 +9408,7 @@ arm_expand_prologue (void) function. */ if (arm_fpu_arch == FPUTYPE_FPA_EMU2) { - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) if (regs_ever_live[reg] && !call_used_regs[reg]) { insn = gen_rtx_PRE_DEC (XFmode, stack_pointer_rtx); @@ -9353,9 +9420,9 @@ arm_expand_prologue (void) } else { - int start_reg = LAST_ARM_FP_REGNUM; + int start_reg = LAST_FPA_REGNUM; - for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--) + for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--) { if (regs_ever_live[reg] && !call_used_regs[reg]) { @@ -10333,8 +10400,8 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) /* The only registers left are the FPA registers which we only allow to hold FP values. */ return GET_MODE_CLASS (mode) == MODE_FLOAT - && regno >= FIRST_ARM_FP_REGNUM - && regno <= LAST_ARM_FP_REGNUM; + && regno >= FIRST_FPA_REGNUM + && regno <= LAST_FPA_REGNUM; } int @@ -10557,13 +10624,13 @@ static const struct builtin_description bdesc_2arg[] = IWMMXT_BUILTIN2 (lshrv2si3_di, WSRLW) IWMMXT_BUILTIN2 (lshrv2si3, WSRLWI) IWMMXT_BUILTIN2 (lshrdi3_di, WSRLD) - IWMMXT_BUILTIN2 (lshrdi3, WSRLDI) + IWMMXT_BUILTIN2 (lshrdi3_iwmmxt, WSRLDI) IWMMXT_BUILTIN2 (ashrv4hi3_di, WSRAH) IWMMXT_BUILTIN2 (ashrv4hi3, WSRAHI) IWMMXT_BUILTIN2 (ashrv2si3_di, WSRAW) IWMMXT_BUILTIN2 (ashrv2si3, WSRAWI) IWMMXT_BUILTIN2 (ashrdi3_di, WSRAD) - IWMMXT_BUILTIN2 (ashrdi3, WSRADI) + IWMMXT_BUILTIN2 (ashrdi3_iwmmxt, WSRADI) IWMMXT_BUILTIN2 (rorv4hi3_di, WRORH) IWMMXT_BUILTIN2 (rorv4hi3, WRORHI) IWMMXT_BUILTIN2 (rorv2si3_di, WRORW) @@ -13044,6 +13111,8 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED, tree function) { + static int thunk_label = 0; + char label[256]; int mi_delta = delta; const char *const mi_op = mi_delta < 0 ? "sub" : "add"; int shift = 0; @@ -13051,6 +13120,14 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, ? 1 : 0); if (mi_delta < 0) mi_delta = - mi_delta; + if (TARGET_THUMB) + { + int labelno = thunk_label++; + ASM_GENERATE_INTERNAL_LABEL (label, "LTHUMBFUNC", labelno); + fputs ("\tldr\tr12, ", file); + assemble_name (file, label); + fputc ('\n', file); + } while (mi_delta != 0) { if ((mi_delta & (3 << shift)) == 0) @@ -13064,11 +13141,22 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, shift += 8; } } - fputs ("\tb\t", file); - assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0)); - if (NEED_PLT_RELOC) - fputs ("(PLT)", file); - fputc ('\n', file); + if (TARGET_THUMB) + { + fprintf (file, "\tbx\tr12\n"); + ASM_OUTPUT_ALIGN (file, 2); + assemble_name (file, label); + fputs (":\n", file); + assemble_integer (XEXP (DECL_RTL (function), 0), 4, BITS_PER_WORD, 1); + } + else + { + fputs ("\tb\t", file); + assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0)); + if (NEED_PLT_RELOC) + fputs ("(PLT)", file); + fputc ('\n', file); + } } int @@ -13131,3 +13219,117 @@ arm_output_load_gr (operands) return ""; } + +/* Return non-zero if the CONSUMER instruction (a store) does not need + PRODUCER's value to calculate the address. */ + +int +arm_no_early_store_addr_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx addr = PATTERN (consumer); + + if (GET_CODE (value) == COND_EXEC) + value = COND_EXEC_CODE (value); + if (GET_CODE (value) == PARALLEL) + value = XVECEXP (value, 0, 0); + value = XEXP (value, 0); + if (GET_CODE (addr) == COND_EXEC) + addr = COND_EXEC_CODE (addr); + if (GET_CODE (addr) == PARALLEL) + addr = XVECEXP (addr, 0, 0); + addr = XEXP (addr, 0); + + return !reg_overlap_mentioned_p (value, addr); +} + +/* Return non-zero if the CONSUMER instruction (an ALU op) does not + have an early register shift value or amount dependency on the + result of PRODUCER. */ + +int +arm_no_early_alu_shift_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx op = PATTERN (consumer); + rtx early_op; + + if (GET_CODE (value) == COND_EXEC) + value = COND_EXEC_CODE (value); + if (GET_CODE (value) == PARALLEL) + value = XVECEXP (value, 0, 0); + value = XEXP (value, 0); + if (GET_CODE (op) == COND_EXEC) + op = COND_EXEC_CODE (op); + if (GET_CODE (op) == PARALLEL) + op = XVECEXP (op, 0, 0); + op = XEXP (op, 1); + + early_op = XEXP (op, 0); + /* This is either an actual independent shift, or a shift applied to + the first operand of another operation. We want the whole shift + operation. */ + if (GET_CODE (early_op) == REG) + early_op = op; + + return !reg_overlap_mentioned_p (value, early_op); +} + +/* Return non-zero if the CONSUMER instruction (an ALU op) does not + have an early register shift value dependency on the result of + PRODUCER. */ + +int +arm_no_early_alu_shift_value_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx op = PATTERN (consumer); + rtx early_op; + + if (GET_CODE (value) == COND_EXEC) + value = COND_EXEC_CODE (value); + if (GET_CODE (value) == PARALLEL) + value = XVECEXP (value, 0, 0); + value = XEXP (value, 0); + if (GET_CODE (op) == COND_EXEC) + op = COND_EXEC_CODE (op); + if (GET_CODE (op) == PARALLEL) + op = XVECEXP (op, 0, 0); + op = XEXP (op, 1); + + early_op = XEXP (op, 0); + + /* This is either an actual independent shift, or a shift applied to + the first operand of another operation. We want the value being + shifted, in either case. */ + if (GET_CODE (early_op) != REG) + early_op = XEXP (early_op, 0); + + return !reg_overlap_mentioned_p (value, early_op); +} + +/* Return non-zero if the CONSUMER (a mul or mac op) does not + have an early register mult dependency on the result of + PRODUCER. */ + +int +arm_no_early_mul_dep (rtx producer, rtx consumer) +{ + rtx value = PATTERN (producer); + rtx op = PATTERN (consumer); + + if (GET_CODE (value) == COND_EXEC) + value = COND_EXEC_CODE (value); + if (GET_CODE (value) == PARALLEL) + value = XVECEXP (value, 0, 0); + value = XEXP (value, 0); + if (GET_CODE (op) == COND_EXEC) + op = COND_EXEC_CODE (op); + if (GET_CODE (op) == PARALLEL) + op = XVECEXP (op, 0, 0); + op = XEXP (op, 1); + + return (GET_CODE (op) == PLUS + && !reg_overlap_mentioned_p (value, XEXP (op, 0))); +} + diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 0cb1562e636..9beb16c7835 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -58,9 +58,7 @@ if (TARGET_SOFT_FLOAT) \ builtin_define ("__SOFTFP__"); \ \ - /* FIXME: TARGET_HARD_FLOAT currently implies \ - FPA. */ \ - if (TARGET_VFP && !TARGET_HARD_FLOAT) \ + if (TARGET_VFP) \ builtin_define ("__VFP_FP__"); \ \ /* Add a define for interworking. \ @@ -105,6 +103,20 @@ /* Configure didn't specify. */ #define TARGET_CPU_generic 0x8000 +/* The various ARM cores. */ +enum processor_type +{ +#define ARM_CORE(NAME, FLAGS) \ + NAME, +#include "arm-cores.def" +#undef ARM_CORE + /* Used to indicate that no processor has been specified. */ + arm_none +}; + +/* The processor for which instructions should be scheduled. */ +extern enum processor_type arm_tune; + typedef enum arm_cond_code { ARM_EQ = 0, ARM_NE, ARM_CS, ARM_CC, ARM_MI, ARM_PL, ARM_VS, ARM_VC, @@ -121,8 +133,12 @@ extern int arm_ccfsm_state; extern GTY(()) rtx arm_target_insn; /* Run-time compilation parameters selecting different hardware subsets. */ extern int target_flags; -/* The floating point instruction architecture, can be 2 or 3 */ -extern const char * target_fp_name; +/* The floating point mode. */ +extern const char *target_fpu_name; +/* For backwards compatability. */ +extern const char *target_fpe_name; +/* Whether to use floating point hardware. */ +extern const char *target_float_abi_name; /* Define the information needed to generate branch insns. This is stored from the compare operation. */ extern GTY(()) rtx arm_compare_op0; @@ -181,6 +197,14 @@ extern GTY(()) rtx aof_pic_label; #if TARGET_CPU_DEFAULT == TARGET_CPU_iwmmxt #define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TE__ -D__XSCALE__ -D__IWMMXT__" #else +#if (TARGET_CPU_DEFAULT == TARGET_CPU_arm926ej_s || \ + TARGET_CPU_DEFAULT == TARGET_CPU_arm1026ej_s) +#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TEJ__" +#else +#if (TARGET_CPU_DEFAULT == TARGET_CPU_arm1136j_s || \ + TARGET_CPU_DEFAULT == TARGET_CPU_arm1136jf_s) +#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_6J__" +#else #error Unrecognized value in TARGET_CPU_DEFAULT. #endif #endif @@ -190,6 +214,8 @@ extern GTY(()) rtx aof_pic_label; #endif #endif #endif +#endif +#endif #undef CPP_SPEC #define CPP_SPEC "%(cpp_cpu_arch) %(subtarget_cpp_spec) \ @@ -225,7 +251,11 @@ extern GTY(()) rtx aof_pic_label; %{march=arm9:-D__ARM_ARCH_4T__} \ %{march=arm920:-D__ARM_ARCH_4__} \ %{march=arm920t:-D__ARM_ARCH_4T__} \ +%{march=arm926ejs:-D__ARM_ARCH_5TEJ__} \ %{march=arm9tdmi:-D__ARM_ARCH_4T__} \ +%{march=arm1026ejs:-D__ARM_ARCH_5TEJ__} \ +%{march=arm1136js:-D__ARM_ARCH_6J__} \ +%{march=arm1136jfs:-D__ARM_ARCH_6J__} \ %{march=strongarm:-D__ARM_ARCH_4__} \ %{march=strongarm110:-D__ARM_ARCH_4__} \ %{march=strongarm1100:-D__ARM_ARCH_4__} \ @@ -243,6 +273,7 @@ extern GTY(()) rtx aof_pic_label; %{march=armv5t:-D__ARM_ARCH_5T__} \ %{march=armv5e:-D__ARM_ARCH_5E__} \ %{march=armv5te:-D__ARM_ARCH_5TE__} \ +%{march=arm6j:-D__ARM_ARCH6J__} \ %{!march=*: \ %{mcpu=arm2:-D__ARM_ARCH_2__} \ %{mcpu=arm250:-D__ARM_ARCH_2__} \ @@ -266,7 +297,11 @@ extern GTY(()) rtx aof_pic_label; %{mcpu=arm9:-D__ARM_ARCH_4T__} \ %{mcpu=arm920:-D__ARM_ARCH_4__} \ %{mcpu=arm920t:-D__ARM_ARCH_4T__} \ + %{mcpu=arm926ejs:-D__ARM_ARCH_5TEJ__} \ %{mcpu=arm9tdmi:-D__ARM_ARCH_4T__} \ + %{mcpu=arm1026ejs:-D__ARM_ARCH_5TEJ__} \ + %{mcpu=arm1136js:-D__ARM_ARCH_6J__} \ + %{mcpu=arm1136jfs:-D__ARM_ARCH_6J__} \ %{mcpu=strongarm:-D__ARM_ARCH_4__} \ %{mcpu=strongarm110:-D__ARM_ARCH_4__} \ %{mcpu=strongarm1100:-D__ARM_ARCH_4__} \ @@ -414,13 +449,14 @@ extern GTY(()) rtx aof_pic_label; #define TARGET_APCS_REENT (target_flags & ARM_FLAG_APCS_REENT) #define TARGET_ATPCS (target_flags & ARM_FLAG_ATPCS) #define TARGET_MMU_TRAPS (target_flags & ARM_FLAG_MMU_TRAPS) -#define TARGET_SOFT_FLOAT (target_flags & ARM_FLAG_SOFT_FLOAT) -#define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT) -#define TARGET_CIRRUS (arm_is_cirrus) -#define TARGET_ANY_HARD_FLOAT (TARGET_HARD_FLOAT || TARGET_CIRRUS) +#define TARGET_SOFT_FLOAT (arm_float_abi == ARM_FLOAT_ABI_SOFT) +#define TARGET_SOFT_FLOAT_ABI (arm_float_abi != ARM_FLOAT_ABI_HARD) +#define TARGET_HARD_FLOAT (arm_float_abi == ARM_FLOAT_ABI_HARD) +#define TARGET_FPA (arm_fp_model == ARM_FP_MODEL_FPA) +#define TARGET_MAVERICK (arm_fp_model == ARM_FP_MODEL_MAVERICK) +#define TARGET_VFP (arm_fp_model == ARM_FP_MODEL_VFP) #define TARGET_IWMMXT (arm_arch_iwmmxt) #define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_ARM) -#define TARGET_VFP (target_flags & ARM_FLAG_VFP) #define TARGET_BIG_END (target_flags & ARM_FLAG_BIG_END) #define TARGET_INTERWORK (target_flags & ARM_FLAG_INTERWORK) #define TARGET_LITTLE_WORDS (target_flags & ARM_FLAG_LITTLE_WORDS) @@ -523,20 +559,23 @@ extern GTY(()) rtx aof_pic_label; {"", TARGET_DEFAULT, "" } \ } -#define TARGET_OPTIONS \ -{ \ - {"cpu=", & arm_select[0].string, \ - N_("Specify the name of the target CPU"), 0}, \ - {"arch=", & arm_select[1].string, \ - N_("Specify the name of the target architecture"), 0}, \ - {"tune=", & arm_select[2].string, "", 0}, \ - {"fpe=", & target_fp_name, "" , 0}, \ - {"fp=", & target_fp_name, \ - N_("Specify the version of the floating point emulator"), 0},\ - {"structure-size-boundary=", & structure_size_string, \ - N_("Specify the minimum bit alignment of structures"), 0}, \ - {"pic-register=", & arm_pic_register_string, \ - N_("Specify the register to be used for PIC addressing"), 0} \ +#define TARGET_OPTIONS \ +{ \ + {"cpu=", & arm_select[0].string, \ + N_("Specify the name of the target CPU"), 0}, \ + {"arch=", & arm_select[1].string, \ + N_("Specify the name of the target architecture"), 0}, \ + {"tune=", & arm_select[2].string, "", 0}, \ + {"fpe=", & target_fpe_name, "", 0}, \ + {"fp=", & target_fpe_name, "", 0}, \ + {"fpu=", & target_fpu_name, \ + N_("Specify the name of the target floating point hardware/format"), 0}, \ + {"float-abi=", & target_float_abi_name, \ + N_("Specify if floating point hardware should be used"), 0}, \ + {"structure-size-boundary=", & structure_size_string, \ + N_("Specify the minimum bit alignment of structures"), 0}, \ + {"pic-register=", & arm_pic_register_string, \ + N_("Specify the register to be used for PIC addressing"), 0} \ } /* Support for a compile-time default CPU, et cetera. The rules are: @@ -576,12 +615,26 @@ enum prog_mode_type extern enum prog_mode_type arm_prgmode; -/* What sort of floating point unit do we have? Hardware or software. - If software, is it issue 2 or issue 3? */ +/* Which floating point model to use. */ +enum arm_fp_model +{ + ARM_FP_MODEL_UNKNOWN, + /* FPA model (Hardware or software). */ + ARM_FP_MODEL_FPA, + /* Cirrus Maverick floating point model. */ + ARM_FP_MODEL_MAVERICK, + /* VFP floating point model. */ + ARM_FP_MODEL_VFP +}; + +extern enum arm_fp_model arm_fp_model; + +/* Which floating point hardware is available. Also update + fp_model_for_fpu in arm.c when adding entries to this list. */ enum fputype { - /* Software floating point, FPA style double fmt. */ - FPUTYPE_SOFT_FPA, + /* No FP hardware. */ + FPUTYPE_NONE, /* Full FPA support. */ FPUTYPE_FPA, /* Emulated FPA hardware, Issue 2 emulator (no LFM/SFM). */ @@ -589,7 +642,9 @@ enum fputype /* Emulated FPA hardware, Issue 3 emulator. */ FPUTYPE_FPA_EMU3, /* Cirrus Maverick floating point co-processor. */ - FPUTYPE_MAVERICK + FPUTYPE_MAVERICK, + /* VFP. */ + FPUTYPE_VFP }; /* Recast the floating point class to be the floating point attribute. */ @@ -601,8 +656,21 @@ extern enum fputype arm_fpu_tune; /* What type of floating point instructions are available */ extern enum fputype arm_fpu_arch; +enum float_abi_type +{ + ARM_FLOAT_ABI_SOFT, + ARM_FLOAT_ABI_SOFTFP, + ARM_FLOAT_ABI_HARD +}; + +extern enum float_abi_type arm_float_abi; + /* Default floating point architecture. Override in sub-target if - necessary. */ + necessary. + FIXME: Is this still neccessary/desirable? Do we want VFP chips to + default to VFP unless overridden by a subtarget? If so it would be best + to remove these definitions. It also assumes there is only one cpu model + with a Maverick fpu. */ #ifndef FPUTYPE_DEFAULT #define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU2 #endif @@ -944,8 +1012,8 @@ extern const char * structure_size_string; \ if (TARGET_SOFT_FLOAT || TARGET_THUMB) \ { \ - for (regno = FIRST_ARM_FP_REGNUM; \ - regno <= LAST_ARM_FP_REGNUM; ++regno) \ + for (regno = FIRST_FPA_REGNUM; \ + regno <= LAST_FPA_REGNUM; ++regno) \ fixed_regs[regno] = call_used_regs[regno] = 1; \ } \ \ @@ -959,10 +1027,10 @@ extern const char * structure_size_string; fixed_regs[regno] = call_used_regs[regno] = 1; \ } \ \ - if (TARGET_CIRRUS) \ + if (TARGET_MAVERICK && TARGET_HARD_FLOAT) \ { \ - for (regno = FIRST_ARM_FP_REGNUM; \ - regno <= LAST_ARM_FP_REGNUM; ++ regno) \ + for (regno = FIRST_FPA_REGNUM; \ + regno <= LAST_FPA_REGNUM; ++ regno) \ fixed_regs[regno] = call_used_regs[regno] = 1; \ for (regno = FIRST_CIRRUS_FP_REGNUM; \ regno <= LAST_CIRRUS_FP_REGNUM; ++ regno) \ @@ -1109,8 +1177,8 @@ extern const char * structure_size_string; #define STACK_POINTER_REGNUM SP_REGNUM /* ARM floating pointer registers. */ -#define FIRST_ARM_FP_REGNUM 16 -#define LAST_ARM_FP_REGNUM 23 +#define FIRST_FPA_REGNUM 16 +#define LAST_FPA_REGNUM 23 #define FIRST_IWMMXT_GR_REGNUM 43 #define LAST_IWMMXT_GR_REGNUM 46 @@ -1156,7 +1224,7 @@ extern const char * structure_size_string; mode. */ #define HARD_REGNO_NREGS(REGNO, MODE) \ ((TARGET_ARM \ - && REGNO >= FIRST_ARM_FP_REGNUM \ + && REGNO >= FIRST_FPA_REGNUM \ && REGNO != FRAME_POINTER_REGNUM \ && REGNO != ARG_POINTER_REGNUM) \ ? 1 : ARM_NUM_REGS (MODE)) @@ -1412,7 +1480,7 @@ enum reg_class /* If we need to load shorts byte-at-a-time, then we need a scratch. */ #define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \ /* Cannot load constants into Cirrus registers. */ \ - ((TARGET_CIRRUS \ + ((TARGET_MAVERICK && TARGET_HARD_FLOAT \ && (CLASS) == CIRRUS_REGS \ && (CONSTANT_P (X) || GET_CODE (X) == SYMBOL_REF)) \ ? GENERAL_REGS : \ @@ -1446,13 +1514,14 @@ enum reg_class HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \ HOST_WIDE_INT low, high; \ \ - if (MODE == DImode || (TARGET_SOFT_FLOAT && MODE == DFmode)) \ + if (MODE == DImode || (TARGET_SOFT_FLOAT && TARGET_FPA \ + && MODE == DFmode)) \ low = ((val & 0xf) ^ 0x8) - 0x8; \ - else if (TARGET_CIRRUS) \ + else if (TARGET_MAVERICK && TARGET_HARD_FLOAT) \ /* Need to be careful, -256 is not a valid offset. */ \ low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \ else if (MODE == SImode \ - || (MODE == SFmode && TARGET_SOFT_FLOAT) \ + || (MODE == SFmode && TARGET_SOFT_FLOAT && TARGET_FPA) \ || ((MODE == HImode || MODE == QImode) && ! arm_arch4)) \ /* Need to be careful, -4096 is not a valid offset. */ \ low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff); \ @@ -1460,7 +1529,7 @@ enum reg_class /* Need to be careful, -256 is not a valid offset. */ \ low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \ else if (GET_MODE_CLASS (MODE) == MODE_FLOAT \ - && TARGET_HARD_FLOAT) \ + && TARGET_HARD_FLOAT && TARGET_FPA) \ /* Need to be careful, -1024 is not a valid offset. */ \ low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \ else \ @@ -1588,9 +1657,11 @@ enum reg_class /* Define how to find the value returned by a library function assuming the value has mode MODE. */ #define LIBCALL_VALUE(MODE) \ - (TARGET_ARM && TARGET_HARD_FLOAT && GET_MODE_CLASS (MODE) == MODE_FLOAT \ - ? gen_rtx_REG (MODE, FIRST_ARM_FP_REGNUM) \ - : TARGET_ARM && TARGET_CIRRUS && GET_MODE_CLASS (MODE) == MODE_FLOAT \ + (TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA \ + && GET_MODE_CLASS (MODE) == MODE_FLOAT \ + ? gen_rtx_REG (MODE, FIRST_FPA_REGNUM) \ + : TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK \ + && GET_MODE_CLASS (MODE) == MODE_FLOAT \ ? gen_rtx_REG (MODE, FIRST_CIRRUS_FP_REGNUM) \ : TARGET_REALLY_IWMMXT && VECTOR_MODE_SUPPORTED_P (MODE) \ ? gen_rtx_REG (MODE, FIRST_IWMMXT_REGNUM) \ @@ -1608,9 +1679,11 @@ enum reg_class /* On a Cirrus chip, mvf0 can return results. */ #define FUNCTION_VALUE_REGNO_P(REGNO) \ ((REGNO) == ARG_REGISTER (1) \ - || (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) && TARGET_CIRRUS) \ + || (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) \ + && TARGET_HARD_FLOAT && TARGET_MAVERICK) \ || (TARGET_ARM && ((REGNO) == FIRST_IWMMXT_REGNUM) && TARGET_IWMMXT) \ - || (TARGET_ARM && ((REGNO) == FIRST_ARM_FP_REGNUM) && TARGET_HARD_FLOAT)) + || (TARGET_ARM && ((REGNO) == FIRST_FPA_REGNUM) \ + && TARGET_HARD_FLOAT && TARGET_FPA)) /* How large values are returned */ /* A C expression which can inhibit the returning of certain function values @@ -2463,10 +2536,11 @@ extern int making_const_table; { \ if (TARGET_THUMB) \ { \ - if (is_called_in_ARM_mode (DECL)) \ + if (is_called_in_ARM_mode (DECL) \ + || current_function_is_thunk) \ fprintf (STREAM, "\t.code 32\n") ; \ else \ - fprintf (STREAM, "\t.thumb_func\n") ; \ + fprintf (STREAM, "\t.code 16\n\t.thumb_func\n") ; \ } \ if (TARGET_POKE_FUNCTION_NAME) \ arm_poke_function_name (STREAM, (char *) NAME); \ diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 9a693a839d0..563c8ef387a 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -145,7 +145,7 @@ ; Floating Point Unit. If we only have floating point emulation, then there ; is no point in scheduling the floating point insns. (Well, for best ; performance we should try and group them together). -(define_attr "fpu" "softfpa,fpa,fpe2,fpe3,maverick" +(define_attr "fpu" "none,fpa,fpe2,fpe3,maverick,vfp" (const (symbol_ref "arm_fpu_attr"))) ; LENGTH of an instruction (in bytes) @@ -167,6 +167,14 @@ (set_attr "length" "4") (set_attr "pool_range" "250")]) +;; The instruction used to implement a particular pattern. This +;; information is used by pipeline descriptions to provide accurate +;; scheduling information. + +(define_attr "insn" + "smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals,smlawy,smuad,smuadx,smlad,smladx,smusd,smusdx,smlsd,smlsdx,smmul,smmulr,other" + (const_string "other")) + ; TYPE attribute is used to detect floating point instructions which, if ; running on a co-processor can run in parallel with other, basic instructions ; If write-buffer scheduling is enabled then it can also be used in the @@ -191,19 +199,27 @@ ; r_mem_f the reverse of f_mem_r ; f_2_r fast transfer float to arm (no memory needed) ; r_2_f fast transfer arm to float +; branch a branch ; call a subroutine call -; load any load from memory -; store1 store 1 word to memory from arm registers +; load_byte load byte(s) from memory to arm registers +; load1 load 1 word from memory to arm registers +; load2 load 2 words from memory to arm registers +; load3 load 3 words from memory to arm registers +; load4 load 4 words from memory to arm registers +; store store 1 word to memory from arm registers ; store2 store 2 words ; store3 store 3 words -; store4 store 4 words +; store4 store 4 (or more) words ; Additions for Cirrus Maverick co-processor: ; mav_farith Floating point arithmetic (4 cycle) ; mav_dmult Double multiplies (7 cycle) ; (define_attr "type" - "normal,mult,block,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith,float_em,f_load,f_store,f_mem_r,r_mem_f,f_2_r,r_2_f,call,load,store1,store2,store3,store4,mav_farith,mav_dmult" - (const_string "normal")) + "alu,alu_shift,alu_shift_reg,mult,block,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith,float_em,f_load,f_store,f_mem_r,r_mem_f,f_2_r,r_2_f,branch,call,load_byte,load1,load2,load3,load4,store1,store2,store3,store4,mav_farith,mav_dmult" + (if_then_else + (eq_attr "insn" "smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals") + (const_string "mult") + (const_string "alu"))) ; Load scheduling, set from the arm_ld_sched variable ; initialized by arm_override_options() @@ -251,7 +267,7 @@ ; to stall the processor. Used with model_wbuf above. (define_attr "write_conflict" "no,yes" (if_then_else (eq_attr "type" - "block,float_em,f_load,f_store,f_mem_r,r_mem_f,call,load") + "block,float_em,f_load,f_store,f_mem_r,r_mem_f,call,load1") (const_string "yes") (const_string "no"))) @@ -259,7 +275,7 @@ ; than one on the main cpu execution unit. (define_attr "core_cycles" "single,multi" (if_then_else (eq_attr "type" - "normal,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith") + "alu,alu_shift,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith") (const_string "single") (const_string "multi"))) @@ -267,115 +283,26 @@ ;; distant label. Only applicable to Thumb code. (define_attr "far_jump" "yes,no" (const_string "no")) -(define_automaton "arm") +;;--------------------------------------------------------------------------- +;; Pipeline descriptions -;; Write buffer -; -; Strictly, we should model a 4-deep write buffer for ARM7xx based chips -; -; The write buffer on some of the arm6 processors is hard to model exactly. -; There is room in the buffer for up to two addresses and up to eight words -; of memory, but the two needn't be split evenly. When writing the two -; addresses are fully pipelined. However, a read from memory that is not -; currently in the cache will block until the writes have completed. -; It is normally the case that FCLK and MCLK will be in the ratio 2:1, so -; writes will take 2 FCLK cycles per word, if FCLK and MCLK are asynchronous -; (they aren't allowed to be at present) then there is a startup cost of 1MCLK -; cycle to add as well. -(define_cpu_unit "write_buf" "arm") - -;; Write blockage unit -; -; The write_blockage unit models (partially), the fact that reads will stall -; until the write buffer empties. -; The f_mem_r and r_mem_f could also block, but they are to the stack, -; so we don't model them here -(define_cpu_unit "write_blockage" "arm") +;; Processor type. This attribute must exactly match the table in +;; arm-cores.def. +(define_attr "tune" + "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7m,arm7d,arm7dm,arm7di,arm7dmi,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7tdmi,arm710t,arm720t,arm740t,arm8,arm810,arm9,arm920,arm920t,arm940t,arm9tdmi,arm9e,ep9312,strongarm,strongarm110,strongarm1100,strongarm1110,arm10tdmi,arm1020t,arm926ejs,arm1026ejs,xscale,iwmmxt,arm1136js,arm1136jfs" + (const (symbol_ref "arm_tune"))) -;; Core -; -(define_cpu_unit "core" "arm") - -(define_insn_reservation "r_mem_f_wbuf" 5 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "r_mem_f")) - "core+write_buf*3") - -(define_insn_reservation "store1_wbuf" 5 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store1")) - "core+write_buf*3+write_blockage*5") - -(define_insn_reservation "store2_wbuf" 7 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store2")) - "core+write_buf*4+write_blockage*7") - -(define_insn_reservation "store3_wbuf" 9 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store3")) - "core+write_buf*5+write_blockage*9") - -(define_insn_reservation "store4_wbuf" 11 - (and (eq_attr "model_wbuf" "yes") - (eq_attr "type" "store4")) - "core+write_buf*6+write_blockage*11") - -(define_insn_reservation "store2" 3 - (and (eq_attr "model_wbuf" "no") - (eq_attr "type" "store2")) - "core*3") - -(define_insn_reservation "store3" 4 - (and (eq_attr "model_wbuf" "no") - (eq_attr "type" "store3")) - "core*4") - -(define_insn_reservation "store4" 5 - (and (eq_attr "model_wbuf" "no") - (eq_attr "type" "store4")) - "core*5") - -(define_insn_reservation "store1_ldsched" 1 - (and (eq_attr "ldsched" "yes") (eq_attr "type" "store1")) - "core") - -(define_insn_reservation "load_ldsched_xscale" 3 - (and (and (eq_attr "ldsched" "yes") (eq_attr "type" "load")) - (eq_attr "is_xscale" "yes")) - "core") - -(define_insn_reservation "load_ldsched" 2 - (and (and (eq_attr "ldsched" "yes") (eq_attr "type" "load")) - (eq_attr "is_xscale" "no")) - "core") - -(define_insn_reservation "load_or_store" 2 - (and (eq_attr "ldsched" "!yes") (eq_attr "type" "load,store1")) - "core*2") - -(define_insn_reservation "mult" 16 - (and (eq_attr "ldsched" "no") (eq_attr "type" "mult")) - "core*16") - -(define_insn_reservation "mult_ldsched_strongarm" 3 - (and (and (eq_attr "ldsched" "yes") (eq_attr "is_strongarm" "yes")) - (eq_attr "type" "mult")) - "core*2") - -(define_insn_reservation "mult_ldsched" 4 - (and (and (eq_attr "ldsched" "yes") (eq_attr "is_strongarm" "no")) - (eq_attr "type" "mult")) - "core*4") - -(define_insn_reservation "multi_cycle" 32 - (and (eq_attr "core_cycles" "multi") - (eq_attr "type" "!mult,load,store1,store2,store3,store4")) - "core*32") - -(define_insn_reservation "single_cycle" 1 - (eq_attr "core_cycles" "single") - "core") +;; True if the generic scheduling description should be used. + +(define_attr "generic_sched" "yes,no" + (if_then_else + (eq_attr "tune" "arm1026ejs,arm1136js,arm1136jfs") + (const_string "no") + (const_string "yes"))) + +(include "arm-generic.md") +(include "arm1026ejs.md") +(include "arm1136jfs.md") ;;--------------------------------------------------------------------------- @@ -397,7 +324,7 @@ (clobber (reg:CC CC_REGNUM))])] "TARGET_EITHER" " - if (TARGET_CIRRUS) + if (TARGET_HARD_FLOAT && TARGET_MAVERICK) { if (!cirrus_fp_register (operands[0], DImode)) operands[0] = force_reg (DImode, operands[0]); @@ -433,7 +360,7 @@ (plus:DI (match_operand:DI 1 "s_register_operand" "%0, 0") (match_operand:DI 2 "s_register_operand" "r, 0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && !TARGET_CIRRUS" + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" "#" "TARGET_ARM && reload_completed" [(parallel [(set (reg:CC_C CC_REGNUM) @@ -461,7 +388,7 @@ (match_operand:SI 2 "s_register_operand" "r,r")) (match_operand:DI 1 "s_register_operand" "r,0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && !TARGET_CIRRUS" + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" "#" "TARGET_ARM && reload_completed" [(parallel [(set (reg:CC_C CC_REGNUM) @@ -490,7 +417,7 @@ (match_operand:SI 2 "s_register_operand" "r,r")) (match_operand:DI 1 "s_register_operand" "r,0"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && !TARGET_CIRRUS" + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)" "#" "TARGET_ARM && reload_completed" [(parallel [(set (reg:CC_C CC_REGNUM) @@ -801,7 +728,10 @@ (match_operand:SI 1 "s_register_operand" ""))))] "TARGET_ARM" "adc%?\\t%0, %1, %3%S2" - [(set_attr "conds" "use")] + [(set_attr "conds" "use") + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*addsi3_carryin_alt1" @@ -851,9 +781,9 @@ [(set (match_operand:SF 0 "s_register_operand" "") (plus:SF (match_operand:SF 1 "s_register_operand" "") (match_operand:SF 2 "fpa_add_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], SFmode)) operands[2] = force_reg (SFmode, operands[2]); ") @@ -862,9 +792,9 @@ [(set (match_operand:DF 0 "s_register_operand" "") (plus:DF (match_operand:DF 1 "s_register_operand" "") (match_operand:DF 2 "fpa_add_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], DFmode)) operands[2] = force_reg (DFmode, operands[2]); ") @@ -877,7 +807,7 @@ (clobber (reg:CC CC_REGNUM))])] "TARGET_EITHER" " - if (TARGET_CIRRUS + if (TARGET_HARD_FLOAT && TARGET_MAVERICK && TARGET_ARM && cirrus_fp_register (operands[0], DImode) && cirrus_fp_register (operands[1], DImode)) @@ -1075,9 +1005,9 @@ [(set (match_operand:SF 0 "s_register_operand" "") (minus:SF (match_operand:SF 1 "fpa_rhs_operand" "") (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[1], SFmode)) operands[1] = force_reg (SFmode, operands[1]); @@ -1090,9 +1020,9 @@ [(set (match_operand:DF 0 "s_register_operand" "") (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "") (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[1], DFmode)) operands[1] = force_reg (DFmode, operands[1]); @@ -1119,7 +1049,7 @@ (match_operand:SI 1 "s_register_operand" "%?r,0")))] "TARGET_ARM" "mul%?\\t%0, %2, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "mul") (set_attr "predicable" "yes")] ) @@ -1140,7 +1070,7 @@ return \"mul\\t%0, %0, %2\"; " [(set_attr "length" "4,4,2") - (set_attr "type" "mult")] + (set_attr "insn" "mul")] ) (define_insn "*mulsi3_compare0" @@ -1154,7 +1084,7 @@ "TARGET_ARM && !arm_arch_xscale" "mul%?s\\t%0, %2, %1" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "muls")] ) (define_insn "*mulsi_compare0_scratch" @@ -1167,7 +1097,7 @@ "TARGET_ARM && !arm_arch_xscale" "mul%?s\\t%0, %2, %1" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "muls")] ) ;; Unnamed templates to match MLA instruction. @@ -1180,7 +1110,7 @@ (match_operand:SI 3 "s_register_operand" "?r,r,0,0")))] "TARGET_ARM" "mla%?\\t%0, %2, %1, %3" - [(set_attr "type" "mult") + [(set_attr "insn" "mla") (set_attr "predicable" "yes")] ) @@ -1198,7 +1128,7 @@ "TARGET_ARM && !arm_arch_xscale" "mla%?s\\t%0, %2, %1, %3" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "mlas")] ) (define_insn "*mulsi3addsi_compare0_scratch" @@ -1213,7 +1143,7 @@ "TARGET_ARM && !arm_arch_xscale" "mla%?s\\t%0, %2, %1, %3" [(set_attr "conds" "set") - (set_attr "type" "mult")] + (set_attr "insn" "mlas")] ) ;; Unnamed template to match long long multiply-accumlate (smlal) @@ -1227,7 +1157,7 @@ (match_operand:DI 1 "s_register_operand" "0")))] "TARGET_ARM && arm_fast_multiply" "smlal%?\\t%Q0, %R0, %3, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smlal") (set_attr "predicable" "yes")] ) @@ -1238,7 +1168,7 @@ (sign_extend:DI (match_operand:SI 2 "s_register_operand" "r"))))] "TARGET_ARM && arm_fast_multiply" "smull%?\\t%Q0, %R0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smull") (set_attr "predicable" "yes")] ) @@ -1249,7 +1179,7 @@ (zero_extend:DI (match_operand:SI 2 "s_register_operand" "r"))))] "TARGET_ARM && arm_fast_multiply" "umull%?\\t%Q0, %R0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "umull") (set_attr "predicable" "yes")] ) @@ -1264,7 +1194,7 @@ (match_operand:DI 1 "s_register_operand" "0")))] "TARGET_ARM && arm_fast_multiply" "umlal%?\\t%Q0, %R0, %3, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "umlal") (set_attr "predicable" "yes")] ) @@ -1279,7 +1209,7 @@ (clobber (match_scratch:SI 3 "=&r,&r"))] "TARGET_ARM && arm_fast_multiply" "smull%?\\t%3, %0, %2, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "smull") (set_attr "predicable" "yes")] ) @@ -1294,7 +1224,7 @@ (clobber (match_scratch:SI 3 "=&r,&r"))] "TARGET_ARM && arm_fast_multiply" "umull%?\\t%3, %0, %2, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "umull") (set_attr "predicable" "yes")] ) @@ -1306,7 +1236,7 @@ (match_operand:HI 2 "s_register_operand" "r"))))] "TARGET_ARM && arm_arch5e" "smulbb%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1319,7 +1249,7 @@ (match_operand:HI 2 "s_register_operand" "r"))))] "TARGET_ARM && arm_arch5e" "smultb%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1332,7 +1262,7 @@ (const_int 16))))] "TARGET_ARM && arm_arch5e" "smulbt%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1346,7 +1276,7 @@ (const_int 16))))] "TARGET_ARM && arm_arch5e" "smultt%?\\t%0, %1, %2" - [(set_attr "type" "mult") + [(set_attr "insn" "smulxy") (set_attr "predicable" "yes")] ) @@ -1359,7 +1289,7 @@ (match_operand:HI 3 "s_register_operand" "r")))))] "TARGET_ARM && arm_arch5e" "smlabb%?\\t%0, %2, %3, %1" - [(set_attr "type" "mult") + [(set_attr "insn" "smlaxy") (set_attr "predicable" "yes")] ) @@ -1373,16 +1303,16 @@ (match_operand:HI 3 "s_register_operand" "r")))))] "TARGET_ARM && arm_arch5e" "smlalbb%?\\t%Q0, %R0, %2, %3" - [(set_attr "type" "mult") + [(set_attr "insn" "smlalxy") (set_attr "predicable" "yes")]) (define_expand "mulsf3" [(set (match_operand:SF 0 "s_register_operand" "") (mult:SF (match_operand:SF 1 "s_register_operand" "") (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], SFmode)) operands[2] = force_reg (SFmode, operands[2]); ") @@ -1391,9 +1321,9 @@ [(set (match_operand:DF 0 "s_register_operand" "") (mult:DF (match_operand:DF 1 "s_register_operand" "") (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS + if (TARGET_MAVERICK && !cirrus_fp_register (operands[2], DFmode)) operands[2] = force_reg (DFmode, operands[2]); ") @@ -1404,14 +1334,14 @@ [(set (match_operand:SF 0 "s_register_operand" "") (div:SF (match_operand:SF 1 "fpa_rhs_operand" "") (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") (define_expand "divdf3" [(set (match_operand:DF 0 "s_register_operand" "") (div:DF (match_operand:DF 1 "fpa_rhs_operand" "") (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") ;; Modulo insns @@ -1420,14 +1350,14 @@ [(set (match_operand:SF 0 "s_register_operand" "") (mod:SF (match_operand:SF 1 "s_register_operand" "") (match_operand:SF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") (define_expand "moddf3" [(set (match_operand:DF 0 "s_register_operand" "") (mod:DF (match_operand:DF 1 "s_register_operand" "") (match_operand:DF 2 "fpa_rhs_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") ;; Boolean and,ior,xor insns @@ -1999,7 +1929,9 @@ "bic%?\\t%0, %1, %2%S4" [(set_attr "predicable" "yes") (set_attr "shift" "2") - ] + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*andsi_notsi_si_compare0" @@ -2376,6 +2308,41 @@ ;; Shift and rotation insns +(define_expand "ashldi3" + [(set (match_operand:DI 0 "s_register_operand" "") + (ashift:DI (match_operand:DI 1 "s_register_operand" "") + (match_operand:SI 2 "reg_or_int_operand" "")))] + "TARGET_ARM" + " + if (GET_CODE (operands[2]) == CONST_INT) + { + if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + { + emit_insn (gen_arm_ashldi3_1bit (operands[0], operands[1])); + DONE; + } + /* Ideally we shouldn't fail here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + FAIL; + } + else if (!TARGET_REALLY_IWMMXT && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)) + FAIL; + " +) + +(define_insn "arm_ashldi3_1bit" + [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + (ashift:DI (match_operand:DI 1 "s_register_operand" "?r,0") + (const_int 1))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM" + "movs\\t%Q0, %Q1, asl #1\;adc\\t%R0, %R1, %R1" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + (define_expand "ashlsi3" [(set (match_operand:SI 0 "s_register_operand" "") (ashift:SI (match_operand:SI 1 "s_register_operand" "") @@ -2400,6 +2367,41 @@ [(set_attr "length" "2")] ) +(define_expand "ashrdi3" + [(set (match_operand:DI 0 "s_register_operand" "") + (ashiftrt:DI (match_operand:DI 1 "s_register_operand" "") + (match_operand:SI 2 "reg_or_int_operand" "")))] + "TARGET_ARM" + " + if (GET_CODE (operands[2]) == CONST_INT) + { + if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + { + emit_insn (gen_arm_ashrdi3_1bit (operands[0], operands[1])); + DONE; + } + /* Ideally we shouldn't fail here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + FAIL; + } + else if (!TARGET_REALLY_IWMMXT) + FAIL; + " +) + +(define_insn "arm_ashrdi3_1bit" + [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + (ashiftrt:DI (match_operand:DI 1 "s_register_operand" "?r,0") + (const_int 1))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM" + "movs\\t%R0, %R1, asr #1\;mov\\t%Q0, %Q1, rrx" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + (define_expand "ashrsi3" [(set (match_operand:SI 0 "s_register_operand" "") (ashiftrt:SI (match_operand:SI 1 "s_register_operand" "") @@ -2421,6 +2423,41 @@ [(set_attr "length" "2")] ) +(define_expand "lshrdi3" + [(set (match_operand:DI 0 "s_register_operand" "") + (lshiftrt:DI (match_operand:DI 1 "s_register_operand" "") + (match_operand:SI 2 "reg_or_int_operand" "")))] + "TARGET_ARM" + " + if (GET_CODE (operands[2]) == CONST_INT) + { + if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1) + { + emit_insn (gen_arm_lshrdi3_1bit (operands[0], operands[1])); + DONE; + } + /* Ideally we shouldn't fail here if we could know that operands[1] + ends up already living in an iwmmxt register. Otherwise it's + cheaper to have the alternate code being generated than moving + values to iwmmxt regs and back. */ + FAIL; + } + else if (!TARGET_REALLY_IWMMXT) + FAIL; + " +) + +(define_insn "arm_lshrdi3_1bit" + [(set (match_operand:DI 0 "s_register_operand" "=&r,r") + (lshiftrt:DI (match_operand:DI 1 "s_register_operand" "?r,0") + (const_int 1))) + (clobber (reg:CC CC_REGNUM))] + "TARGET_ARM" + "movs\\t%R0, %R1, lsr #1\;mov\\t%Q0, %Q1, rrx" + [(set_attr "conds" "clob") + (set_attr "length" "8")] +) + (define_expand "lshrsi3" [(set (match_operand:SI 0 "s_register_operand" "") (lshiftrt:SI (match_operand:SI 1 "s_register_operand" "") @@ -2491,19 +2528,6 @@ [(set_attr "length" "2")] ) -(define_expand "ashldi3" - [(set (match_operand:DI 0 "s_register_operand" "") - (ashift:DI (match_operand:DI 1 "general_operand" "") - (match_operand:SI 2 "general_operand" "")))] - "TARGET_ARM && (TARGET_IWMMXT || TARGET_CIRRUS)" - " - if (! s_register_operand (operands[1], DImode)) - operands[1] = copy_to_mode_reg (DImode, operands[1]); - if (! s_register_operand (operands[2], SImode)) - operands[2] = copy_to_mode_reg (SImode, operands[2]); - " -) - (define_insn "*arm_shiftsi3" [(set (match_operand:SI 0 "s_register_operand" "=r") (match_operator:SI 3 "shift_operator" @@ -2513,7 +2537,9 @@ "mov%?\\t%0, %1%S3" [(set_attr "predicable" "yes") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*shiftsi3_compare0" @@ -2528,7 +2554,9 @@ "mov%?s\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*shiftsi3_compare0_scratch" @@ -2541,8 +2569,7 @@ "TARGET_ARM" "mov%?s\\t%0, %1%S3" [(set_attr "conds" "set") - (set_attr "shift" "1") - ] + (set_attr "shift" "1")] ) (define_insn "*notsi_shiftsi" @@ -2554,7 +2581,9 @@ "mvn%?\\t%0, %1%S3" [(set_attr "predicable" "yes") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*notsi_shiftsi_compare0" @@ -2569,7 +2598,9 @@ "mvn%?s\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*not_shiftsi_compare0_scratch" @@ -2583,7 +2614,9 @@ "mvn%?s\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) ;; We don't really have extzv, but defining this using shifts helps @@ -2680,14 +2713,14 @@ (define_expand "negsf2" [(set (match_operand:SF 0 "s_register_operand" "") (neg:SF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "" ) (define_expand "negdf2" [(set (match_operand:DF 0 "s_register_operand" "") (neg:DF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") ;; abssi2 doesn't really clobber the condition codes if a different register @@ -2734,25 +2767,25 @@ (define_expand "abssf2" [(set (match_operand:SF 0 "s_register_operand" "") (abs:SF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "") (define_expand "absdf2" [(set (match_operand:DF 0 "s_register_operand" "") (abs:DF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "") (define_expand "sqrtsf2" [(set (match_operand:SF 0 "s_register_operand" "") (sqrt:SF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") (define_expand "sqrtdf2" [(set (match_operand:DF 0 "s_register_operand" "") (sqrt:DF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "") (define_insn_and_split "one_cmpldi2" @@ -2823,9 +2856,9 @@ (define_expand "floatsisf2" [(set (match_operand:SF 0 "s_register_operand" "") (float:SF (match_operand:SI 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { emit_insn (gen_cirrus_floatsisf2 (operands[0], operands[1])); DONE; @@ -2835,9 +2868,9 @@ (define_expand "floatsidf2" [(set (match_operand:DF 0 "s_register_operand" "") (float:DF (match_operand:SI 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { emit_insn (gen_cirrus_floatsidf2 (operands[0], operands[1])); DONE; @@ -2847,9 +2880,9 @@ (define_expand "fix_truncsfsi2" [(set (match_operand:SI 0 "s_register_operand" "") (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" ""))))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[0], SImode)) operands[0] = force_reg (SImode, operands[0]); @@ -2863,9 +2896,9 @@ (define_expand "fix_truncdfsi2" [(set (match_operand:SI 0 "s_register_operand" "") (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" ""))))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS) + if (TARGET_MAVERICK) { if (!cirrus_fp_register (operands[1], DFmode)) operands[1] = force_reg (DFmode, operands[0]); @@ -2880,7 +2913,7 @@ [(set (match_operand:SF 0 "s_register_operand" "") (float_truncate:SF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "" ) @@ -2909,7 +2942,7 @@ ldr%?b\\t%Q0, %1\;mov%?\\t%R0, #0" [(set_attr "length" "8") (set_attr "predicable" "yes") - (set_attr "type" "*,load") + (set_attr "type" "*,load_byte") (set_attr "pool_range" "*,4092") (set_attr "neg_pool_range" "*,4084")] ) @@ -3038,7 +3071,7 @@ return \"ldrh\\t%0, %1\"; " [(set_attr "length" "4") - (set_attr "type" "load") + (set_attr "type" "load_byte") (set_attr "pool_range" "60")] ) @@ -3047,7 +3080,7 @@ (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] "TARGET_ARM && arm_arch4" "ldr%?h\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")] @@ -3129,7 +3162,7 @@ "TARGET_THUMB" "ldrb\\t%0, %1" [(set_attr "length" "2") - (set_attr "type" "load") + (set_attr "type" "load_byte") (set_attr "pool_range" "32")] ) @@ -3138,7 +3171,7 @@ (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] "TARGET_ARM" "ldr%?b\\t%0, %1\\t%@ zero_extendqisi2" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "pool_range" "4096") (set_attr "neg_pool_range" "4084")] @@ -3271,7 +3304,7 @@ return \"\"; }" [(set_attr "length" "4") - (set_attr "type" "load") + (set_attr "type" "load_byte") (set_attr "pool_range" "1020")] ) @@ -3317,7 +3350,7 @@ (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))] "TARGET_ARM && arm_arch4" "ldr%?sh\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")] @@ -3389,7 +3422,7 @@ return \"#\"; return \"ldr%?sb\\t%0, %1\"; " - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "length" "8") (set_attr "pool_range" "256") @@ -3487,7 +3520,7 @@ return \"#\"; return \"ldr%?sb\\t%0, %1\"; " - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes") (set_attr "length" "8") (set_attr "pool_range" "256") @@ -3602,14 +3635,14 @@ return \"\"; }" [(set_attr "length" "2,6") - (set_attr "type" "load,load") + (set_attr "type" "load_byte,load_byte") (set_attr "pool_range" "32,32")] ) (define_expand "extendsfdf2" [(set (match_operand:DF 0 "s_register_operand" "") (float_extend:DF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" "" ) @@ -3693,12 +3726,12 @@ (define_insn "*arm_movdi" [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, o<>") (match_operand:DI 1 "di_operand" "rIK,mi,r"))] - "TARGET_ARM && !TARGET_CIRRUS && ! TARGET_IWMMXT" + "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK) && ! TARGET_IWMMXT" "* return (output_move_double (operands)); " [(set_attr "length" "8") - (set_attr "type" "*,load,store2") + (set_attr "type" "*,load2,store2") (set_attr "pool_range" "*,1020,*") (set_attr "neg_pool_range" "*,1008,*")] ) @@ -3711,7 +3744,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=l,l,l,l,>,l, m,*r") (match_operand:DI 1 "general_operand" "l, I,J,>,l,mi,l,*r"))] "TARGET_THUMB - && !TARGET_CIRRUS + && !(TARGET_HARD_FLOAT && TARGET_MAVERICK) && ( register_operand (operands[0], DImode) || register_operand (operands[1], DImode))" "* @@ -3746,7 +3779,7 @@ } }" [(set_attr "length" "4,4,6,2,2,6,4,4") - (set_attr "type" "*,*,*,load,store2,load,store2,*") + (set_attr "type" "*,*,*,load2,store2,load2,store2,*") (set_attr "pool_range" "*,*,*,*,*,1020,*,*")] ) @@ -3800,7 +3833,7 @@ mvn%?\\t%0, #%B1 ldr%?\\t%0, %1 str%?\\t%1, %0" - [(set_attr "type" "*,*,load,store1") + [(set_attr "type" "*,*,load1,store1") (set_attr "predicable" "yes") (set_attr "pool_range" "*,*,4096,*") (set_attr "neg_pool_range" "*,*,4084,*")] @@ -3837,7 +3870,7 @@ str\\t%1, %0 mov\\t%0, %1" [(set_attr "length" "2,2,4,4,2,2,2,2,2") - (set_attr "type" "*,*,*,*,load,store1,load,store1,*") + (set_attr "type" "*,*,*,*,load1,store1,load1,store1,*") (set_attr "pool_range" "*,*,*,*,*,*,1020,*,*")] ) @@ -3889,7 +3922,7 @@ (unspec:SI [(match_operand:SI 1 "" "mX")] UNSPEC_PIC_SYM))] "TARGET_ARM && flag_pic" "ldr%?\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set (attr "pool_range") (const_int 4096)) (set (attr "neg_pool_range") (const_int 4084))] ) @@ -3899,7 +3932,7 @@ (unspec:SI [(match_operand:SI 1 "" "mX")] UNSPEC_PIC_SYM))] "TARGET_THUMB && flag_pic" "ldr\\t%0, %1" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set (attr "pool_range") (const_int 1024))] ) @@ -3925,7 +3958,7 @@ output_asm_insn (\"ldr%?\\t%0, %a1\", operands); return \"\"; " - [(set_attr "type" "load") + [(set_attr "type" "load1") (set (attr "pool_range") (if_then_else (eq_attr "is_thumb" "yes") (const_int 1024) @@ -4350,7 +4383,7 @@ return \"ldrh %0, %1\"; }" [(set_attr "length" "2,4,2,2,2,2") - (set_attr "type" "*,load,store1,*,*,*") + (set_attr "type" "*,load1,store1,*,*,*") (set_attr "pool_range" "*,64,*,*,*,*")] ) @@ -4369,7 +4402,7 @@ output_asm_insn (\"ldr%?\\t%0, %1\\t%@ load-rotate\", ops); return \"\"; }" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes")] ) @@ -4437,7 +4470,7 @@ mvn%?\\t%0, #%B1\\t%@ movhi str%?h\\t%1, %0\\t%@ movhi ldr%?h\\t%0, %1\\t%@ movhi" - [(set_attr "type" "*,*,store1,load") + [(set_attr "type" "*,*,store1,load1") (set_attr "predicable" "yes") (set_attr "pool_range" "*,*,*,256") (set_attr "neg_pool_range" "*,*,*,244")] @@ -4457,7 +4490,7 @@ mov%?\\t%0, %1\\t%@ movhi mvn%?\\t%0, #%B1\\t%@ movhi ldr%?\\t%0, %1\\t%@ movhi" - [(set_attr "type" "*,*,load") + [(set_attr "type" "*,*,load1") (set_attr "predicable" "yes") (set_attr "pool_range" "4096") (set_attr "neg_pool_range" "4084")] @@ -4477,7 +4510,7 @@ mov%?\\t%0, %1\\t%@ movhi mvn%?\\t%0, #%B1\\t%@ movhi ldr%?\\t%0, %1\\t%@ movhi_bigend\;mov%?\\t%0, %0, asr #16" - [(set_attr "type" "*,*,load") + [(set_attr "type" "*,*,load1") (set_attr "predicable" "yes") (set_attr "length" "4,4,8") (set_attr "pool_range" "*,*,4092") @@ -4492,7 +4525,7 @@ && BYTES_BIG_ENDIAN && !TARGET_MMU_TRAPS" "ldr%?\\t%0, %1\\t%@ movhi_bigend" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes") (set_attr "pool_range" "4096") (set_attr "neg_pool_range" "4084")] @@ -4632,7 +4665,7 @@ mvn%?\\t%0, #%B1 ldr%?b\\t%0, %1 str%?b\\t%1, %0" - [(set_attr "type" "*,*,load,store1") + [(set_attr "type" "*,*,load1,store1") (set_attr "predicable" "yes")] ) @@ -4650,7 +4683,7 @@ mov\\t%0, %1 mov\\t%0, %1" [(set_attr "length" "2") - (set_attr "type" "*,load,store1,*,*,*") + (set_attr "type" "*,load1,store1,*,*,*") (set_attr "pool_range" "*,32,*,*,*,*")] ) @@ -4679,7 +4712,7 @@ [(set (match_operand:SF 0 "nonimmediate_operand" "") (match_operand:SF 1 "immediate_operand" ""))] "TARGET_ARM - && !TARGET_HARD_FLOAT + && !(TARGET_HARD_FLOAT && TARGET_FPA) && reload_completed && GET_CODE (operands[1]) == CONST_DOUBLE" [(set (match_dup 2) (match_dup 3))] @@ -4695,7 +4728,6 @@ [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m") (match_operand:SF 1 "general_operand" "r,mE,r"))] "TARGET_ARM - && !TARGET_CIRRUS && TARGET_SOFT_FLOAT && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], SFmode))" @@ -4705,7 +4737,7 @@ str%?\\t%1, %0\\t%@ float" [(set_attr "length" "4,4,4") (set_attr "predicable" "yes") - (set_attr "type" "*,load,store1") + (set_attr "type" "*,load1,store1") (set_attr "pool_range" "*,4096,*") (set_attr "neg_pool_range" "*,4084,*")] ) @@ -4726,7 +4758,7 @@ mov\\t%0, %1 mov\\t%0, %1" [(set_attr "length" "2") - (set_attr "type" "*,load,store1,load,store1,*,*") + (set_attr "type" "*,load1,store1,load1,store1,*,*") (set_attr "pool_range" "*,*,*,1020,*,*,*")] ) @@ -4798,11 +4830,10 @@ [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=r,r,m") (match_operand:DF 1 "soft_df_operand" "r,mF,r"))] "TARGET_ARM && TARGET_SOFT_FLOAT - && !TARGET_CIRRUS " "* return output_move_double (operands);" [(set_attr "length" "8,8,8") - (set_attr "type" "*,load,store2") + (set_attr "type" "*,load2,store2") (set_attr "pool_range" "1020") (set_attr "neg_pool_range" "1008")] ) @@ -4843,7 +4874,7 @@ } " [(set_attr "length" "4,2,2,6,4,4") - (set_attr "type" "*,load,store2,load,store2,*") + (set_attr "type" "*,load2,store2,load2,store2,*") (set_attr "pool_range" "*,*,*,1020,*,*")] ) @@ -4916,7 +4947,7 @@ (mem:SI (plus:SI (match_dup 2) (const_int 12))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 5" "ldm%?ia\\t%1!, {%3, %4, %5, %6}" - [(set_attr "type" "load") + [(set_attr "type" "load4") (set_attr "predicable" "yes")] ) @@ -4933,7 +4964,7 @@ (mem:SI (plus:SI (match_dup 2) (const_int 8))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 4" "ldm%?ia\\t%1!, {%3, %4, %5}" - [(set_attr "type" "load") + [(set_attr "type" "load3") (set_attr "predicable" "yes")] ) @@ -4948,7 +4979,7 @@ (mem:SI (plus:SI (match_dup 2) (const_int 4))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 3" "ldm%?ia\\t%1!, {%3, %4}" - [(set_attr "type" "load") + [(set_attr "type" "load2") (set_attr "predicable" "yes")] ) @@ -4966,7 +4997,7 @@ (mem:SI (plus:SI (match_dup 1) (const_int 12))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 4" "ldm%?ia\\t%1, {%2, %3, %4, %5}" - [(set_attr "type" "load") + [(set_attr "type" "load4") (set_attr "predicable" "yes")] ) @@ -4980,7 +5011,7 @@ (mem:SI (plus:SI (match_dup 1) (const_int 8))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 3" "ldm%?ia\\t%1, {%2, %3, %4}" - [(set_attr "type" "load") + [(set_attr "type" "load3") (set_attr "predicable" "yes")] ) @@ -4992,7 +5023,7 @@ (mem:SI (plus:SI (match_dup 1) (const_int 4))))])] "TARGET_ARM && XVECLEN (operands[0], 0) == 2" "ldm%?ia\\t%1, {%2, %3}" - [(set_attr "type" "load") + [(set_attr "type" "load2") (set_attr "predicable" "yes")] ) @@ -6243,9 +6274,9 @@ (define_expand "cmpsf" [(match_operand:SF 0 "s_register_operand" "") (match_operand:SF 1 "fpa_rhs_operand" "")] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS && !cirrus_fp_register (operands[1], SFmode)) + if (TARGET_MAVERICK && !cirrus_fp_register (operands[1], SFmode)) operands[1] = force_reg (SFmode, operands[1]); arm_compare_op0 = operands[0]; @@ -6257,9 +6288,9 @@ (define_expand "cmpdf" [(match_operand:DF 0 "s_register_operand" "") (match_operand:DF 1 "fpa_rhs_operand" "")] - "TARGET_ARM && TARGET_ANY_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT" " - if (TARGET_CIRRUS && !cirrus_fp_register (operands[1], DFmode)) + if (TARGET_MAVERICK && !cirrus_fp_register (operands[1], DFmode)) operands[1] = force_reg (DFmode, operands[1]); arm_compare_op0 = operands[0]; @@ -6289,7 +6320,9 @@ "cmp%?\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*cmpsi_shiftsi_swp" @@ -6302,7 +6335,9 @@ "cmp%?\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*cmpsi_neg_shiftsi" @@ -6315,7 +6350,9 @@ "cmn%?\\t%0, %1%S3" [(set_attr "conds" "set") (set_attr "shift" "1") - ] + (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) ;; Cirrus SF compare instruction @@ -6323,7 +6360,7 @@ [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:SF 0 "cirrus_fp_register" "v") (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcmps%?\\tr15, %V0, %V1" [(set_attr "type" "mav_farith") (set_attr "cirrus" "compare")] @@ -6334,7 +6371,7 @@ [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:DF 0 "cirrus_fp_register" "v") (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcmpd%?\\tr15, %V0, %V1" [(set_attr "type" "mav_farith") (set_attr "cirrus" "compare")] @@ -6344,7 +6381,7 @@ (define_expand "cmpdi" [(match_operand:DI 0 "cirrus_fp_register" "") (match_operand:DI 1 "cirrus_fp_register" "")] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "{ arm_compare_op0 = operands[0]; arm_compare_op1 = operands[1]; @@ -6355,7 +6392,7 @@ [(set (reg:CC CC_REGNUM) (compare:CC (match_operand:DI 0 "cirrus_fp_register" "v") (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcmp64%?\\tr15, %V0, %V1" [(set_attr "type" "mav_farith") (set_attr "cirrus" "compare")] @@ -6473,7 +6510,7 @@ (if_then_else (unordered (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6483,7 +6520,7 @@ (if_then_else (ordered (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6493,7 +6530,7 @@ (if_then_else (ungt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0, arm_compare_op1);" ) @@ -6502,7 +6539,7 @@ (if_then_else (unlt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0, arm_compare_op1);" ) @@ -6511,7 +6548,7 @@ (if_then_else (unge (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0, arm_compare_op1);" ) @@ -6520,7 +6557,7 @@ (if_then_else (unle (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0, arm_compare_op1);" ) @@ -6531,7 +6568,7 @@ (if_then_else (uneq (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNEQ, arm_compare_op0, arm_compare_op1);" ) @@ -6540,7 +6577,7 @@ (if_then_else (ltgt (match_dup 1) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (LTGT, arm_compare_op0, arm_compare_op1);" ) @@ -6554,7 +6591,7 @@ (if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* if (arm_ccfsm_state != 0) abort (); @@ -6571,7 +6608,7 @@ (if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* if (arm_ccfsm_state != 0) abort (); @@ -6597,7 +6634,8 @@ } return \"b%d1\\t%l0\"; " - [(set_attr "conds" "use")] + [(set_attr "conds" "use") + (set_attr "type" "branch")] ) ; Special pattern to match reversed UNEQ. @@ -6606,7 +6644,7 @@ (if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* if (arm_ccfsm_state != 0) abort (); @@ -6623,7 +6661,7 @@ (if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* if (arm_ccfsm_state != 0) abort (); @@ -6649,7 +6687,8 @@ } return \"b%D1\\t%l0\"; " - [(set_attr "conds" "use")] + [(set_attr "conds" "use") + (set_attr "type" "branch")] ) @@ -6729,7 +6768,7 @@ (define_expand "sunordered" [(set (match_operand:SI 0 "s_register_operand" "") (unordered:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6737,7 +6776,7 @@ (define_expand "sordered" [(set (match_operand:SI 0 "s_register_operand" "") (ordered:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0, arm_compare_op1);" ) @@ -6745,7 +6784,7 @@ (define_expand "sungt" [(set (match_operand:SI 0 "s_register_operand" "") (ungt:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0, arm_compare_op1);" ) @@ -6753,7 +6792,7 @@ (define_expand "sunge" [(set (match_operand:SI 0 "s_register_operand" "") (unge:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0, arm_compare_op1);" ) @@ -6761,7 +6800,7 @@ (define_expand "sunlt" [(set (match_operand:SI 0 "s_register_operand" "") (unlt:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0, arm_compare_op1);" ) @@ -6769,7 +6808,7 @@ (define_expand "sunle" [(set (match_operand:SI 0 "s_register_operand" "") (unle:SI (match_dup 1) (const_int 0)))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0, arm_compare_op1);" ) @@ -6780,14 +6819,14 @@ ; (define_expand "suneq" ; [(set (match_operand:SI 0 "s_register_operand" "") ; (uneq:SI (match_dup 1) (const_int 0)))] -; "TARGET_ARM && TARGET_HARD_FLOAT" +; "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" ; "abort ();" ; ) ; ; (define_expand "sltgt" ; [(set (match_operand:SI 0 "s_register_operand" "") ; (ltgt:SI (match_dup 1) (const_int 0)))] -; "TARGET_ARM && TARGET_HARD_FLOAT" +; "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" ; "abort ();" ; ) @@ -6859,7 +6898,7 @@ /* When compiling for SOFT_FLOAT, ensure both arms are in registers. Otherwise, ensure it is a valid FP add operand */ - if ((!TARGET_HARD_FLOAT) + if ((!(TARGET_HARD_FLOAT && TARGET_FPA)) || (!fpa_add_operand (operands[3], SFmode))) operands[3] = force_reg (SFmode, operands[3]); @@ -6873,7 +6912,7 @@ (if_then_else:DF (match_operand 1 "arm_comparison_operator" "") (match_operand:DF 2 "s_register_operand" "") (match_operand:DF 3 "fpa_add_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" " { enum rtx_code code = GET_CODE (operands[1]); @@ -7239,7 +7278,7 @@ } return output_return_instruction (const_true_rtx, TRUE, FALSE); }" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "length" "12") (set_attr "predicable" "yes")] ) @@ -7262,7 +7301,7 @@ }" [(set_attr "conds" "use") (set_attr "length" "12") - (set_attr "type" "load")] + (set_attr "type" "load1")] ) (define_insn "*cond_return_inverted" @@ -7282,7 +7321,7 @@ return output_return_instruction (operands[0], TRUE, TRUE); }" [(set_attr "conds" "use") - (set_attr "type" "load")] + (set_attr "type" "load1")] ) ;; Generate a sequence of instructions to determine if the processor is @@ -7426,7 +7465,7 @@ (match_operand:SI 0 "memory_operand" "m"))] "TARGET_ARM" "ldr%?\\t%|pc, %0\\t%@ indirect memory jump" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "pool_range" "4096") (set_attr "neg_pool_range" "4084") (set_attr "predicable" "yes")] @@ -7472,7 +7511,9 @@ "%i1%?\\t%0, %2, %4%S3" [(set_attr "predicable" "yes") (set_attr "shift" "4") - ] + (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*arith_shiftsi_compare0" @@ -7490,7 +7531,9 @@ "%i1%?s\\t%0, %2, %4%S3" [(set_attr "conds" "set") (set_attr "shift" "4") - ] + (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*arith_shiftsi_compare0_scratch" @@ -7506,7 +7549,9 @@ "%i1%?s\\t%0, %2, %4%S3" [(set_attr "conds" "set") (set_attr "shift" "4") - ] + (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*sub_shiftsi" @@ -7519,7 +7564,9 @@ "sub%?\\t%0, %1, %3%S2" [(set_attr "predicable" "yes") (set_attr "shift" "3") - ] + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*sub_shiftsi_compare0" @@ -7536,8 +7583,10 @@ "TARGET_ARM" "sub%?s\\t%0, %1, %3%S2" [(set_attr "conds" "set") - (set_attr "shift" "3") - ] + (set_attr "shift" "3") + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*sub_shiftsi_compare0_scratch" @@ -7552,8 +7601,10 @@ "TARGET_ARM" "sub%?s\\t%0, %1, %3%S2" [(set_attr "conds" "set") - (set_attr "shift" "3") - ] + (set_attr "shift" "3") + (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) @@ -8388,7 +8439,10 @@ mvn%D5\\t%0, #%B1\;mov%d5\\t%0, %2%S4" [(set_attr "conds" "use") (set_attr "shift" "2") - (set_attr "length" "4,8,8")] + (set_attr "length" "4,8,8") + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*ifcompare_move_shift" @@ -8424,7 +8478,10 @@ mvn%d5\\t%0, #%B1\;mov%D5\\t%0, %2%S4" [(set_attr "conds" "use") (set_attr "shift" "2") - (set_attr "length" "4,8,8")] + (set_attr "length" "4,8,8") + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*ifcompare_shift_shift" @@ -8461,7 +8518,12 @@ "mov%d5\\t%0, %1%S6\;mov%D5\\t%0, %3%S7" [(set_attr "conds" "use") (set_attr "shift" "1") - (set_attr "length" "8")] + (set_attr "length" "8") + (set (attr "type") (if_then_else + (and (match_operand 2 "const_int_operand" "") + (match_operand 4 "const_int_operand" "")) + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) (define_insn "*ifcompare_not_arith" @@ -8662,7 +8724,7 @@ }" [(set_attr "length" "12") (set_attr "predicable" "yes") - (set_attr "type" "load")] + (set_attr "type" "load1")] ) ;; the arm can support extended pre-inc instructions @@ -8719,7 +8781,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?b\\t%3, [%0, %2]!" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8735,7 +8797,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?b\\t%3, [%0, -%2]!" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8752,7 +8814,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?b\\t%3, [%0, %2]!\\t%@ z_extendqisi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8769,7 +8831,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?b\\t%3, [%0, -%2]!\\t%@ z_extendqisi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8817,7 +8879,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?\\t%3, [%0, %2]!" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes")] ) @@ -8833,7 +8895,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?\\t%3, [%0, -%2]!" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes")] ) @@ -8852,7 +8914,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?\\t%3, [%0, %2]!\\t%@ loadhi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8871,7 +8933,7 @@ && (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" "ldr%?\\t%3, [%0, -%2]!\\t%@ loadhi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8925,7 +8987,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?b\\t%5, [%0, %3%S2]!" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8943,7 +9005,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?b\\t%5, [%0, -%3%S2]!" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -8997,7 +9059,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?\\t%5, [%0, %3%S2]!" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes")] ) @@ -9015,7 +9077,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?\\t%5, [%0, -%3%S2]!" - [(set_attr "type" "load") + [(set_attr "type" "load1") (set_attr "predicable" "yes")]) (define_insn "*loadhi_shiftpreinc" @@ -9035,7 +9097,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?\\t%5, [%0, %3%S2]!\\t%@ loadhi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -9056,7 +9118,7 @@ && REGNO (operands[1]) != FRAME_POINTER_REGNUM && REGNO (operands[3]) != FRAME_POINTER_REGNUM" "ldr%?\\t%5, [%0, -%3%S2]!\\t%@ loadhi" - [(set_attr "type" "load") + [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] ) @@ -9168,7 +9230,7 @@ (set (reg:CC CC_REGNUM) (compare:CC (match_dup 1) (const_int 0)))] "TARGET_ARM - && (!TARGET_CIRRUS + && (!(TARGET_HARD_FLOAT && TARGET_MAVERICK) || (!cirrus_fp_register (operands[0], SImode) && !cirrus_fp_register (operands[1], SImode))) " diff --git a/gcc/config/arm/arm1026ejs.md b/gcc/config/arm/arm1026ejs.md new file mode 100644 index 00000000000..5dd433269ac --- /dev/null +++ b/gcc/config/arm/arm1026ejs.md @@ -0,0 +1,241 @@ +;; ARM 1026EJ-S Pipeline Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Written by CodeSourcery, LLC. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GCC; see the file COPYING. If not, write to the Free +;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. */ + +;; These descriptions are based on the information contained in the +;; ARM1026EJ-S Technical Reference Manual, Copyright (c) 2003 ARM +;; Limited. +;; + +;; This automaton provides a pipeline description for the ARM +;; 1026EJ-S core. +;; +;; The model given here assumes that the condition for all conditional +;; instructions is "true", i.e., that all of the instructions are +;; actually executed. + +(define_automaton "arm1026ejs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipelines +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; There are two pipelines: +;; +;; - An Arithmetic Logic Unit (ALU) pipeline. +;; +;; The ALU pipeline has fetch, issue, decode, execute, memory, and +;; write stages. We only need to model the execute, memory and write +;; stages. +;; +;; - A Load-Store Unit (LSU) pipeline. +;; +;; The LSU pipeline has decode, execute, memory, and write stages. +;; We only model the execute, memory and write stages. + +(define_cpu_unit "a_e,a_m,a_w" "arm1026ejs") +(define_cpu_unit "l_e,l_m,l_w" "arm1026ejs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ALU Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ALU instructions require three cycles to execute, and use the ALU +;; pipeline in each of the three stages. The results are available +;; after the execute stage stage has finished. +;; +;; If the destination register is the PC, the pipelines are stalled +;; for several cycles. That case is not modeled here. + +;; ALU operations with no shifted operand +(define_insn_reservation "alu_op" 1 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "alu")) + "a_e,a_m,a_w") + +;; ALU operations with a shift-by-constant operand +(define_insn_reservation "alu_shift_op" 1 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "alu_shift")) + "a_e,a_m,a_w") + +;; ALU operations with a shift-by-register operand +;; These really stall in the decoder, in order to read +;; the shift value in a second cycle. Pretend we take two cycles in +;; the execute stage. +(define_insn_reservation "alu_shift_reg_op" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "alu_shift_reg")) + "a_e*2,a_m,a_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Multiplication Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Multiplication instructions loop in the execute stage until the +;; instruction has been passed through the multiplier array enough +;; times. + +;; The result of the "smul" and "smulw" instructions is not available +;; until after the memory stage. +(define_insn_reservation "mult1" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "smulxy,smulwy")) + "a_e,a_m,a_w") + +;; The "smlaxy" and "smlawx" instructions require two iterations through +;; the execute stage; the result is available immediately following +;; the execute stage. +(define_insn_reservation "mult2" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "smlaxy,smlalxy,smlawx")) + "a_e*2,a_m,a_w") + +;; The "smlalxy", "mul", and "mla" instructions require two iterations +;; through the execute stage; the result is not available until after +;; the memory stage. +(define_insn_reservation "mult3" 3 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "smlalxy,mul,mla")) + "a_e*2,a_m,a_w") + +;; The "muls" and "mlas" instructions loop in the execute stage for +;; four iterations in order to set the flags. The value result is +;; available after three iterations. +(define_insn_reservation "mult4" 3 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "muls,mlas")) + "a_e*4,a_m,a_w") + +;; Long multiply instructions that produce two registers of +;; output (such as umull) make their results available in two cycles; +;; the least significant word is available before the most significant +;; word. That fact is not modeled; instead, the instructions are +;; described.as if the entire result was available at the end of the +;; cycle in which both words are available. + +;; The "umull", "umlal", "smull", and "smlal" instructions all take +;; three iterations through the execute cycle, and make their results +;; available after the memory cycle. +(define_insn_reservation "mult5" 4 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "umull,umlal,smull,smlal")) + "a_e*3,a_m,a_w") + +;; The "umulls", "umlals", "smulls", and "smlals" instructions loop in +;; the execute stage for five iterations in order to set the flags. +;; The value result is vailable after four iterations. +(define_insn_reservation "mult6" 4 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "insn" "umulls,umlals,smulls,smlals")) + "a_e*5,a_m,a_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Load/Store Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; The models for load/store instructions do not accurately describe +;; the difference between operations with a base register writeback +;; (such as "ldm!"). These models assume that all memory references +;; hit in dcache. + +;; LSU instructions require six cycles to execute. They use the ALU +;; pipeline in all but the 5th cycle, and the LSU pipeline in cycles +;; three through six. +;; Loads and stores which use a scaled register offset or scaled +;; register pre-indexed addressing mode take three cycles EXCEPT for +;; those that are base + offset with LSL of 0 or 2, or base - offset +;; with LSL of zero. The remainder take 1 cycle to execute. +;; For 4byte loads there is a bypass from the load stage + +(define_insn_reservation "load1_op" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "load_byte,load1")) + "a_e+l_e,l_m,a_w+l_w") + +(define_insn_reservation "store1_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "store1")) + "a_e+l_e,l_m,a_w+l_w") + +;; A load's result can be stored by an immediately following store +(define_bypass 1 "load1_op" "store1_op" "arm_no_early_store_addr_dep") + +;; On a LDM/STM operation, the LSU pipeline iterates until all of the +;; registers have been processed. +;; +;; The time it takes to load the data depends on whether or not the +;; base address is 64-bit aligned; if it is not, an additional cycle +;; is required. This model assumes that the address is always 64-bit +;; aligned. Because the processor can load two registers per cycle, +;; that assumption means that we use the same instruction rservations +;; for loading 2k and 2k - 1 registers. +;; +;; The ALU pipeline is stalled until the completion of the last memory +;; stage in the LSU pipeline. That is modeled by keeping the ALU +;; execute stage busy until that point. +;; +;; As with ALU operations, if one of the destination registers is the +;; PC, there are additional stalls; that is not modeled. + +(define_insn_reservation "load2_op" 2 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "load2")) + "a_e+l_e,l_m,a_w+l_w") + +(define_insn_reservation "store2_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "store2")) + "a_e+l_e,l_m,a_w+l_w") + +(define_insn_reservation "load34_op" 3 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "load3,load4")) + "a_e+l_e,a_e+l_e+l_m,a_e+l_m,a_w+l_w") + +(define_insn_reservation "store34_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "store3,store4")) + "a_e+l_e,a_e+l_e+l_m,a_e+l_m,a_w+l_w") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Branch and Call Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Branch instructions are difficult to model accurately. The ARM +;; core can predict most branches. If the branch is predicted +;; correctly, and predicted early enough, the branch can be completely +;; eliminated from the instruction stream. Some branches can +;; therefore appear to require zero cycles to execute. We assume that +;; all branches are predicted correctly, and that the latency is +;; therefore the minimum value. + +(define_insn_reservation "branch_op" 0 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "branch")) + "nothing") + +;; The latency for a call is not predictable. Therefore, we use 32 as +;; roughly equivalent to postive infinity. + +(define_insn_reservation "call_op" 32 + (and (eq_attr "tune" "arm1026ejs") + (eq_attr "type" "call")) + "nothing") diff --git a/gcc/config/arm/arm1136jfs.md b/gcc/config/arm/arm1136jfs.md new file mode 100644 index 00000000000..acfce1b5681 --- /dev/null +++ b/gcc/config/arm/arm1136jfs.md @@ -0,0 +1,377 @@ +;; ARM 1136J[F]-S Pipeline Description +;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Written by CodeSourcery, LLC. +;; +;; This file is part of GCC. +;; +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GCC is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GCC; see the file COPYING. If not, write to the Free +;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA +;; 02111-1307, USA. */ + +;; These descriptions are based on the information contained in the +;; ARM1136JF-S Technical Reference Manual, Copyright (c) 2003 ARM +;; Limited. +;; + +;; This automaton provides a pipeline description for the ARM +;; 1136J-S and 1136JF-S cores. +;; +;; The model given here assumes that the condition for all conditional +;; instructions is "true", i.e., that all of the instructions are +;; actually executed. + +(define_automaton "arm1136jfs") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Pipelines +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; There are three distinct pipelines (page 1-26 and following): +;; +;; - A 4-stage decode pipeline, shared by all three. It has fetch (1), +;; fetch (2), decode, and issue stages. Since this is always involved, +;; we do not model it in the scheduler. +;; +;; - A 4-stage ALU pipeline. It has shifter, ALU (main integer operations), +;; and saturation stages. The fourth stage is writeback; see below. +;; +;; - A 4-stage multiply-accumulate pipeline. It has three stages, called +;; MAC1 through MAC3, and a fourth writeback stage. +;; +;; The 4th-stage writeback is shared between the ALU and MAC pipelines, +;; which operate in lockstep. Results from either pipeline will be +;; moved into the writeback stage. Because the two pipelines operate +;; in lockstep, we schedule them as a single "execute" pipeline. +;; +;; - A 4-stage LSU pipeline. It has address generation, data cache (1), +;; data cache (2), and writeback stages. (Note that this pipeline, +;; including the writeback stage, is independant from the ALU & LSU pipes.) + +(define_cpu_unit "e_1,e_2,e_3,e_wb" "arm1136jfs") ; ALU and MAC +; e_1 = Sh/Mac1, e_2 = ALU/Mac2, e_3 = SAT/Mac3 +(define_cpu_unit "l_a,l_dc1,l_dc2,l_wb" "arm1136jfs") ; Load/Store + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; ALU Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; ALU instructions require eight cycles to execute, and use the ALU +;; pipeline in each of the eight stages. The results are available +;; after the alu stage has finished. +;; +;; If the destination register is the PC, the pipelines are stalled +;; for several cycles. That case is not modelled here. + +;; ALU operations with no shifted operand +(define_insn_reservation "11_alu_op" 2 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "alu")) + "e_1,e_2,e_3,e_wb") + +;; ALU operations with a shift-by-constant operand +(define_insn_reservation "11_alu_shift_op" 2 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "alu_shift")) + "e_1,e_2,e_3,e_wb") + +;; ALU operations with a shift-by-register operand +;; These really stall in the decoder, in order to read +;; the shift value in a second cycle. Pretend we take two cycles in +;; the shift stage. +(define_insn_reservation "11_alu_shift_reg_op" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "alu_shift_reg")) + "e_1*2,e_2,e_3,e_wb") + +;; alu_ops can start sooner, if there is no shifter dependency +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_alu_op") +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_alu_op") +(define_bypass 2 "11_alu_shift_reg_op" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") + +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Multiplication Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; Multiplication instructions loop in the first two execute stages until +;; the instruction has been passed through the multiplier array enough +;; times. + +;; Multiply and multiply-accumulate results are available after four stages. +(define_insn_reservation "11_mult1" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "mul,mla")) + "e_1*2,e_2,e_3,e_wb") + +;; The *S variants set the condition flags, which requires three more cycles. +(define_insn_reservation "11_mult2" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "muls,mlas")) + "e_1*2,e_2,e_3,e_wb") + +(define_bypass 3 "11_mult1,11_mult2" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_mult1,11_mult2" + "11_alu_op") +(define_bypass 3 "11_mult1,11_mult2" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 3 "11_mult1,11_mult2" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 3 "11_mult1,11_mult2" + "11_store1" + "arm_no_early_store_addr_dep") + +;; Signed and unsigned multiply long results are available across two cycles; +;; the less significant word is available one cycle before the more significant +;; word. Here we conservatively wait until both are available, which is +;; after three iterations and the memory cycle. The same is also true of +;; the two multiply-accumulate instructions. +(define_insn_reservation "11_mult3" 5 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smull,umull,smlal,umlal")) + "e_1*3,e_2,e_3,e_wb*2") + +;; The *S variants set the condition flags, which requires three more cycles. +(define_insn_reservation "11_mult4" 5 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smulls,umulls,smlals,umlals")) + "e_1*3,e_2,e_3,e_wb*2") + +(define_bypass 4 "11_mult3,11_mult4" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 4 "11_mult3,11_mult4" + "11_alu_op") +(define_bypass 4 "11_mult3,11_mult4" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 4 "11_mult3,11_mult4" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 4 "11_mult3,11_mult4" + "11_store1" + "arm_no_early_store_addr_dep") + +;; Various 16x16->32 multiplies and multiply-accumulates, using combinations +;; of high and low halves of the argument registers. They take a single +;; pass through the pipeline and make the result available after three +;; cycles. +(define_insn_reservation "11_mult5" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smulxy,smlaxy,smulwy,smlawy,smuad,smuadx,smlad,smladx,smusd,smusdx,smlsd,smlsdx")) + "e_1,e_2,e_3,e_wb") + +(define_bypass 2 "11_mult5" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 2 "11_mult5" + "11_alu_op") +(define_bypass 2 "11_mult5" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 2 "11_mult5" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 2 "11_mult5" + "11_store1" + "arm_no_early_store_addr_dep") + +;; The same idea, then the 32-bit result is added to a 64-bit quantity. +(define_insn_reservation "11_mult6" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smlalxy")) + "e_1*2,e_2,e_3,e_wb*2") + +;; Signed 32x32 multiply, then the most significant 32 bits are extracted +;; and are available after the memory stage. +(define_insn_reservation "11_mult7" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "insn" "smmul,smmulr")) + "e_1*2,e_2,e_3,e_wb") + +(define_bypass 3 "11_mult6,11_mult7" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_mult6,11_mult7" + "11_alu_op") +(define_bypass 3 "11_mult6,11_mult7" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 3 "11_mult6,11_mult7" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") +(define_bypass 3 "11_mult6,11_mult7" + "11_store1" + "arm_no_early_store_addr_dep") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Branch Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; These vary greatly depending on their arguments and the results of +;; stat prediction. Cycle count ranges from zero (unconditional branch, +;; folded dynamic prediction) to seven (incorrect predictions, etc). We +;; assume an optimal case for now, because the cost of a cache miss +;; overwhelms the cost of everything else anyhow. + +(define_insn_reservation "11_branches" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "branch")) + "nothing") + +;; Call latencies are not predictable. A semi-arbitrary very large +;; number is used as "positive infinity" so that everything should be +;; finished by the time of return. +(define_insn_reservation "11_call" 32 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "call")) + "nothing") + +;; Branches are predicted. A correctly predicted branch will be no +;; cost, but we're conservative here, and use the timings a +;; late-register would give us. +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_branches") +(define_bypass 2 "11_alu_shift_reg_op" + "11_branches") +(define_bypass 2 "11_load1,11_load2" + "11_branches") +(define_bypass 3 "11_load34" + "11_branches") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Load/Store Instructions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; The models for load/store instructions do not accurately describe +;; the difference between operations with a base register writeback. +;; These models assume that all memory references hit in dcache. Also, +;; if the PC is one of the registers involved, there are additional stalls +;; not modelled here. Addressing modes are also not modelled. + +(define_insn_reservation "11_load1" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load1")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +;; Load byte results are not available until the writeback stage, where +;; the correct byte is extracted. + +(define_insn_reservation "11_loadb" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load_byte")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +(define_insn_reservation "11_store1" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "store1")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +;; Load/store double words into adjacent registers. The timing and +;; latencies are different depending on whether the address is 64-bit +;; aligned. This model assumes that it is. +(define_insn_reservation "11_load2" 3 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load2")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +(define_insn_reservation "11_store2" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "store2")) + "l_a+e_1,l_dc1,l_dc2,l_wb") + +;; Load/store multiple registers. Two registers are stored per cycle. +;; Actual timing depends on how many registers are affected, so we +;; optimistically schedule a low latency. +(define_insn_reservation "11_load34" 4 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "load3,load4")) + "l_a+e_1,l_dc1*2,l_dc2,l_wb") + +(define_insn_reservation "11_store34" 0 + (and (eq_attr "tune" "arm1136js,arm1136jfs") + (eq_attr "type" "store3,store4")) + "l_a+e_1,l_dc1*2,l_dc2,l_wb") + +;; A store can start immediately after an alu op, if that alu op does +;; not provide part of the address to access. +(define_bypass 1 "11_alu_op,11_alu_shift_op" + "11_store1" + "arm_no_early_store_addr_dep") +(define_bypass 2 "11_alu_shift_reg_op" + "11_store1" + "arm_no_early_store_addr_dep") + +;; An alu op can start sooner after a load, if that alu op does not +;; have an early register dependancy on the load +(define_bypass 2 "11_load1" + "11_alu_op") +(define_bypass 2 "11_load1" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 2 "11_load1" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") + +(define_bypass 3 "11_loadb" + "11_alu_op") +(define_bypass 3 "11_loadb" + "11_alu_shift_op" + "arm_no_early_alu_shift_value_dep") +(define_bypass 3 "11_loadb" + "11_alu_shift_reg_op" + "arm_no_early_alu_shift_dep") + +;; A mul op can start sooner after a load, if that mul op does not +;; have an early multiply dependency +(define_bypass 2 "11_load1" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_load34" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") +(define_bypass 3 "11_loadb" + "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7" + "arm_no_early_mul_dep") + +;; A store can start sooner after a load, if that load does not +;; produce part of the address to access +(define_bypass 2 "11_load1" + "11_store1" + "arm_no_early_store_addr_dep") +(define_bypass 3 "11_loadb" + "11_store1" + "arm_no_early_store_addr_dep") diff --git a/gcc/config/arm/cirrus.md b/gcc/config/arm/cirrus.md index 0da8469ddd2..9bd01be45cb 100644 --- a/gcc/config/arm/cirrus.md +++ b/gcc/config/arm/cirrus.md @@ -34,7 +34,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (plus:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:DI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfadd64%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -44,7 +44,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (plus:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfadd32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -54,7 +54,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (plus:SF (match_operand:SF 1 "cirrus_fp_register" "v") (match_operand:SF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfadds%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -64,7 +64,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (plus:DF (match_operand:DF 1 "cirrus_fp_register" "v") (match_operand:DF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfaddd%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -74,7 +74,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (minus:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:DI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsub64%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -84,7 +84,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (minus:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfsub32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -94,7 +94,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (minus:SF (match_operand:SF 1 "cirrus_fp_register" "v") (match_operand:SF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsubs%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -104,7 +104,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (minus:DF (match_operand:DF 1 "cirrus_fp_register" "v") (match_operand:DF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsubd%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -114,7 +114,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (mult:SI (match_operand:SI 2 "cirrus_fp_register" "v") (match_operand:SI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfmul32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -124,7 +124,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (mult:DI (match_operand:DI 2 "cirrus_fp_register" "v") (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmul64%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_dmult") (set_attr "cirrus" "normal")] @@ -136,7 +136,7 @@ (mult:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_fp_register" "v")) (match_operand:SI 3 "cirrus_fp_register" "0")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfmac32%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -149,7 +149,7 @@ (match_operand:SI 1 "cirrus_fp_register" "0") (mult:SI (match_operand:SI 2 "cirrus_fp_register" "v") (match_operand:SI 3 "cirrus_fp_register" "v"))))] - "0 && TARGET_ARM && TARGET_CIRRUS" + "0 && TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmsc32%?\\t%V0, %V2, %V3" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -159,7 +159,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (mult:SF (match_operand:SF 1 "cirrus_fp_register" "v") (match_operand:SF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmuls%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_farith") (set_attr "cirrus" "normal")] @@ -169,7 +169,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (mult:DF (match_operand:DF 1 "cirrus_fp_register" "v") (match_operand:DF 2 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmuld%?\\t%V0, %V1, %V2" [(set_attr "type" "mav_dmult") (set_attr "cirrus" "normal")] @@ -179,7 +179,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (ashift:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfsh32%?\\t%V0, %V1, #%s2" [(set_attr "cirrus" "normal")] ) @@ -188,7 +188,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (ashiftrt:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfsh32%?\\t%V0, %V1, #-%s2" [(set_attr "cirrus" "normal")] ) @@ -197,7 +197,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (ashift:SI (match_operand:SI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "register_operand" "r")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfrshl32%?\\t%V1, %V0, %s2" [(set_attr "cirrus" "normal")] ) @@ -206,7 +206,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (ashift:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "register_operand" "r")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfrshl64%?\\t%V1, %V0, %s2" [(set_attr "cirrus" "normal")] ) @@ -215,7 +215,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (ashift:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsh64%?\\t%V0, %V1, #%s2" [(set_attr "cirrus" "normal")] ) @@ -224,7 +224,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (ashiftrt:DI (match_operand:DI 1 "cirrus_fp_register" "v") (match_operand:SI 2 "cirrus_shift_const" "")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfsh64%?\\t%V0, %V1, #-%s2" [(set_attr "cirrus" "normal")] ) @@ -232,7 +232,7 @@ (define_insn "*cirrus_absdi2" [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (abs:DI (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfabs64%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -242,7 +242,7 @@ [(set (match_operand:DI 0 "cirrus_fp_register" "=v") (neg:DI (match_operand:DI 1 "cirrus_fp_register" "v"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfneg64%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -250,7 +250,7 @@ (define_insn "*cirrus_negsi2" [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (neg:SI (match_operand:SI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfneg32%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -258,7 +258,7 @@ (define_insn "*cirrus_negsf2" [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (neg:SF (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfnegs%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -266,7 +266,7 @@ (define_insn "*cirrus_negdf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (neg:DF (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfnegd%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -276,7 +276,7 @@ [(set (match_operand:SI 0 "cirrus_fp_register" "=v") (abs:SI (match_operand:SI 1 "cirrus_fp_register" "v"))) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM && TARGET_CIRRUS && 0" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0" "cfabs32%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -284,7 +284,7 @@ (define_insn "*cirrus_abssf2" [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (abs:SF (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfabss%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -292,7 +292,7 @@ (define_insn "*cirrus_absdf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (abs:DF (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfabsd%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -302,7 +302,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (float:SF (match_operand:SI 1 "s_register_operand" "r"))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmv64lr%?\\t%Z2, %1\;cfcvt32s%?\\t%V0, %Y2" [(set_attr "length" "8") (set_attr "cirrus" "move")] @@ -312,7 +312,7 @@ [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (float:DF (match_operand:SI 1 "s_register_operand" "r"))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfmv64lr%?\\t%Z2, %1\;cfcvt32d%?\\t%V0, %Y2" [(set_attr "length" "8") (set_attr "cirrus" "move")] @@ -321,14 +321,14 @@ (define_insn "floatdisf2" [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (float:SF (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvt64s%?\\t%V0, %V1" [(set_attr "cirrus" "normal")]) (define_insn "floatdidf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (float:DF (match_operand:DI 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvt64d%?\\t%V0, %V1" [(set_attr "cirrus" "normal")]) @@ -336,7 +336,7 @@ [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:SF (match_operand:SF 1 "cirrus_fp_register" "v")))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cftruncs32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2" [(set_attr "length" "8") (set_attr "cirrus" "normal")] @@ -346,7 +346,7 @@ [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:DF (match_operand:DF 1 "cirrus_fp_register" "v")))) (clobber (match_scratch:DF 2 "=v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cftruncd32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2" [(set_attr "length" "8")] ) @@ -355,7 +355,7 @@ [(set (match_operand:SF 0 "cirrus_fp_register" "=v") (float_truncate:SF (match_operand:DF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvtds%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -363,7 +363,7 @@ (define_insn "*cirrus_extendsfdf2" [(set (match_operand:DF 0 "cirrus_fp_register" "=v") (float_extend:DF (match_operand:SF 1 "cirrus_fp_register" "v")))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "cfcvtsd%?\\t%V0, %V1" [(set_attr "cirrus" "normal")] ) @@ -371,7 +371,7 @@ (define_insn "*cirrus_arm_movdi" [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,o<>,v,r,v,m,v") (match_operand:DI 1 "di_operand" "rIK,mi,r,r,v,m,v,v"))] - "TARGET_ARM && TARGET_CIRRUS" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK" "* { switch (which_alternative) @@ -394,7 +394,7 @@ } }" [(set_attr "length" " 8, 8, 8, 8, 8, 4, 4, 4") - (set_attr "type" " *,load,store2, *, *, load,store2, *") + (set_attr "type" " *,load2,store2, *, *, load2,store2, *") (set_attr "pool_range" " *,1020, *, *, *, *, *, *") (set_attr "neg_pool_range" " *,1012, *, *, *, *, *, *") (set_attr "cirrus" "not, not, not,move,normal,double,double,normal")] @@ -406,7 +406,7 @@ (define_insn "*cirrus_arm_movsi_insn" [(set (match_operand:SI 0 "general_operand" "=r,r,r,m,*v,r,*v,T,*v") (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,*v,T,*v,*v"))] - "TARGET_ARM && TARGET_CIRRUS && 0 + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0 && (register_operand (operands[0], SImode) || register_operand (operands[1], SImode))" "@ @@ -419,7 +419,7 @@ cfldr32%?\\t%V0, %1 cfstr32%?\\t%V1, %0 cfsh32%?\\t%V0, %V1, #0" - [(set_attr "type" "*, *, load,store1, *, *, load,store1, *") + [(set_attr "type" "*, *, load1,store1, *, *, load1,store1, *") (set_attr "pool_range" "*, *, 4096, *, *, *, 1024, *, *") (set_attr "neg_pool_range" "*, *, 4084, *, *, *, 1012, *, *") (set_attr "cirrus" "not,not, not, not,move,normal,normal,normal,normal")] @@ -428,7 +428,7 @@ (define_insn "*cirrus_movsf_hard_insn" [(set (match_operand:SF 0 "nonimmediate_operand" "=v,v,v,r,m,r,r,m") (match_operand:SF 1 "general_operand" "v,m,r,v,v,r,mE,r"))] - "TARGET_ARM && TARGET_CIRRUS + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], SFmode))" "@ @@ -441,7 +441,7 @@ ldr%?\\t%0, %1\\t%@ float str%?\\t%1, %0\\t%@ float" [(set_attr "length" " *, *, *, *, *, 4, 4, 4") - (set_attr "type" " *, load, *, *,store1, *,load,store1") + (set_attr "type" " *, load1, *, *,store1, *,load1,store1") (set_attr "pool_range" " *, *, *, *, *, *,4096, *") (set_attr "neg_pool_range" " *, *, *, *, *, *,4084, *") (set_attr "cirrus" "normal,normal,move,normal,normal,not, not, not")] @@ -451,7 +451,7 @@ [(set (match_operand:DF 0 "nonimmediate_operand" "=r,Q,r,m,r,v,v,v,r,m") (match_operand:DF 1 "general_operand" "Q,r,r,r,mF,v,m,r,v,v"))] "TARGET_ARM - && TARGET_CIRRUS + && TARGET_HARD_FLOAT && TARGET_MAVERICK && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], DFmode))" "* @@ -469,7 +469,7 @@ default: abort (); } }" - [(set_attr "type" "load,store2, *,store2,load, *, load, *, *,store2") + [(set_attr "type" "load1,store2, *,store2,load1, *, load1, *, *,store2") (set_attr "length" " 4, 4, 8, 8, 8, 4, 4, 8, 8, 4") (set_attr "pool_range" " *, *, *, *, 252, *, *, *, *, *") (set_attr "neg_pool_range" " *, *, *, *, 244, *, *, *, *, *") diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h index 581f7267900..e3f393aa9d9 100644 --- a/gcc/config/arm/elf.h +++ b/gcc/config/arm/elf.h @@ -46,7 +46,7 @@ #ifndef SUBTARGET_ASM_FLOAT_SPEC #define SUBTARGET_ASM_FLOAT_SPEC "\ -%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}" +%{mapcs-float:-mfloat}" #endif #ifndef ASM_SPEC @@ -58,6 +58,8 @@ %{mapcs-*:-mapcs-%*} \ %(subtarget_asm_float_spec) \ %{mthumb-interwork:-mthumb-interwork} \ +%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \ +%{mfloat-abi=*} %{mfpu=*} \ %(subtarget_extra_asm_spec)" #endif diff --git a/gcc/config/arm/fpa.md b/gcc/config/arm/fpa.md index 3b6efbfbbda..0c24f933f3c 100644 --- a/gcc/config/arm/fpa.md +++ b/gcc/config/arm/fpa.md @@ -101,7 +101,7 @@ [(set (match_operand:SF 0 "s_register_operand" "=f,f") (plus:SF (match_operand:SF 1 "s_register_operand" "%f,f") (match_operand:SF 2 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ adf%?s\\t%0, %1, %2 suf%?s\\t%0, %1, #%N2" @@ -113,7 +113,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f,f") (plus:DF (match_operand:DF 1 "s_register_operand" "%f,f") (match_operand:DF 2 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ adf%?d\\t%0, %1, %2 suf%?d\\t%0, %1, #%N2" @@ -126,7 +126,7 @@ (plus:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f,f")) (match_operand:DF 2 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ adf%?d\\t%0, %1, %2 suf%?d\\t%0, %1, #%N2" @@ -139,7 +139,7 @@ (plus:DF (match_operand:DF 1 "s_register_operand" "f") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "adf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -151,7 +151,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "adf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -161,7 +161,7 @@ [(set (match_operand:SF 0 "s_register_operand" "=f,f") (minus:SF (match_operand:SF 1 "fpa_rhs_operand" "f,G") (match_operand:SF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ suf%?s\\t%0, %1, %2 rsf%?s\\t%0, %2, %1" @@ -172,7 +172,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f,f") (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G") (match_operand:DF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ suf%?d\\t%0, %1, %2 rsf%?d\\t%0, %2, %1" @@ -185,7 +185,7 @@ (minus:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "suf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -196,7 +196,7 @@ (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f,f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ suf%?d\\t%0, %1, %2 rsf%?d\\t%0, %2, %1" @@ -210,7 +210,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "suf%?d\\t%0, %1, %2" [(set_attr "type" "farith") (set_attr "predicable" "yes")] @@ -220,7 +220,7 @@ [(set (match_operand:SF 0 "s_register_operand" "=f") (mult:SF (match_operand:SF 1 "s_register_operand" "f") (match_operand:SF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "fml%?s\\t%0, %1, %2" [(set_attr "type" "ffmul") (set_attr "predicable" "yes")] @@ -230,7 +230,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (mult:DF (match_operand:DF 1 "s_register_operand" "f") (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -241,7 +241,7 @@ (mult:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -252,7 +252,7 @@ (mult:DF (match_operand:DF 1 "s_register_operand" "f") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -263,7 +263,7 @@ (mult:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "muf%?d\\t%0, %1, %2" [(set_attr "type" "fmul") (set_attr "predicable" "yes")] @@ -275,7 +275,7 @@ [(set (match_operand:SF 0 "s_register_operand" "=f,f") (div:SF (match_operand:SF 1 "fpa_rhs_operand" "f,G") (match_operand:SF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ fdv%?s\\t%0, %1, %2 frd%?s\\t%0, %2, %1" @@ -287,7 +287,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f,f") (div:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G") (match_operand:DF 2 "fpa_rhs_operand" "fG,f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ dvf%?d\\t%0, %1, %2 rdf%?d\\t%0, %2, %1" @@ -300,7 +300,7 @@ (div:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "dvf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -311,7 +311,7 @@ (div:DF (match_operand:DF 1 "fpa_rhs_operand" "fG") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rdf%?d\\t%0, %2, %1" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -323,7 +323,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "dvf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -333,7 +333,7 @@ [(set (match_operand:SF 0 "s_register_operand" "=f") (mod:SF (match_operand:SF 1 "s_register_operand" "f") (match_operand:SF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?s\\t%0, %1, %2" [(set_attr "type" "fdivs") (set_attr "predicable" "yes")] @@ -343,7 +343,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (mod:DF (match_operand:DF 1 "s_register_operand" "f") (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -354,7 +354,7 @@ (mod:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) (match_operand:DF 2 "fpa_rhs_operand" "fG")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -365,7 +365,7 @@ (mod:DF (match_operand:DF 1 "s_register_operand" "f") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -377,7 +377,7 @@ (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "rmf%?d\\t%0, %1, %2" [(set_attr "type" "fdivd") (set_attr "predicable" "yes")] @@ -386,7 +386,7 @@ (define_insn "*negsf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (neg:SF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mnf%?s\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -395,7 +395,7 @@ (define_insn "*negdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (neg:DF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mnf%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -405,7 +405,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (neg:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mnf%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -414,7 +414,7 @@ (define_insn "*abssf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (abs:SF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "abs%?s\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -423,7 +423,7 @@ (define_insn "*absdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (abs:DF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "abs%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -433,7 +433,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (abs:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "abs%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -442,7 +442,7 @@ (define_insn "*sqrtsf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (sqrt:SF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "sqt%?s\\t%0, %1" [(set_attr "type" "float_em") (set_attr "predicable" "yes")] @@ -451,7 +451,7 @@ (define_insn "*sqrtdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (sqrt:DF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "sqt%?d\\t%0, %1" [(set_attr "type" "float_em") (set_attr "predicable" "yes")] @@ -461,7 +461,7 @@ [(set (match_operand:DF 0 "s_register_operand" "=f") (sqrt:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "sqt%?d\\t%0, %1" [(set_attr "type" "float_em") (set_attr "predicable" "yes")] @@ -470,7 +470,7 @@ (define_insn "*floatsisf2_fpa" [(set (match_operand:SF 0 "s_register_operand" "=f") (float:SF (match_operand:SI 1 "s_register_operand" "r")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "flt%?s\\t%0, %1" [(set_attr "type" "r_2_f") (set_attr "predicable" "yes")] @@ -479,7 +479,7 @@ (define_insn "*floatsidf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (float:DF (match_operand:SI 1 "s_register_operand" "r")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "flt%?d\\t%0, %1" [(set_attr "type" "r_2_f") (set_attr "predicable" "yes")] @@ -488,7 +488,7 @@ (define_insn "*fix_truncsfsi2_fpa" [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "fix%?z\\t%0, %1" [(set_attr "type" "f_2_r") (set_attr "predicable" "yes")] @@ -497,7 +497,7 @@ (define_insn "*fix_truncdfsi2_fpa" [(set (match_operand:SI 0 "s_register_operand" "=r") (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "fix%?z\\t%0, %1" [(set_attr "type" "f_2_r") (set_attr "predicable" "yes")] @@ -507,7 +507,7 @@ [(set (match_operand:SF 0 "s_register_operand" "=f") (float_truncate:SF (match_operand:DF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mvf%?s\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -516,7 +516,7 @@ (define_insn "*extendsfdf2_fpa" [(set (match_operand:DF 0 "s_register_operand" "=f") (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "mvf%?d\\t%0, %1" [(set_attr "type" "ffarith") (set_attr "predicable" "yes")] @@ -526,7 +526,7 @@ [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f, m,f,r,r,r, m") (match_operand:SF 1 "general_operand" "fG,H,mE,f,r,f,r,mE,r"))] "TARGET_ARM - && TARGET_HARD_FLOAT + && TARGET_HARD_FLOAT && TARGET_FPA && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], SFmode))" "@ @@ -542,7 +542,7 @@ [(set_attr "length" "4,4,4,4,8,8,4,4,4") (set_attr "predicable" "yes") (set_attr "type" - "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load,store1") + "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load1,store1") (set_attr "pool_range" "*,*,1024,*,*,*,*,4096,*") (set_attr "neg_pool_range" "*,*,1012,*,*,*,*,4084,*")] ) @@ -553,7 +553,7 @@ (match_operand:DF 1 "general_operand" "Q, r,r,r,mF,fG,H,mF,f,r, f"))] "TARGET_ARM - && TARGET_HARD_FLOAT + && TARGET_HARD_FLOAT && TARGET_FPA && (GET_CODE (operands[0]) != MEM || register_operand (operands[1], DFmode))" "* @@ -576,7 +576,7 @@ [(set_attr "length" "4,4,8,8,8,4,4,4,4,8,8") (set_attr "predicable" "yes") (set_attr "type" - "load,store2,*,store2,load,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r") + "load1,store2,*,store2,load1,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r") (set_attr "pool_range" "*,*,*,*,1020,*,*,1024,*,*,*") (set_attr "neg_pool_range" "*,*,*,*,1008,*,*,1008,*,*,*")] ) @@ -589,7 +589,7 @@ (define_insn "*movxf_fpa" [(set (match_operand:XF 0 "nonimmediate_operand" "=f,f,f,m,f,r,r") (match_operand:XF 1 "general_operand" "fG,H,m,f,r,f,r"))] - "TARGET_ARM && TARGET_HARD_FLOAT && reload_completed" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA && reload_completed" "* switch (which_alternative) { @@ -614,7 +614,7 @@ [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:SF 0 "s_register_operand" "f,f") (match_operand:SF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?\\t%0, %1 cnf%?\\t%0, #%N1" @@ -626,7 +626,7 @@ [(set (reg:CCFP CC_REGNUM) (compare:CCFP (match_operand:DF 0 "s_register_operand" "f,f") (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?\\t%0, %1 cnf%?\\t%0, #%N1" @@ -639,7 +639,7 @@ (compare:CCFP (float_extend:DF (match_operand:SF 0 "s_register_operand" "f,f")) (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?\\t%0, %1 cnf%?\\t%0, #%N1" @@ -652,7 +652,7 @@ (compare:CCFP (match_operand:DF 0 "s_register_operand" "f") (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "cmf%?\\t%0, %1" [(set_attr "conds" "set") (set_attr "type" "f_2_r")] @@ -662,7 +662,7 @@ [(set (reg:CCFPE CC_REGNUM) (compare:CCFPE (match_operand:SF 0 "s_register_operand" "f,f") (match_operand:SF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?e\\t%0, %1 cnf%?e\\t%0, #%N1" @@ -674,7 +674,7 @@ [(set (reg:CCFPE CC_REGNUM) (compare:CCFPE (match_operand:DF 0 "s_register_operand" "f,f") (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?e\\t%0, %1 cnf%?e\\t%0, #%N1" @@ -687,7 +687,7 @@ (compare:CCFPE (float_extend:DF (match_operand:SF 0 "s_register_operand" "f,f")) (match_operand:DF 1 "fpa_add_operand" "fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ cmf%?e\\t%0, %1 cnf%?e\\t%0, #%N1" @@ -700,7 +700,7 @@ (compare:CCFPE (match_operand:DF 0 "s_register_operand" "f") (float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "cmf%?e\\t%0, %1" [(set_attr "conds" "set") (set_attr "type" "f_2_r")] @@ -713,7 +713,7 @@ [(match_operand 4 "cc_register" "") (const_int 0)]) (match_operand:SF 1 "fpa_add_operand" "0,0,fG,H,fG,fG,H,H") (match_operand:SF 2 "fpa_add_operand" "fG,H,0,0,fG,H,fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ mvf%D3s\\t%0, %2 mnf%D3s\\t%0, #%N2 @@ -735,7 +735,7 @@ [(match_operand 4 "cc_register" "") (const_int 0)]) (match_operand:DF 1 "fpa_add_operand" "0,0,fG,H,fG,fG,H,H") (match_operand:DF 2 "fpa_add_operand" "fG,H,0,0,fG,H,fG,H")))] - "TARGET_ARM && TARGET_HARD_FLOAT" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "@ mvf%D3d\\t%0, %2 mnf%D3d\\t%0, #%N2 diff --git a/gcc/config/arm/iwmmxt.md b/gcc/config/arm/iwmmxt.md index f8070a88594..6c87500093e 100644 --- a/gcc/config/arm/iwmmxt.md +++ b/gcc/config/arm/iwmmxt.md @@ -86,7 +86,7 @@ } }" [(set_attr "length" "8,8,8,4,4,4,4,4") - (set_attr "type" "*,load,store2,*,*,*,*,*") + (set_attr "type" "*,load1,store2,*,*,*,*,*") (set_attr "pool_range" "*,1020,*,*,*,*,*,*") (set_attr "neg_pool_range" "*,1012,*,*,*,*,*,*")] ) @@ -110,7 +110,7 @@ case 7: return \"wstrw\\t%1, %0\"; default:return \"wstrw\\t%1, [sp, #-4]!\;wldrw\\t%0, [sp], #4\\t@move CG reg\"; }" - [(set_attr "type" "*,*,load,store1,*,*,load,store1,*") + [(set_attr "type" "*,*,load1,store1,*,*,load1,store1,*") (set_attr "length" "*,*,*, *,*,*, 16, *,8") (set_attr "pool_range" "*,*,4096, *,*,*,1024, *,*") (set_attr "neg_pool_range" "*,*,4084, *,*,*, *, 1012,*") @@ -148,7 +148,7 @@ case 4: return \"tmcr%?\\t%0, %1\"; default: return \"tmrc%?\\t%0, %1\"; }" - [(set_attr "type" "*,*,load,store1,*,*") + [(set_attr "type" "*,*,load1,store1,*,*") (set_attr "pool_range" "*,*,4096, *,*,*") (set_attr "neg_pool_range" "*,*,4084, *,*,*")] ) @@ -169,7 +169,7 @@ }" [(set_attr "predicable" "yes") (set_attr "length" "4, 4, 4,4,4, 8") - (set_attr "type" "*,store1,load,*,*,load") + (set_attr "type" "*,store1,load1,*,*,load1") (set_attr "pool_range" "*, *, 256,*,*, 256") (set_attr "neg_pool_range" "*, *, 244,*,*, 244")]) @@ -189,7 +189,7 @@ }" [(set_attr "predicable" "yes") (set_attr "length" "4, 4, 4,4,4, 8") - (set_attr "type" "*,store1,load,*,*,load") + (set_attr "type" "*,store1,load1,*,*,load1") (set_attr "pool_range" "*, *, 256,*,*, 256") (set_attr "neg_pool_range" "*, *, 244,*,*, 244")]) @@ -209,7 +209,7 @@ }" [(set_attr "predicable" "yes") (set_attr "length" "4, 4, 4,4,4, 24") - (set_attr "type" "*,store1,load,*,*,load") + (set_attr "type" "*,store1,load1,*,*,load1") (set_attr "pool_range" "*, *, 256,*,*, 256") (set_attr "neg_pool_range" "*, *, 244,*,*, 244")]) @@ -225,7 +225,7 @@ "* return output_move_double (operands);" [(set_attr "predicable" "yes") (set_attr "length" "8") - (set_attr "type" "load") + (set_attr "type" "load1") (set_attr "pool_range" "256") (set_attr "neg_pool_range" "244")]) @@ -1149,7 +1149,7 @@ "wsrawg%?\\t%0, %1, %2" [(set_attr "predicable" "yes")]) -(define_insn "ashrdi3" +(define_insn "ashrdi3_iwmmxt" [(set (match_operand:DI 0 "register_operand" "=y") (ashiftrt:DI (match_operand:DI 1 "register_operand" "y") (match_operand:SI 2 "register_operand" "z")))] @@ -1173,7 +1173,7 @@ "wsrlwg%?\\t%0, %1, %2" [(set_attr "predicable" "yes")]) -(define_insn "lshrdi3" +(define_insn "lshrdi3_iwmmxt" [(set (match_operand:DI 0 "register_operand" "=y") (lshiftrt:DI (match_operand:DI 1 "register_operand" "y") (match_operand:SI 2 "register_operand" "z")))] diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm index fe14070e812..ce8551abc27 100644 --- a/gcc/config/arm/lib1funcs.asm +++ b/gcc/config/arm/lib1funcs.asm @@ -230,6 +230,25 @@ pc .req r15 /* ------------------------------------------------------------------------ */ .macro ARM_DIV_BODY dividend, divisor, result, curbit +#if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__) + + clz \curbit, \dividend + clz \result, \divisor + sub \curbit, \result, \curbit + rsbs \curbit, \curbit, #31 + addne \curbit, \curbit, \curbit, lsl #1 + mov \result, #0 + addne pc, pc, \curbit, lsl #2 + nop + .set shift, 32 + .rept 32 + .set shift, shift - 1 + cmp \dividend, \divisor, lsl #shift + adc \result, \result, \result + subcs \dividend, \dividend, \divisor, lsl #shift + .endr + +#else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ #if __ARM_ARCH__ >= 5 clz \curbit, \divisor @@ -240,7 +259,7 @@ pc .req r15 mov \curbit, \curbit, lsl \result mov \result, #0 -#else +#else /* __ARM_ARCH__ < 5 */ @ Initially shift the divisor left 3 bits if possible, @ set curbit accordingly. This allows for curbit to be located @@ -271,7 +290,7 @@ pc .req r15 mov \result, #0 -#endif +#endif /* __ARM_ARCH__ < 5 */ @ Division loop 1: cmp \dividend, \divisor @@ -291,6 +310,8 @@ pc .req r15 movne \divisor, \divisor, lsr #4 bne 1b +#endif /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ + .endm /* ------------------------------------------------------------------------ */ .macro ARM_DIV2_ORDER divisor, order @@ -325,6 +346,22 @@ pc .req r15 /* ------------------------------------------------------------------------ */ .macro ARM_MOD_BODY dividend, divisor, order, spare +#if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__) + + clz \order, \divisor + clz \spare, \dividend + sub \order, \order, \spare + rsbs \order, \order, #31 + addne pc, pc, \order, lsl #3 + nop + .set shift, 32 + .rept 32 + .set shift, shift - 1 + cmp \dividend, \divisor, lsl #shift + subcs \dividend, \dividend, \divisor, lsl #shift + .endr + +#else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ #if __ARM_ARCH__ >= 5 clz \order, \divisor @@ -332,7 +369,7 @@ pc .req r15 sub \order, \order, \spare mov \divisor, \divisor, lsl \order -#else +#else /* __ARM_ARCH__ < 5 */ mov \order, #0 @@ -354,7 +391,7 @@ pc .req r15 addlo \order, \order, #1 blo 1b -#endif +#endif /* __ARM_ARCH__ < 5 */ @ Perform all needed substractions to keep only the reminder. @ Do comparisons in batch of 4 first. @@ -391,6 +428,9 @@ pc .req r15 4: cmp \dividend, \divisor subhs \dividend, \dividend, \divisor 5: + +#endif /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */ + .endm /* ------------------------------------------------------------------------ */ .macro THUMB_DIV_MOD_BODY modulo diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h index f55a42562cb..594d8fd6854 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -52,7 +52,7 @@ %{shared:-lc} \ %{!shared:%{profile:-lc_p}%{!profile:-lc}}" -#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc" +#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add the GNU/Linux magical crtbegin.o file (see crtstuff.c) which diff --git a/gcc/config/arm/netbsd-elf.h b/gcc/config/arm/netbsd-elf.h index a8b43f645d3..d1661ec5fe3 100644 --- a/gcc/config/arm/netbsd-elf.h +++ b/gcc/config/arm/netbsd-elf.h @@ -57,14 +57,11 @@ #define SUBTARGET_EXTRA_ASM_SPEC \ "-matpcs %{fpic|fpie:-k} %{fPIC|fPIE:-k}" -/* Default floating point model is soft-VFP. - FIXME: -mhard-float currently implies FPA. */ +/* Default to full VFP if -mhard-float is specified. */ #undef SUBTARGET_ASM_FLOAT_SPEC #define SUBTARGET_ASM_FLOAT_SPEC \ - "%{mhard-float:-mfpu=fpa} \ - %{msoft-float:-mfpu=softvfp} \ - %{!mhard-float: \ - %{!msoft-float:-mfpu=softvfp}}" + "%{mhard-float:{!mfpu=*:-mfpu=vfp}} \ + %{mfloat-abi=hard:{!mfpu=*:-mfpu=vfp}}" #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ @@ -171,3 +168,7 @@ do \ (void) sysarch (0, &s); \ } \ while (0) + +#undef FPUTYPE_DEFAULT +#define FPUTYPE_DEFAULT FPUTYPE_VFP + diff --git a/gcc/config/arm/semi.h b/gcc/config/arm/semi.h index 8847f8c2369..0c9dadc208f 100644 --- a/gcc/config/arm/semi.h +++ b/gcc/config/arm/semi.h @@ -64,7 +64,8 @@ %{mcpu=*:-mcpu=%*} \ %{march=*:-march=%*} \ %{mapcs-float:-mfloat} \ -%{msoft-float:-mfpu=softfpa} \ +%{msoft-float:-mfloat-abi=soft} %{mhard-float:mfloat-abi=hard} \ +%{mfloat-abi=*} %{mfpu=*} \ %{mthumb-interwork:-mthumb-interwork} \ %(subtarget_extra_asm_spec)" #endif diff --git a/gcc/config/i386/scodbx.h b/gcc/config/i386/scodbx.h deleted file mode 100644 index 7da93053256..00000000000 --- a/gcc/config/i386/scodbx.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Definitions for Intel 386 running SCO Unix System V, - using dbx-in-coff encapsulation. - Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "i386/svr3dbx.h" - -/* Overridden defines for SCO systems from sco.h. */ - -/* By default, target has a 80387, uses IEEE compatible arithmetic, - and returns float values in the 387, ie, - (TARGET_80387 | TARGET_FLOAT_RETURNS_IN_80387) - - SCO's software emulation of a 387 fails to handle the `fucomp' - opcode. fucomp is only used when generating IEEE compliant code. - So don't make TARGET_IEEE_FP default for SCO. */ - -#undef TARGET_SUBTARGET_DEFAULT -#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_FLOAT_RETURNS) - -/* Use crt1.o as a startup file and crtn.o as a closing file. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\ - %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}" - -/* Library spec, including SCO international language support. */ - -#undef LIB_SPEC -#define LIB_SPEC \ - "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} %{scointl:libintl.a%s} -lc" - -/* Specify predefined symbols in preprocessor. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -DM_UNIX -DM_I386 -DM_COFF -DM_WORDSWAP -Asystem=svr3" - -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{scointl:-DM_INTERNAT}" - -/* This spec is used for telling cpp whether char is signed or not. */ - -#undef SIGNED_CHAR_SPEC -#if DEFAULT_SIGNED_CHAR -#define SIGNED_CHAR_SPEC \ - "%{funsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" -#else -#define SIGNED_CHAR_SPEC \ - "%{!fsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" -#endif - -/* caller has to pop the extra argument passed to functions that return - structures. */ - -#undef RETURN_POPS_ARGS -#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ - : (TARGET_RTD \ - && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ - || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ - == void_type_node))) ? (SIZE) \ - : 0) -/* On other 386 systems, the last line looks like this: - : (aggregate_value_p (TREE_TYPE (FUNTYPE))) ? GET_MODE_SIZE (Pmode) : 0) */ - -/* Handle #pragma pack. */ -#define HANDLE_SYSV_PRAGMA diff --git a/gcc/config/i386/xm-dgux.h b/gcc/config/i386/xm-dgux.h deleted file mode 100644 index 881c5c7be9d..00000000000 --- a/gcc/config/i386/xm-dgux.h +++ /dev/null @@ -1,4 +0,0 @@ -/* Configuration for GCC for Intel i386 running DG/ux */ - -/* looks just like sysv4 for now */ -#include "xm-svr4.h" diff --git a/gcc/config/i386/xm-sun.h b/gcc/config/i386/xm-sun.h deleted file mode 100644 index 6c0f0a25630..00000000000 --- a/gcc/config/i386/xm-sun.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Configuration for GNU C-compiler for Intel 80386 running SunOS 4.0. - Copyright (C) 1988, 1997 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#define USG diff --git a/gcc/config/i386/xm-sysv3.h b/gcc/config/i386/xm-sysv3.h deleted file mode 100644 index 9a655443ff5..00000000000 --- a/gcc/config/i386/xm-sysv3.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Configuration for GCC for Intel i386 running System V Release 3. */ - -#include "xm-svr3.h" diff --git a/gcc/config/mips/irix6-libc-compat.c b/gcc/config/mips/irix6-libc-compat.c deleted file mode 100644 index 47c72a8ec86..00000000000 --- a/gcc/config/mips/irix6-libc-compat.c +++ /dev/null @@ -1,82 +0,0 @@ -/* Compensate for inconsistent structure return conventions on IRIX 6. */ -/* Compile this one with gcc. */ -/* Copyright (C) 2001 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -In addition to the permissions in the GNU General Public License, the -Free Software Foundation gives you unlimited permission to link the -compiled version of this file into combinations with other programs, -and to distribute those combinations without any restriction coming -from the use of this file. (The General Public License restrictions -do apply in other respects; for example, they cover modification of -the file, and distribution when not linked into a combine -executable.) - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* GCC doesn't correctly implement the structure and union return - conventions of the N32 and N64 ABIs on IRIX 6, as described in the - MIPSpro N32 ABI Handbook, ch. 2, Calling Convention Implementations, p.7. - The ABI requires that structures (or trailing parts of structures) smaller - than 8 bytes (a 64-bit register) are left-justified, whereas GCC - right-justifies them. - - While GCC is internally consistent, calling routines compiled with a - compiler that does implement the documented ABI (like SGIs MIPSpro C - compiler) doesn't work. This is primarily an issue for system libraries - like libc. Fortunately, there exist only very few routines that return - structures by value, so until the underlying bug is fixed, it is possible - to work around it by providing wrappers for the few affected routines. - - These wrappers rely on the fact that e.g. libc contains weak versions of - those routines, and the real implementation is provided by _-prefixed - variants. So we can provide our own versions, which will only be linked - if the application uses any of the affected functions, calling the private - variants and then shifting the result as required. - - This is a rewrite of code created by Andy Polyakov. */ - -#include "config.h" -#include "system.h" -#include "coretypes.h" -#include "tm.h" - -/* This must only be used for the N32 and N64 ABIs. O32 is correct. */ - -#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 - -/* The affected return values need to be shifted by - - BITS_PER_WORD - (sizeof (value) * BITS_PER_UNIT). - - Since only 32-bit results are involved, the shift count is always 32. */ -#define SHIFT_BITS 32 - -extern machreg_t _inet_makeaddr (machreg_t, machreg_t); - -/* <arpa/inet.h> has - - struct in_addr inet_makeaddr (int, int); (IRIX 6.2) - struct in_addr inet_makeaddr (in_addr_t, in_addr_t); (IRIX 6.5) */ - -machreg_t -inet_makeaddr (machreg_t net, machreg_t lna) -{ - return _inet_makeaddr (net, lna) >> SHIFT_BITS; -} - -#endif /* _ABIN32 || _ABI64 */ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 2387ea7d367..6b74274b18c 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -10736,11 +10736,7 @@ rs6000_ra_ever_killed (void) rtx reg; rtx insn; - /* Irritatingly, there are two kinds of thunks -- those created with - TARGET_ASM_OUTPUT_MI_THUNK and those with DECL_THUNK_P that go - through the regular part of the compiler. This is a very hacky - way to tell them apart. */ - if (current_function_is_thunk && !no_new_pseudos) + if (current_function_is_thunk) return 0; /* regs_ever_live has LR marked as used if any sibcalls are present, diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0b7e80975b9..4345919570b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2003-11-05 Mark Mitchell <mark@codesourcery.com> + + * decl.c (cxx_push_function_context): Do not set + current_function_is_thunk. + * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the + actual function. + 2003-10-26 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> PR c++/10371 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 2bd6ff335bc..5365b0bf896 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11128,8 +11128,6 @@ cxx_push_function_context (struct function * f) { tree fn = f->decl; - current_function_is_thunk = DECL_THUNK_P (fn); - if (DECL_SAVED_FUNCTION_DATA (fn)) { /* If we already parsed this function, and we're just expanding it diff --git a/gcc/cp/method.c b/gcc/cp/method.c index c6651e84880..1b6153e203b 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -480,6 +480,7 @@ use_thunk (tree thunk_fndecl, bool emit_p) t = tree_cons (NULL_TREE, a, t); t = nreverse (t); t = build_call (alias, t); + CALL_FROM_THUNK_P (t) = 1; if (!this_adjusting) t = thunk_adjust (t, /*this_adjusting=*/0, fixed_offset, virtual_offset); diff --git a/gcc/dbxstclass.h b/gcc/dbxstclass.h deleted file mode 100644 index 2d003fed3bb..00000000000 --- a/gcc/dbxstclass.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Storage classes in XCOFF object file format designed for DBX's use. - This info is from the `Files Reference' manual for IBM's AIX version 3 - for the RS6000. */ - -#define C_GSYM 0x80 -#define C_LSYM 0x81 -#define C_PSYM 0x82 -#define C_RSYM 0x83 -#define C_RPSYM 0x84 -#define C_STSYM 0x85 - -#define C_BCOMM 0x87 -#define C_ECOML 0x88 -#define C_ECOMM 0x89 -#define C_DECL 0x8c -#define C_ENTRY 0x8d -#define C_FUN 0x8e diff --git a/gcc/doc/.cvsignore b/gcc/doc/.cvsignore deleted file mode 100644 index 169b3ef6992..00000000000 --- a/gcc/doc/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -*.info* -gcc.1 -cpp.1 -gcov.1 -gfdl.7 -gpl.7 -fsf-funding.7 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index f5f59382371..709f42dc1dc 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -375,9 +375,9 @@ in the following sections. -msched-prolog -mno-sched-prolog @gol -mlittle-endian -mbig-endian -mwords-little-endian @gol -malignment-traps -mno-alignment-traps @gol --msoft-float -mhard-float -mfpe @gol +-mfloat-abi=@var{name} soft-float -mhard-float -mfpe @gol -mthumb-interwork -mno-thumb-interwork @gol --mcpu=@var{name} -march=@var{name} -mfpe=@var{name} @gol +-mcpu=@var{name} -march=@var{name} -mfpu=@var{name} @gol -mstructure-size-boundary=@var{n} @gol -mabort-on-noreturn @gol -mlong-calls -mno-long-calls @gol @@ -6578,6 +6578,16 @@ this option. In particular, you need to compile @file{libgcc.a}, the library that comes with GCC, with @option{-msoft-float} in order for this to work. +@item -mfloat-abi=@var{name} +@opindex mfloat-abi +Specifies which ABI to use for floating point values. Permissible values +are: @samp{soft}, @samp{softfp} and @samp{hard}. + +@samp{soft} and @samp{hard} are equivalent to @option{-msoft-float} +and @option{-mhard-float} respectively. @samp{softfp} allows the generation +of floating point instructions, but still uses the soft-float calling +conventions. + @item -mlittle-endian @opindex mlittle-endian Generate code for a processor running in little-endian mode. This is @@ -6679,13 +6689,20 @@ of the @option{-mcpu=} option. Permissible names are: @samp{armv2}, @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6j}, @samp{iwmmxt}, @samp{ep9312}. -@item -mfpe=@var{number} +@item -mfpu=@var{name} +@itemx -mfpe=@var{number} @itemx -mfp=@var{number} +@opindex mfpu @opindex mfpe @opindex mfp -This specifies the version of the floating point emulation available on -the target. Permissible values are 2 and 3. @option{-mfp=} is a synonym -for @option{-mfpe=}, for compatibility with older versions of GCC@. +This specifies what floating point hardware (or hardware emulation) is +available on the target. Permissible names are: @samp{fpa}, @samp{fpe2}, +@samp{fpe3}, @samp{maverick}, @samp{vfp}. @option{-mfp} and @option{-mfpe} +are synonyms for @option{-mpfu}=@samp{fpe}@var{number}, for compatibility +with older versions of GCC@. + +If @option{-msoft-float} is specified this specifies the format of +floating point values. @item -mstructure-size-boundary=@var{n} @opindex mstructure-size-boundary diff --git a/gcc/doschk.c b/gcc/doschk.c deleted file mode 100644 index d024efc14ce..00000000000 --- a/gcc/doschk.c +++ /dev/null @@ -1,360 +0,0 @@ -/* -** DosFCheck - check file names for DOS consistency -** -** Distribute freely, it only encourages DOS compatibility! -** - DJ Delorie -*/ - -/* This file is not part of GCC. */ - -#include <stdio.h> -#ifdef __MSDOS__ -#include <alloc.h> -#else -#include <malloc.h> -#endif -#include <ctype.h> -#include <string.h> - -typedef struct ENT -{ - struct ENT *next; - char *dos_name; - char *full_name; - char *path; - int tagged; -} ENT; - -ENT *eroot = 0; - -int first_inv = 1; -int first_msg = 1; - -/****************************************************************\ - * Utility routines * -\****************************************************************/ - -void -invalid_msg () -{ - if (first_inv) - { - if (first_msg) - first_msg = 0; - else - putchar ('\n'); - printf ("The following files are not valid DOS file names:\n"); - first_inv = 0; - } -} - -ENT * -alloc_ent () -{ - ENT *rv = (ENT *)malloc (sizeof (ENT)); - if (rv == 0) - { - fprintf (stderr, "Unable to allocate memory for an ENT\n"); - exit (1); - } - memset (rv, 0, sizeof (ENT)); - return rv; -} - -void -fill_ent (ent, path) -ENT *ent; -char *path; -{ - char *first = path; - char *null = path+strlen (path); - char *last_slash = strrchr (path, '/'); - char *cp, *dp; - int dots_seen, chars_seen; - - if (last_slash+1 == null) - { - * --null = '\0'; - last_slash = strrchr (path, '/'); - } - - if (!last_slash) - { - last_slash = first-1; - } - - if (null-last_slash < 13) - ent->dos_name = (char *)malloc (null-last_slash); - else - ent->dos_name = (char *)malloc (13); - ent->full_name = (char *)malloc (null-last_slash); - ent->path = (char *)malloc (last_slash-first+1); - - strcpy (ent->full_name, last_slash+1); - if (last_slash > first) - { - strncpy (ent->path, first, last_slash-first); - ent->path[last_slash-first] = '\0'; - } - else - *ent->path = '\0'; - - cp = last_slash+1; - dp = ent->dos_name; - dots_seen = 0; - chars_seen = 0; - while (1) - { - if (! *cp) - break; - switch (*cp) - { - case '.': - if (cp == last_slash+1 && strcmp (last_slash+1, ".")) - { - invalid_msg (); - printf ("%s - file name cannot start with dot\n", path); - *dp = 0; - break; - } - if (dots_seen == 1) - { - invalid_msg (); - printf ("%s - too many dots\n", path); - *dp = '\0'; - break; - } - *dp++ = '.'; - chars_seen = 0; - dots_seen++; - break; - case '"': - case '*': - case '+': - case ',': - case ';': - case '<': - case '=': - case '>': - case '?': - case '[': - case '\\': - case ']': - case '|': - invalid_msg (); - printf ("%s - invalid character `%c'\n", path, *cp); - *dp++ = '?'; - chars_seen++; - break; - default: - if (dots_seen) - { - if (chars_seen >= 3) - break; - } - else - if (chars_seen >= 8) - break; - if ((*cp <= ' ') || (*cp >= 0x7f)) - { - invalid_msg (); - printf ("%s - invalid character `%c'\n", path, *cp); - *dp++ = '?'; - chars_seen++; - break; - } - if (islower (*cp)) - *dp++ = toupper (*cp); - else - *dp++ = *cp; - chars_seen++; - break; - } - cp++; - } - *dp++ = '\0'; -} - -int -compare_ent_dosname (e1, e2) -ENT **e1; -ENT **e2; -{ - int r = strcmp ((*e1)->dos_name, (*e2)->dos_name); - if (r == 0) - r = strcmp ((*e1)->path, (*e2)->path); - if (r == 0) - r = strcmp ((*e1)->full_name, (*e2)->full_name); - return r; -} - -int -compare_ent_fullname (e1, e2) -ENT **e1; -ENT **e2; -{ - int r = strncmp ((*e1)->full_name, (*e2)->full_name, 14); - if (r == 0) - r = strcmp ((*e1)->path, (*e2)->path); - if (r == 0) - r = strcmp ((*e1)->full_name, (*e2)->full_name); - return r; -} - -char * -mpath (ent) -ENT *ent; -{ - static char buf[500]; - if (ent->path && ent->path[0]) - sprintf (buf, "%s/%s", ent->path, ent->full_name); - else - return ent->full_name; - return buf; -} - -/****************************************************************\ - * List handling routines * -\****************************************************************/ - -void -add_ent (ent) -ENT *ent; -{ - ent->next = eroot; - eroot = ent; -} - -void -handle_input (line) -char *line; -{ - ENT *ent = alloc_ent (); - fill_ent (ent, line); - add_ent (ent); -} - -void -display_problems () -{ - ENT **elist, *ent; - int ecount, i, first, first_err; - - for (ecount=0, ent=eroot; ent; ent=ent->next, ecount++); - elist = (ENT **)malloc (sizeof (ENT *) * ecount); - for (ecount=0, ent=eroot; ent; ent=ent->next, ecount++) - elist[ecount] = ent; - - qsort (elist, ecount, sizeof (ENT *), compare_ent_dosname); - - first = 1; - first_err = 1; - for (i=0; i<ecount-1; i++) - { - if ((strcmp (elist[i]->dos_name, elist[i+1]->dos_name) == 0) - && (strcmp (elist[i]->path, elist[i+1]->path) == 0)) - { - if (first_err) - { - if (first_msg) - first_msg = 0; - else - putchar ('\n'); - printf ("The following resolve to the same DOS file names:\n"); - first_err = 0; - } - if (first) - { - printf ("%14s : %s\n", elist[i]->dos_name, mpath (elist[i])); - first = 0; - } - printf ("\t\t %s\n", mpath (elist[i+1])); - } - else - first = 1; - } - - qsort (elist, ecount, sizeof (ENT *), compare_ent_fullname); - - first = 1; - first_err = 1; - for (i=0; i<ecount-1; i++) - { - if ((strncmp (elist[i]->full_name, elist[i+1]->full_name, 14) == 0) - && (strcmp (elist[i]->path, elist[i+1]->path) == 0)) - { - if (first_err) - { - if (first_msg) - first_msg = 0; - else - putchar ('\n'); - printf ("The following resolve to the same SysV file names:\n"); - first_err = 0; - } - if (first) - { - printf ("%.14s : %s\n", elist[i]->full_name, mpath (elist[i])); - first = 0; - elist[i]->tagged = 1; - } - printf ("\t\t %s\n", mpath (elist[i+1])); - elist[i+1]->tagged = 1; - } - else - first = 1; - } - - first_err = 1; - for (i=0; i<ecount; i++) - { - if ((strlen (elist[i]->full_name) > 14) && !elist[i]->tagged) - { - if (first_err) - { - if (first_msg) - first_msg = 0; - else - putchar ('\n'); - printf ("The following file names are too long for SysV:\n"); - first_err = 0; - } - printf ("%.14s : %s\n", elist[i]->full_name, mpath (elist[i])); - } - } -} - -/****************************************************************\ - * Main entry point * -\****************************************************************/ - -main (argc, argv) -int argc; -char **argv; -{ - FILE *input = stdin; - if (argc > 1) - { - input = fopen (argv[1], "r"); - if (!input) - { - perror (argv[1]); - exit (1); - } - } - while (1) - { - char line[500]; - char *lp; - fgets (line, 500, input); - if (feof (input)) - break; - lp = line+strlen (line); - while ((lp != line) && (*lp <= ' ')) - lp--; - lp[1] = 0; - handle_input (line); - } - display_problems (); -} - diff --git a/gcc/f/.cvsignore b/gcc/f/.cvsignore deleted file mode 100644 index ef942f0cd74..00000000000 --- a/gcc/f/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -g77.info* -g77.1 diff --git a/gcc/function.h b/gcc/function.h index 9c06d95a095..7bdf8e137ff 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -455,9 +455,10 @@ struct function GTY(()) /* Nonzero if the function being compiled issues a computed jump. */ unsigned int has_computed_jump : 1; - /* Nonzero if the current function is a thunk (a lightweight function that - just adjusts one of its arguments and forwards to another function), so - we should try to cut corners where we can. */ + /* Nonzero if the current function is a thunk, i.e., a lightweight + function implemented by the output_mi_thunk hook) that just + adjusts one of its arguments and forwards to another + function. */ unsigned int is_thunk : 1; /* This bit is used by the exception handling logic. It is set if all diff --git a/gcc/future.options b/gcc/future.options deleted file mode 100644 index 6654dd0b84e..00000000000 --- a/gcc/future.options +++ /dev/null @@ -1,40 +0,0 @@ -From: friedman@gnu.ai.mit.edu (Noah Friedman) -To: roland@gnu.ai.mit.edu (Roland McGrath), - rms@gnu.ai.mit.edu (Richard Stallman), - jimb@gnu.ai.mit.edu (Jim Blandy), - mib@gnu.ai.mit.edu (Michael Bushnell) -Cc: cgw@sol.acs.unt.edu (chris williams), - clc@gnu.ai.mit.edu (Christian Longshore Claiborn) -Subject: Some gcc options we'd like to see. -Date: Mon, 28 Jun 93 00:45:09 EST -Reply-To: friedman@gnu.ai.mit.edu - --Waggravate-return --Wcast-spell --Wcaste-align --Win --Wmissing-protons --Wredundant-repetitions --antsy --fbungee-jump --fexpensive-operations --fextra-strength --fjesus-saves --fkeep-programmers-inline --fno-peeping-toms --fruit-roll-ups --fshort-enough --mno-dialogue --pedophile --vomit-frame-pointer - -From: Alexandre Oliva <aoliva@redhat.com> -Date: 06 Jan 2002 17:37:07 -0200 - -On Jan 2, 2002, in a long, heated thread concerning the interpretation -of certain passages of the C standard, jtv <jtv@xs4all.nl> wrote: - -> (Yes, I'm a pedant. I'm pining for the day when gcc will support the -> options "-ffascist -Wanal") - -How about introducing the options `-flame -War' :-) diff --git a/gcc/java/.cvsignore b/gcc/java/.cvsignore deleted file mode 100644 index dab65347a77..00000000000 --- a/gcc/java/.cvsignore +++ /dev/null @@ -1,10 +0,0 @@ -parse.c -parse-scan.c -gcj.info* -gcj.1 -gcjh.1 -jv-scan.1 -jcf-dump.1 -gij.1 -jv-convert.1 -rmic.1 rmiregistry.1 diff --git a/gcc/objc/.cvsignore b/gcc/objc/.cvsignore deleted file mode 100644 index 040661a9677..00000000000 --- a/gcc/objc/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -objc-parse.y -objc-parse.c diff --git a/gcc/ssa-ccp.c b/gcc/ssa-ccp.c deleted file mode 100644 index 7ff305a9d3d..00000000000 --- a/gcc/ssa-ccp.c +++ /dev/null @@ -1,1206 +0,0 @@ -/* Conditional constant propagation pass for the GNU compiler. - Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - Original framework by Daniel Berlin <dan@cgsoftware.com> - Fleshed out and major cleanups by Jeff Law <law@redhat.com> - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* Conditional constant propagation. - - References: - - Constant propagation with conditional branches, - Wegman and Zadeck, ACM TOPLAS 13(2):181-210. - - Building an Optimizing Compiler, - Robert Morgan, Butterworth-Heinemann, 1998, Section 8.9. - - Advanced Compiler Design and Implementation, - Steven Muchnick, Morgan Kaufmann, 1997, Section 12.6 - - The overall structure is as follows: - - 1. Run a simple SSA based DCE pass to remove any dead code. - 2. Run CCP to compute what registers are known constants - and what edges are not executable. Remove unexecutable - edges from the CFG and simplify PHI nodes. - 3. Replace registers with constants where possible. - 4. Remove unreachable blocks computed in step #2. - 5. Another simple SSA DCE pass to remove dead code exposed - by CCP. - - When we exit, we are still in SSA form. - - - Potential further enhancements: - - 1. Handle SUBREGs, STRICT_LOW_PART, etc in destinations more - gracefully. - - 2. Handle insns with multiple outputs more gracefully. - - 3. Handle CONST_DOUBLE and symbolic constants. - - 4. Fold expressions after performing constant substitutions. */ - - -#include "config.h" -#include "system.h" -#include "coretypes.h" -#include "tm.h" - -#include "rtl.h" -#include "hard-reg-set.h" -#include "basic-block.h" -#include "ssa.h" -#include "insn-config.h" -#include "recog.h" -#include "output.h" -#include "errors.h" -#include "ggc.h" -#include "df.h" -#include "function.h" - -/* Possible lattice values. */ - -typedef enum -{ - UNDEFINED, - CONSTANT, - VARYING -} latticevalue; - -/* Main structure for CCP. - - Contains the lattice value and, if it's a constant, the constant - value. */ -typedef struct -{ - latticevalue lattice_val; - rtx const_value; -} value; - -/* Array of values indexed by register number. */ -static value *values; - -/* A bitmap to keep track of executable blocks in the CFG. */ -static sbitmap executable_blocks; - -/* A bitmap for all executable edges in the CFG. */ -static sbitmap executable_edges; - -/* Array of edges on the work list. */ -static edge *edge_info; - -/* We need an edge list to be able to get indexes easily. */ -static struct edge_list *edges; - -/* For building/following use-def and def-use chains. */ -static struct df *df_analyzer; - -/* Current edge we are operating on, from the worklist */ -static edge flow_edges; - -/* Bitmap of SSA edges which will need reexamination as their definition - has changed. */ -static sbitmap ssa_edges; - -/* Simple macros to simplify code */ -#define SSA_NAME(x) REGNO (SET_DEST (x)) -#define EIE(x,y) EDGE_INDEX (edges, x, y) - -static void visit_phi_node (rtx, basic_block); -static void visit_expression (rtx, basic_block); -static void defs_to_undefined (rtx); -static void defs_to_varying (rtx); -static void examine_flow_edges (void); -static int mark_references (rtx *, void *); -static void follow_def_use_chains (void); -static void optimize_unexecutable_edges (struct edge_list *, sbitmap); -static void ssa_ccp_substitute_constants (void); -static void ssa_ccp_df_delete_unreachable_insns (void); -static void ssa_fast_dce (struct df *); - -/* Loop through the PHI_NODE's parameters for BLOCK and compare their - lattice values to determine PHI_NODE's lattice value. */ -static void -visit_phi_node (rtx phi_node, basic_block block) -{ - unsigned int i; - rtx phi_node_expr = NULL; - unsigned int phi_node_name = SSA_NAME (PATTERN (phi_node)); - latticevalue phi_node_lattice_val = UNDEFINED; - rtx pat = PATTERN (phi_node); - rtvec phi_vec = XVEC (SET_SRC (pat), 0); - unsigned int num_elem = GET_NUM_ELEM (phi_vec); - - for (i = 0; i < num_elem; i += 2) - { - if (TEST_BIT (executable_edges, - EIE (BASIC_BLOCK (INTVAL (RTVEC_ELT (phi_vec, i + 1))), - block))) - { - unsigned int current_parm - = REGNO (RTVEC_ELT (phi_vec, i)); - - latticevalue current_parm_lattice_val - = values[current_parm].lattice_val; - - /* If any node is VARYING, then new value of PHI_NODE - is VARYING. */ - if (current_parm_lattice_val == VARYING) - { - phi_node_lattice_val = VARYING; - phi_node_expr = NULL; - break; - } - - /* If we have more than one distinct constant, then the new - value of PHI_NODE is VARYING. */ - if (current_parm_lattice_val == CONSTANT - && phi_node_lattice_val == CONSTANT - && values[current_parm].const_value != phi_node_expr) - { - phi_node_lattice_val = VARYING; - phi_node_expr = NULL; - break; - } - - /* If the current value of PHI_NODE is UNDEFINED and one - node in PHI_NODE is CONSTANT, then the new value of the - PHI is that CONSTANT. Note this can turn into VARYING - if we find another distinct constant later. */ - if (phi_node_lattice_val == UNDEFINED - && phi_node_expr == NULL - && current_parm_lattice_val == CONSTANT) - { - phi_node_expr = values[current_parm].const_value; - phi_node_lattice_val = CONSTANT; - continue; - } - } - } - - /* If the value of PHI_NODE changed, then we will need to - re-execute uses of the output of PHI_NODE. */ - if (phi_node_lattice_val != values[phi_node_name].lattice_val) - { - values[phi_node_name].lattice_val = phi_node_lattice_val; - values[phi_node_name].const_value = phi_node_expr; - SET_BIT (ssa_edges, phi_node_name); - } -} - -/* Sets all defs in an insn to UNDEFINED. */ -static void -defs_to_undefined (rtx insn) -{ - struct df_link *currdef; - for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef; - currdef = currdef->next) - { - if (values[DF_REF_REGNO (currdef->ref)].lattice_val != UNDEFINED) - SET_BIT (ssa_edges, DF_REF_REGNO (currdef->ref)); - values[DF_REF_REGNO (currdef->ref)].lattice_val = UNDEFINED; - } -} - -/* Sets all defs in an insn to VARYING. */ -static void -defs_to_varying (rtx insn) -{ - struct df_link *currdef; - for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef; - currdef = currdef->next) - { - if (values[DF_REF_REGNO (currdef->ref)].lattice_val != VARYING) - SET_BIT (ssa_edges, DF_REF_REGNO (currdef->ref)); - values[DF_REF_REGNO (currdef->ref)].lattice_val = VARYING; - } -} - -/* Go through the expression, call the appropriate evaluation routines - to attempt cprop */ -static void -visit_expression (rtx insn, basic_block block) -{ - rtx src, dest, set; - - - /* Ugh. CALL_INSNs may end a basic block and have multiple edges - leading out from them. - - Mark all the outgoing edges as executable, then fall into the - normal processing below. */ - if (GET_CODE (insn) == CALL_INSN && block->end == insn) - { - edge curredge; - - for (curredge = block->succ; curredge; - curredge = curredge->succ_next) - { - int index = EIE (curredge->src, curredge->dest); - - if (TEST_BIT (executable_edges, index)) - continue; - - SET_BIT (executable_edges, index); - edge_info[index] = flow_edges; - flow_edges = curredge; - } - } - - set = single_set (insn); - if (! set) - { - defs_to_varying (insn); - return; - } - - src = SET_SRC (set); - dest = SET_DEST (set); - - /* We may want to refine this some day. */ - if (GET_CODE (dest) != REG && dest != pc_rtx) - { - defs_to_varying (insn); - return; - } - - /* Hard registers are not put in SSA form and thus we must consider - them varying. All the more reason to avoid hard registers in - RTL until as late as possible in the compilation. */ - if (GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER) - { - defs_to_varying (insn); - return; - } - - /* If this is assigning DEST to a constant, record that fact. */ - if (GET_CODE (src) == CONST_INT && GET_CODE (insn) == INSN) - { - unsigned int resultreg = REGNO (dest); - - values[resultreg].lattice_val = CONSTANT; - values[resultreg].const_value = SET_SRC (PATTERN (insn)); - SET_BIT (ssa_edges, resultreg); - } - - /* If this is a copy operation, then we can copy the lattice values. */ - else if (GET_CODE (src) == REG && GET_CODE (dest) == REG) - { - unsigned int old_value = REGNO (src); - latticevalue old_lattice_value = values[old_value].lattice_val; - unsigned int new_value = REGNO (dest); - - /* Unless the lattice value is going to change, don't bother - adding the "new value" into the worklist. */ - if (values[new_value].lattice_val != old_lattice_value - || values[new_value].const_value != values[old_value].const_value) - SET_BIT (ssa_edges, new_value); - - /* Copy the old lattice node info into the new value lattice node. */ - values[new_value].lattice_val = old_lattice_value; - values[new_value].const_value = values[old_value].const_value; - } - - /* Handle jumps. */ - else if (GET_CODE (insn) == JUMP_INSN) - { - rtx x = pc_set (insn); - if (GET_CODE (src) != IF_THEN_ELSE) - { - edge curredge; - - /* This is a computed jump, table jump, or an unconditional - jump. For all these cases we want to mark all successor - blocks as executable if they have not already been - marked. - - One day we may try do better with switch tables and - other computed jumps. */ - for (curredge = block->succ; curredge; - curredge = curredge->succ_next) - { - int index = EIE (curredge->src, curredge->dest); - - if (TEST_BIT (executable_edges, index)) - continue; - - SET_BIT (executable_edges, index); - edge_info[index] = flow_edges; - flow_edges = curredge; - } - } - else - { - edge curredge; - enum rtx_code comparison_code; - rtx comparison_src0; - rtx comparison_src1; - - comparison_code = GET_CODE (XEXP (src, 0)); - comparison_src0 = XEXP (XEXP (src, 0), 0); - comparison_src1 = XEXP (XEXP (src, 0), 1); - - /* If either operand is undefined, then there is nothing to - do right now. If/when operands are later defined we will - revaluate the condition and take the appropriate action. */ - if ((GET_CODE (comparison_src0) == REG - && values[REGNO (comparison_src0)].lattice_val == UNDEFINED) - || (GET_CODE (comparison_src1) == REG - && values[REGNO (comparison_src1)].lattice_val == UNDEFINED)) - return; - - /* If either operand is varying, then we must consider all - paths as executable. */ - if ((GET_CODE (comparison_src0) == REG - && values[REGNO (comparison_src0)].lattice_val == VARYING) - || (GET_CODE (comparison_src1) == REG - && values[REGNO (comparison_src1)].lattice_val == VARYING)) - { - for (curredge = block->succ; curredge; - curredge = curredge->succ_next) - { - int index = EIE (curredge->src, curredge->dest); - - if (TEST_BIT (executable_edges, index)) - continue; - - SET_BIT (executable_edges, index); - edge_info[index] = flow_edges; - flow_edges = curredge; - } - return; - } - - /* Try to simplify the comparison. */ - if (GET_CODE (comparison_src0) == REG - && values[REGNO (comparison_src0)].lattice_val == CONSTANT) - comparison_src0 = values[REGNO (comparison_src0)].const_value; - - if (GET_CODE (comparison_src1) == REG - && values[REGNO (comparison_src1)].lattice_val == CONSTANT) - comparison_src1 = values[REGNO (comparison_src1)].const_value; - - x = simplify_ternary_operation (IF_THEN_ELSE, - VOIDmode, - GET_MODE (XEXP (src, 0)), - gen_rtx (comparison_code, - GET_MODE (XEXP (src, 0)), - comparison_src0, - comparison_src1), - XEXP (src, 1), - XEXP (src, 2)); - - /* Walk through all the outgoing edges from this block and see - which (if any) we should mark as executable. */ - for (curredge = block->succ; curredge; - curredge = curredge->succ_next) - { - int index = EIE (curredge->src, curredge->dest); - - if (TEST_BIT (executable_edges, index)) - continue; - - /* If we were unable to simplify the expression at this - point, it's highly unlikely we'll be able to simplify - it later. So consider all edges as executable if the - expression did not simplify. - - If the expression simplified to (pc), then we know we - will take the fall-thru edge, so mark it. Similarly, - if the expression simplified to (label_ref ...), then - we know the branch will be taken and we mark that - edge as taken. */ - if (!x - || (x == pc_rtx - && (curredge->flags & EDGE_FALLTHRU)) - || (GET_CODE (x) == LABEL_REF - && ! (curredge->flags & EDGE_FALLTHRU))) - { - SET_BIT (executable_edges, index); - edge_info[index] = flow_edges; - flow_edges = curredge; - } - } - } - } - else if (!PHI_NODE_P (insn)) - { - rtx simplified = NULL; - - /* We've got some kind of INSN. If it's simple, try to evaluate - it and record the results. - - We already know this insn is a single_set and that it sets - a pseudo register. So we just need to extract the source - arguments, simplify them to constants if possible, then - simplify the expression as a whole if possible. */ - switch (GET_RTX_CLASS (GET_CODE (src))) - { - case '<': - { - rtx src0 = XEXP (src, 0); - rtx src1 = XEXP (src, 1); - enum machine_mode mode; - - /* If either is undefined, then the result is undefined. */ - if ((GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == UNDEFINED) - || (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == UNDEFINED)) - { - defs_to_undefined (insn); - break; - } - - /* Determine the mode for the operation before we simplify - our arguments to constants. */ - mode = GET_MODE (src0); - if (mode == VOIDmode) - mode = GET_MODE (src1); - - /* Simplify source operands to whatever known values they - may have. */ - if (GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == CONSTANT) - src0 = values[REGNO (src0)].const_value; - - if (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == CONSTANT) - src1 = values[REGNO (src1)].const_value; - - /* See if the simplifier can determine if this operation - computes a constant value. */ - simplified = simplify_relational_operation (GET_CODE (src), - mode, src0, src1); - break; - - } - - case '1': - { - rtx src0 = XEXP (src, 0); - enum machine_mode mode0 = GET_MODE (src0); - - /* If the operand is undefined, then the result is undefined. */ - if (GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == UNDEFINED) - { - defs_to_undefined (insn); - break; - } - - /* Simplify source operands to whatever known values they - may have. */ - if (GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == CONSTANT) - src0 = values[REGNO (src0)].const_value; - - /* See if the simplifier can determine if this operation - computes a constant value. */ - simplified = simplify_unary_operation (GET_CODE (src), - GET_MODE (src), - src0, - mode0); - break; - } - - case '2': - case 'c': - { - rtx src0 = XEXP (src, 0); - rtx src1 = XEXP (src, 1); - - /* If either is undefined, then the result is undefined. */ - if ((GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == UNDEFINED) - || (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == UNDEFINED)) - { - defs_to_undefined (insn); - break; - } - - /* Simplify source operands to whatever known values they - may have. */ - if (GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == CONSTANT) - src0 = values[REGNO (src0)].const_value; - - if (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == CONSTANT) - src1 = values[REGNO (src1)].const_value; - - /* See if the simplifier can determine if this operation - computes a constant value. */ - simplified = simplify_binary_operation (GET_CODE (src), - GET_MODE (src), - src0, src1); - break; - } - - case '3': - case 'b': - { - rtx src0 = XEXP (src, 0); - rtx src1 = XEXP (src, 1); - rtx src2 = XEXP (src, 2); - - /* If either is undefined, then the result is undefined. */ - if ((GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == UNDEFINED) - || (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == UNDEFINED) - || (GET_CODE (src2) == REG - && values[REGNO (src2)].lattice_val == UNDEFINED)) - { - defs_to_undefined (insn); - break; - } - - /* Simplify source operands to whatever known values they - may have. */ - if (GET_CODE (src0) == REG - && values[REGNO (src0)].lattice_val == CONSTANT) - src0 = values[REGNO (src0)].const_value; - - if (GET_CODE (src1) == REG - && values[REGNO (src1)].lattice_val == CONSTANT) - src1 = values[REGNO (src1)].const_value; - - if (GET_CODE (src2) == REG - && values[REGNO (src2)].lattice_val == CONSTANT) - src2 = values[REGNO (src2)].const_value; - - /* See if the simplifier can determine if this operation - computes a constant value. */ - simplified = simplify_ternary_operation (GET_CODE (src), - GET_MODE (src), - GET_MODE (src), - src0, src1, src2); - break; - } - - default: - defs_to_varying (insn); - } - - if (simplified && GET_CODE (simplified) == CONST_INT) - { - if (values[REGNO (dest)].lattice_val != CONSTANT - || values[REGNO (dest)].const_value != simplified) - SET_BIT (ssa_edges, REGNO (dest)); - - values[REGNO (dest)].lattice_val = CONSTANT; - values[REGNO (dest)].const_value = simplified; - } - else - defs_to_varying (insn); - } -} - -/* Iterate over the FLOW_EDGES work list. Simulate the target block - for each edge. */ -static void -examine_flow_edges (void) -{ - while (flow_edges != NULL) - { - basic_block succ_block; - rtx curr_phi_node; - - /* Pull the next block to simulate off the worklist. */ - succ_block = flow_edges->dest; - flow_edges = edge_info[EIE (flow_edges->src, flow_edges->dest)]; - - /* There is nothing to do for the exit block. */ - if (succ_block == EXIT_BLOCK_PTR) - continue; - - /* Always simulate PHI nodes, even if we have simulated this block - before. Note that all PHI nodes are consecutive within a block. */ - for (curr_phi_node = first_insn_after_basic_block_note (succ_block); - PHI_NODE_P (curr_phi_node); - curr_phi_node = NEXT_INSN (curr_phi_node)) - visit_phi_node (curr_phi_node, succ_block); - - /* If this is the first time we've simulated this block, then we - must simulate each of its insns. */ - if (!TEST_BIT (executable_blocks, succ_block->index)) - { - rtx currinsn; - edge succ_edge = succ_block->succ; - - /* Note that we have simulated this block. */ - SET_BIT (executable_blocks, succ_block->index); - - /* Simulate each insn within the block. */ - currinsn = succ_block->head; - while (currinsn != succ_block->end) - { - if (INSN_P (currinsn)) - visit_expression (currinsn, succ_block); - - currinsn = NEXT_INSN (currinsn); - } - - /* Don't forget the last insn in the block. */ - if (INSN_P (currinsn)) - visit_expression (currinsn, succ_block); - - /* If we haven't looked at the next block, and it has a - single successor, add it onto the worklist. This is because - if we only have one successor, we know it gets executed, - so we don't have to wait for cprop to tell us. */ - if (succ_edge != NULL - && succ_edge->succ_next == NULL - && !TEST_BIT (executable_edges, - EIE (succ_edge->src, succ_edge->dest))) - { - SET_BIT (executable_edges, - EIE (succ_edge->src, succ_edge->dest)); - edge_info[EIE (succ_edge->src, succ_edge->dest)] = flow_edges; - flow_edges = succ_edge; - } - } - } -} - -/* Follow the def-use chains for each definition on the worklist and - simulate the uses of the definition. */ - -static void -follow_def_use_chains (void) -{ - /* Iterate over all the entries on the SSA_EDGES worklist. */ - while (sbitmap_first_set_bit (ssa_edges) >= 0) - { - int member; - struct df_link *curruse; - - /* Pick an entry off the worklist (it does not matter which - entry we pick). */ - member = sbitmap_first_set_bit (ssa_edges); - RESET_BIT (ssa_edges, member); - - /* Iterate through all the uses of this entry. */ - for (curruse = df_analyzer->regs[member].uses; curruse; - curruse = curruse->next) - { - rtx useinsn; - - useinsn = DF_REF_INSN (curruse->ref); - if (PHI_NODE_P (useinsn)) - { - if (TEST_BIT (executable_blocks, BLOCK_NUM (useinsn))) - visit_phi_node (useinsn, BLOCK_FOR_INSN (useinsn)); - } - else - { - if (TEST_BIT (executable_blocks, BLOCK_NUM (useinsn))) - visit_expression (useinsn, BLOCK_FOR_INSN (useinsn)); - } - } - } -} - -/* Examine each edge to see if we were able to prove any were - not executable. - - If an edge is not executable, then we can remove its alternative - in PHI nodes as the destination of the edge, we can simplify the - conditional branch at the source of the edge, and we can remove - the edge from the CFG. Note we do not delete unreachable blocks - yet as the DF analyzer can not deal with that yet. */ -static void -optimize_unexecutable_edges (struct edge_list *edges, - sbitmap executable_edges) -{ - int i; - basic_block bb; - - for (i = 0; i < NUM_EDGES (edges); i++) - { - if (!TEST_BIT (executable_edges, i)) - { - edge edge = INDEX_EDGE (edges, i); - - if (edge->flags & EDGE_ABNORMAL) - continue; - - /* We found an edge that is not executable. First simplify - the PHI nodes in the target block. */ - if (edge->dest != EXIT_BLOCK_PTR) - { - rtx insn = first_insn_after_basic_block_note (edge->dest); - - while (PHI_NODE_P (insn)) - { - remove_phi_alternative (PATTERN (insn), edge->src); - if (rtl_dump_file) - fprintf (rtl_dump_file, - "Removing alternative for bb %d of phi %d\n", - edge->src->index, SSA_NAME (PATTERN (insn))); - insn = NEXT_INSN (insn); - } - } - if (rtl_dump_file) - fprintf (rtl_dump_file, - "Removing unexecutable edge from %d to %d\n", - edge->src->index, edge->dest->index); - /* Since the edge was not executable, remove it from the CFG. */ - remove_edge (edge); - } - } - - /* We have removed all the unexecutable edges from the CFG. Fix up - the conditional jumps at the end of any affected block. - - We have three cases to deal with: - - a. Both outgoing edges are not executable. This happens if the - source block is not reachable. We will deal with this by - deleting all the insns in the block later. - - b. The fall-thru edge is not executable. In this case we - change the conditional jump into an unconditional jump and - add a BARRIER after the unconditional jump. Note that since - we are working on generic RTL we can change the jump in-place - instead of dealing with the headache of reemitting the jump. - - c. The branch taken edge is not executable. In this case - we turn the jump into (set (pc) (pc)) which is a nop-jump - and we will remove the unrecognizable insn later. - - In cases B & C we are removing uses of registers, so make sure - to note those changes for the DF analyzer. */ - - FOR_EACH_BB (bb) - { - rtx insn = bb->end; - edge edge = bb->succ; - - /* If we have no predecessors, then this block is unreachable and - will be cleaned up when we remove unreachable blocks. */ - if (bb->pred == NULL || GET_CODE (insn) != JUMP_INSN) - continue; - - /* If this block ends in a conditional jump, but only has one - successor, then the jump needs adjustment. */ - if (condjump_p (insn) && ! simplejump_p (insn) - && bb->succ && bb->succ->succ_next == NULL) - { - /* If the fallthru edge is the executable edge, then turn - this jump into a nop jump, otherwise make it an unconditional - jump to its target. */ - if (edge->flags & EDGE_FALLTHRU) - { - PUT_CODE (insn, NOTE); - NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; - } - else - { - SET_SRC (PATTERN (insn)) = gen_rtx_LABEL_REF (Pmode, - JUMP_LABEL (insn)); - emit_barrier_after (insn); - INSN_CODE (insn) = -1; - } - - /* Inform the DF analyzer that this insn changed. */ - df_insn_modify (df_analyzer, BLOCK_FOR_INSN (insn), insn); - } - } -} - -/* Perform substitution of known values for pseudo registers. - - ??? Note we do not do simplifications or constant folding here, it - is unlikely that any significant simplifications can be done here - anyway. Consider that if the simplification would result in an - expression that produces a constant value that the value would - have been discovered and recorded already. - - We perform two transformations. First, we initialize pseudos to their - known constant values at their definition point. Second, we try to - replace uses with the known constant value. */ - -static void -ssa_ccp_substitute_constants (void) -{ - unsigned int i; - - for (i = FIRST_PSEUDO_REGISTER; i < VARRAY_SIZE (ssa_definition); i++) - { - if (values[i].lattice_val == CONSTANT) - { - rtx def = VARRAY_RTX (ssa_definition, i); - rtx set = single_set (def); - struct df_link *curruse; - - if (! set) - continue; - - /* Do not try to simplify PHI nodes down to a constant load. - That will be done later as we translate out of SSA. Also, - doing that here could violate the rule that all PHI nodes - are consecutive at the start of the basic block. - - Don't do anything to nodes that were already sets to - constants. */ - if (! PHI_NODE_P (def) - && ! ((GET_CODE (def) == INSN - && GET_CODE (SET_SRC (set)) == CONST_INT))) - { - if (rtl_dump_file) - fprintf (rtl_dump_file, - "Register %d is now set to a constant\n", - SSA_NAME (PATTERN (def))); - SET_SRC (set) = values[i].const_value; - INSN_CODE (def) = -1; - df_insn_modify (df_analyzer, BLOCK_FOR_INSN (def), def); - } - - /* Iterate through all the uses of this entry and try replacements - there too. Note it is not particularly profitable to try - and fold/simplify expressions here as most of the common - cases were handled above. */ - for (curruse = df_analyzer->regs[i].uses; - curruse; - curruse = curruse->next) - { - rtx useinsn; - - useinsn = DF_REF_INSN (curruse->ref); - - if (!INSN_DELETED_P (useinsn) - && ! (GET_CODE (useinsn) == NOTE - && NOTE_LINE_NUMBER (useinsn) == NOTE_INSN_DELETED) - && (GET_CODE (useinsn) == INSN - || GET_CODE (useinsn) == JUMP_INSN)) - { - - if (validate_replace_src (regno_reg_rtx [i], - values[i].const_value, - useinsn)) - { - if (rtl_dump_file) - fprintf (rtl_dump_file, - "Register %d in insn %d replaced with constant\n", - i, INSN_UID (useinsn)); - INSN_CODE (useinsn) = -1; - df_insn_modify (df_analyzer, - BLOCK_FOR_INSN (useinsn), - useinsn); - } - - } - } - } - } -} - -/* Now find all unreachable basic blocks. All the insns in those - blocks are unreachable, so delete them and mark any necessary - updates for the DF analyzer. */ - -static void -ssa_ccp_df_delete_unreachable_insns (void) -{ - basic_block b; - - /* Use the CFG to find all the reachable blocks. */ - find_unreachable_blocks (); - - /* Now we know what blocks are not reachable. Mark all the insns - in those blocks as deleted for the DF analyzer. We'll let the - normal flow code actually remove the unreachable blocks. */ - FOR_EACH_BB_REVERSE (b) - { - if (!(b->flags & BB_REACHABLE)) - { - rtx start = b->head; - rtx end = b->end; - rtx tmp; - - /* Include any jump table following the basic block. */ - end = b->end; - if (tablejump_p (end, NULL, &tmp)) - end = tmp; - - while (1) - { - rtx next = NEXT_INSN (start); - - if (GET_CODE (start) == INSN - || GET_CODE (start) == CALL_INSN - || GET_CODE (start) == JUMP_INSN) - df_insn_delete (df_analyzer, BLOCK_FOR_INSN (start), start); - - if (start == end) - break; - start = next; - } - } - } -} - - -/* Main entry point for SSA Conditional Constant Propagation. - - Long term it should accept as input the specific flow graph to - operate on so that it can be called for sub-graphs. */ - -void -ssa_const_prop (void) -{ - unsigned int i; - edge curredge; - - /* We need alias analysis (for what?) */ - init_alias_analysis (); - - df_analyzer = df_init (); - df_analyse (df_analyzer, 0, - DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS); - - /* Perform a quick and dirty dead code elimination pass. This is not - as aggressive as it could be, but it's good enough to clean up a - lot of unwanted junk and it is fast. */ - ssa_fast_dce (df_analyzer); - - /* Build an edge list from the CFG. */ - edges = create_edge_list (); - - /* Initialize the values array with everything as undefined. */ - values = xmalloc (VARRAY_SIZE (ssa_definition) * sizeof (value)); - for (i = 0; i < VARRAY_SIZE (ssa_definition); i++) - { - if (i < FIRST_PSEUDO_REGISTER) - values[i].lattice_val = VARYING; - else - values[i].lattice_val = UNDEFINED; - values[i].const_value = NULL; - } - - ssa_edges = sbitmap_alloc (VARRAY_SIZE (ssa_definition)); - sbitmap_zero (ssa_edges); - - executable_blocks = sbitmap_alloc (last_basic_block); - sbitmap_zero (executable_blocks); - - executable_edges = sbitmap_alloc (NUM_EDGES (edges)); - sbitmap_zero (executable_edges); - - edge_info = xmalloc (NUM_EDGES (edges) * sizeof (edge)); - flow_edges = ENTRY_BLOCK_PTR->succ; - - /* Add the successors of the entry block to the edge worklist. That - is enough of a seed to get SSA-CCP started. */ - for (curredge = ENTRY_BLOCK_PTR->succ; curredge; - curredge = curredge->succ_next) - { - int index = EIE (curredge->src, curredge->dest); - SET_BIT (executable_edges, index); - edge_info[index] = curredge->succ_next; - } - - /* Iterate until until the worklists are empty. */ - do - { - examine_flow_edges (); - follow_def_use_chains (); - } - while (flow_edges != NULL); - - /* Now perform substitutions based on the known constant values. */ - ssa_ccp_substitute_constants (); - - /* Remove unexecutable edges from the CFG and make appropriate - adjustments to PHI nodes. */ - optimize_unexecutable_edges (edges, executable_edges); - - /* Now remove all unreachable insns and update the DF information. - as appropriate. */ - ssa_ccp_df_delete_unreachable_insns (); - -#if 0 - /* The DF analyzer expects the number of blocks to remain constant, - so we can't remove unreachable blocks. - - Code the DF analyzer calls expects there to be no unreachable - blocks in the CFG. So we can't leave unreachable blocks in the - CFG. - - So, there is no way to do an incremental update of the DF data - at this point. */ - df_analyse (df_analyzer, 0, - DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS); -#endif - - /* Clean up any dead code exposed by SSA-CCP, do this after updating - the dataflow information! */ - ssa_fast_dce (df_analyzer); - - free (values); - values = NULL; - - free (edge_info); - edge_info = NULL; - - sbitmap_free (executable_blocks); - executable_blocks = NULL; - - sbitmap_free (ssa_edges); - ssa_edges = NULL; - - free_edge_list (edges); - edges = NULL; - - sbitmap_free (executable_edges); - executable_edges = NULL; - - df_finish (df_analyzer); - end_alias_analysis (); -} - -static int -mark_references (rtx *current_rtx, void *data) -{ - rtx x = *current_rtx; - sbitmap worklist = (sbitmap) data; - - if (x == NULL_RTX) - return 0; - - if (GET_CODE (x) == SET) - { - rtx dest = SET_DEST (x); - - if (GET_CODE (dest) == STRICT_LOW_PART - || GET_CODE (dest) == SUBREG - || GET_CODE (dest) == SIGN_EXTRACT - || GET_CODE (dest) == ZERO_EXTRACT) - { - rtx reg; - - reg = dest; - - while (GET_CODE (reg) == STRICT_LOW_PART - || GET_CODE (reg) == SUBREG - || GET_CODE (reg) == SIGN_EXTRACT - || GET_CODE (reg) == ZERO_EXTRACT) - reg = XEXP (reg, 0); - - if (GET_CODE (reg) == REG) - SET_BIT (worklist, REGNO (reg)); - } - - if (GET_CODE (dest) == REG) - { - for_each_rtx (&SET_SRC (x), mark_references, data); - return -1; - } - - return 0; - } - else if (GET_CODE (x) == REG) - { - SET_BIT (worklist, REGNO (x)); - return -1; - } - else if (GET_CODE (x) == CLOBBER) - return -1; - else - return 0; -} - -static void -ssa_fast_dce (struct df *df) -{ - sbitmap worklist = sbitmap_alloc (VARRAY_SIZE (ssa_definition)); - sbitmap_ones (worklist); - - /* Iterate on the worklist until there's no definitions left to - examine. */ - while (sbitmap_first_set_bit (worklist) >= 0) - { - struct df_link *curruse; - int reg, found_use; - - /* Remove an item from the worklist. */ - reg = sbitmap_first_set_bit (worklist); - RESET_BIT (worklist, reg); - - /* We never consider deleting assignments to hard regs or things - which do not have SSA definitions, or things we have already - deleted, or things with unusual side effects. */ - if (reg < FIRST_PSEUDO_REGISTER - || ! VARRAY_RTX (ssa_definition, reg) - || INSN_DELETED_P (VARRAY_RTX (ssa_definition, reg)) - || (GET_CODE (VARRAY_RTX (ssa_definition, reg)) == NOTE - && (NOTE_LINE_NUMBER (VARRAY_RTX (ssa_definition, reg)) - == NOTE_INSN_DELETED)) - || side_effects_p (PATTERN (VARRAY_RTX (ssa_definition, reg)))) - continue; - - /* Iterate over the uses of this register. If we can not find - any uses that have not been deleted, then the definition of - this register is dead. */ - found_use = 0; - for (curruse = df->regs[reg].uses; curruse; curruse = curruse->next) - { - if (curruse->ref - && DF_REF_INSN (curruse->ref) - && ! INSN_DELETED_P (DF_REF_INSN (curruse->ref)) - && ! (GET_CODE (DF_REF_INSN (curruse->ref)) == NOTE - && (NOTE_LINE_NUMBER (DF_REF_INSN (curruse->ref)) - == NOTE_INSN_DELETED)) - && DF_REF_INSN (curruse->ref) != VARRAY_RTX (ssa_definition, reg)) - { - found_use = 1; - break; - } - } - - /* If we did not find a use of this register, then the definition - of this register is dead. */ - - if (! found_use) - { - rtx def = VARRAY_RTX (ssa_definition, reg); - - /* Add all registers referenced by INSN to the work - list. */ - for_each_rtx (&PATTERN (def), mark_references, worklist); - - /* Inform the analyzer that this insn is going to be - deleted. */ - df_insn_delete (df, BLOCK_FOR_INSN (def), def); - - VARRAY_RTX (ssa_definition, reg) = NULL; - } - } - - sbitmap_free (worklist); - - /* Update the use-def chains in the df_analyzer as needed. */ - df_analyse (df_analyzer, 0, - DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS); -} diff --git a/gcc/ssa-dce.c b/gcc/ssa-dce.c deleted file mode 100644 index c308c7793b6..00000000000 --- a/gcc/ssa-dce.c +++ /dev/null @@ -1,713 +0,0 @@ -/* Dead-code elimination pass for the GNU compiler. - Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - Written by Jeffrey D. Oldham <oldham@codesourcery.com>. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* Dead-code elimination is the removal of instructions which have no - impact on the program's output. "Dead instructions" have no impact - on the program's output, while "necessary instructions" may have - impact on the output. - - The algorithm consists of three phases: - 1) marking as necessary all instructions known to be necessary, - e.g., writing a value to memory, - 2) propagating necessary instructions, e.g., the instructions - giving values to operands in necessary instructions, and - 3) removing dead instructions (except replacing dead conditionals - with unconditional jumps). - - Side Effects: - The last step can require adding labels, deleting insns, and - modifying basic block structures. Some conditional jumps may be - converted to unconditional jumps so the control-flow graph may be - out-of-date. - - Edges from some infinite loops to the exit block can be added to - the control-flow graph, but will be removed after this pass is - complete. - - It Does Not Perform: - We decided to not simultaneously perform jump optimization and dead - loop removal during dead-code elimination. Thus, all jump - instructions originally present remain after dead-code elimination - but 1) unnecessary conditional jump instructions are changed to - unconditional jump instructions and 2) all unconditional jump - instructions remain. - - Assumptions: - 1) SSA has been performed. - 2) The basic block and control-flow graph structures are accurate. - 3) The flow graph permits constructing an edge_list. - 4) note rtxes should be saved. - - Unfinished: - When replacing unnecessary conditional jumps with unconditional - jumps, the control-flow graph is not updated. It should be. - - References: - Building an Optimizing Compiler - Robert Morgan - Butterworth-Heinemann, 1998 - Section 8.9 -*/ - -#include "config.h" -#include "system.h" -#include "coretypes.h" -#include "tm.h" - -#include "rtl.h" -#include "hard-reg-set.h" -#include "basic-block.h" -#include "ssa.h" -#include "insn-config.h" -#include "recog.h" -#include "output.h" - - -/* A map from blocks to the edges on which they are control dependent. */ -typedef struct { - /* A dynamically allocated array. The Nth element corresponds to - the block with index N + 2. The Ith bit in the bitmap is set if - that block is dependent on the Ith edge. */ - bitmap *data; - /* The number of elements in the array. */ - int length; -} control_dependent_block_to_edge_map_s, *control_dependent_block_to_edge_map; - -/* Local function prototypes. */ -static control_dependent_block_to_edge_map control_dependent_block_to_edge_map_create - (size_t num_basic_blocks); -static void set_control_dependent_block_to_edge_map_bit - (control_dependent_block_to_edge_map c, basic_block bb, int edge_index); -static void control_dependent_block_to_edge_map_free - (control_dependent_block_to_edge_map c); -static void find_all_control_dependences - (struct edge_list *el, dominance_info pdom, - control_dependent_block_to_edge_map cdbte); -static void find_control_dependence - (struct edge_list *el, int edge_index, dominance_info pdom, - control_dependent_block_to_edge_map cdbte); -static basic_block find_pdom (dominance_info pdom, basic_block block); -static int inherently_necessary_register_1 (rtx *current_rtx, void *data); -static int inherently_necessary_register (rtx current_rtx); -static int find_inherently_necessary (rtx current_rtx); -static int propagate_necessity_through_operand (rtx *current_rtx, void *data); -static void note_inherently_necessary_set (rtx, rtx, void *); - -/* Unnecessary insns are indicated using insns' in_struct bit. */ - -/* Indicate INSN is dead-code; returns nothing. */ -#define KILL_INSN(INSN) INSN_DEAD_CODE_P(INSN) = 1 -/* Indicate INSN is necessary, i.e., not dead-code; returns nothing. */ -#define RESURRECT_INSN(INSN) INSN_DEAD_CODE_P(INSN) = 0 -/* Return nonzero if INSN is unnecessary. */ -#define UNNECESSARY_P(INSN) INSN_DEAD_CODE_P(INSN) -static void mark_all_insn_unnecessary (void); -/* Execute CODE with free variable INSN for all unnecessary insns in - an unspecified order, producing no output. */ -#define EXECUTE_IF_UNNECESSARY(INSN, CODE) \ -{ \ - rtx INSN; \ - \ - for (INSN = get_insns (); INSN != NULL_RTX; INSN = NEXT_INSN (INSN)) \ - if (INSN_P (insn) && INSN_DEAD_CODE_P (INSN)) \ - { \ - CODE; \ - } \ -} - -/* Find the label beginning block BB. */ -static rtx find_block_label (basic_block bb); -/* Remove INSN, updating its basic block structure. */ -static void delete_insn_bb (rtx insn); - -/* Recording which blocks are control dependent on which edges. We - expect each block to be control dependent on very few edges so we - use a bitmap for each block recording its edges. An array holds - the bitmap. Its position 0 entry holds the bitmap for block - INVALID_BLOCK+1 so that all blocks, including the entry and exit - blocks can participate in the data structure. */ - -/* Create a control_dependent_block_to_edge_map, given the number - NUM_BASIC_BLOCKS of non-entry, non-exit basic blocks, e.g., - n_basic_blocks. This memory must be released using - control_dependent_block_to_edge_map_free (). */ - -static control_dependent_block_to_edge_map -control_dependent_block_to_edge_map_create (size_t num_basic_blocks) -{ - int i; - control_dependent_block_to_edge_map c - = xmalloc (sizeof (control_dependent_block_to_edge_map_s)); - c->length = num_basic_blocks - (INVALID_BLOCK+1); - c->data = xmalloc ((size_t) c->length*sizeof (bitmap)); - for (i = 0; i < c->length; ++i) - c->data[i] = BITMAP_XMALLOC (); - - return c; -} - -/* Indicate block BB is control dependent on an edge with index - EDGE_INDEX in the mapping C of blocks to edges on which they are - control-dependent. */ - -static void -set_control_dependent_block_to_edge_map_bit (control_dependent_block_to_edge_map c, - basic_block bb, int edge_index) -{ - if (bb->index - (INVALID_BLOCK+1) >= c->length) - abort (); - - bitmap_set_bit (c->data[bb->index - (INVALID_BLOCK+1)], - edge_index); -} - -/* Execute CODE for each edge (given number EDGE_NUMBER within the - CODE) for which the block containing INSN is control dependent, - returning no output. CDBTE is the mapping of blocks to edges on - which they are control-dependent. */ - -#define EXECUTE_IF_CONTROL_DEPENDENT(CDBTE, INSN, EDGE_NUMBER, CODE) \ - EXECUTE_IF_SET_IN_BITMAP \ - (CDBTE->data[BLOCK_NUM (INSN) - (INVALID_BLOCK+1)], 0, \ - EDGE_NUMBER, CODE) - -/* Destroy a control_dependent_block_to_edge_map C. */ - -static void -control_dependent_block_to_edge_map_free (control_dependent_block_to_edge_map c) -{ - int i; - for (i = 0; i < c->length; ++i) - BITMAP_XFREE (c->data[i]); - free (c); -} - -/* Record all blocks' control dependences on all edges in the edge - list EL, ala Morgan, Section 3.6. The mapping PDOM of blocks to - their postdominators are used, and results are stored in CDBTE, - which should be empty. */ - -static void -find_all_control_dependences (struct edge_list *el, dominance_info pdom, - control_dependent_block_to_edge_map cdbte) -{ - int i; - - for (i = 0; i < NUM_EDGES (el); ++i) - find_control_dependence (el, i, pdom, cdbte); -} - -/* Determine all blocks' control dependences on the given edge with - edge_list EL index EDGE_INDEX, ala Morgan, Section 3.6. The - mapping PDOM of blocks to their postdominators are used, and - results are stored in CDBTE, which is assumed to be initialized - with zeros in each (block b', edge) position. */ - -static void -find_control_dependence (struct edge_list *el, int edge_index, - dominance_info pdom, - control_dependent_block_to_edge_map cdbte) -{ - basic_block current_block; - basic_block ending_block; - - if (INDEX_EDGE_PRED_BB (el, edge_index) == EXIT_BLOCK_PTR) - abort (); - ending_block = - (INDEX_EDGE_PRED_BB (el, edge_index) == ENTRY_BLOCK_PTR) - ? ENTRY_BLOCK_PTR->next_bb - : find_pdom (pdom, INDEX_EDGE_PRED_BB (el, edge_index)); - - for (current_block = INDEX_EDGE_SUCC_BB (el, edge_index); - current_block != ending_block && current_block != EXIT_BLOCK_PTR; - current_block = find_pdom (pdom, current_block)) - { - set_control_dependent_block_to_edge_map_bit (cdbte, - current_block, - edge_index); - } -} - -/* Find the immediate postdominator PDOM of the specified basic block - BLOCK. This function is necessary because some blocks have - negative numbers. */ - -static basic_block -find_pdom (dominance_info pdom, basic_block block) -{ - if (!block) - abort (); - if (block->index == INVALID_BLOCK) - abort (); - - if (block == ENTRY_BLOCK_PTR) - return ENTRY_BLOCK_PTR->next_bb; - else if (block == EXIT_BLOCK_PTR) - return EXIT_BLOCK_PTR; - else - { - basic_block bb = get_immediate_dominator (pdom, block); - if (!bb) - return EXIT_BLOCK_PTR; - return bb; - } -} - -/* Determine if the given CURRENT_RTX uses a hard register not - converted to SSA. Returns nonzero only if it uses such a hard - register. DATA is not used. - - The program counter (PC) is not considered inherently necessary - since code should be position-independent and thus not depend on - particular PC values. */ - -static int -inherently_necessary_register_1 (rtx *current_rtx, - void *data ATTRIBUTE_UNUSED) -{ - rtx x = *current_rtx; - - if (x == NULL_RTX) - return 0; - switch (GET_CODE (x)) - { - case CLOBBER: - /* Do not traverse the rest of the clobber. */ - return -1; - break; - case PC: - return 0; - break; - case REG: - if (CONVERT_REGISTER_TO_SSA_P (REGNO (x)) || x == pc_rtx) - return 0; - else - return !0; - break; - default: - return 0; - break; - } -} - -/* Return nonzero if the insn CURRENT_RTX is inherently necessary. */ - -static int -inherently_necessary_register (rtx current_rtx) -{ - return for_each_rtx (¤t_rtx, - &inherently_necessary_register_1, NULL); -} - - -/* Called via note_stores for each store in an insn. Note whether - or not a particular store is inherently necessary. Store a - nonzero value in inherently_necessary_p if such a store is found. */ - -static void -note_inherently_necessary_set (rtx dest, rtx set ATTRIBUTE_UNUSED, void *data) -{ - int *inherently_necessary_set_p = (int *) data; - - while (GET_CODE (dest) == SUBREG - || GET_CODE (dest) == STRICT_LOW_PART - || GET_CODE (dest) == ZERO_EXTRACT - || GET_CODE (dest) == SIGN_EXTRACT) - dest = XEXP (dest, 0); - - if (GET_CODE (dest) == MEM - || GET_CODE (dest) == UNSPEC - || GET_CODE (dest) == UNSPEC_VOLATILE) - *inherently_necessary_set_p = 1; -} - -/* Mark X as inherently necessary if appropriate. For example, - function calls and storing values into memory are inherently - necessary. This function is to be used with for_each_rtx (). - Return nonzero iff inherently necessary. */ - -static int -find_inherently_necessary (rtx x) -{ - if (x == NULL_RTX) - return 0; - else if (inherently_necessary_register (x)) - return !0; - else - switch (GET_CODE (x)) - { - case CALL_INSN: - case BARRIER: - case PREFETCH: - return !0; - case CODE_LABEL: - case NOTE: - return 0; - case JUMP_INSN: - return JUMP_TABLE_DATA_P (x) || computed_jump_p (x) != 0; - case INSN: - { - int inherently_necessary_set = 0; - note_stores (PATTERN (x), - note_inherently_necessary_set, - &inherently_necessary_set); - - /* If we found an inherently necessary set or an asm - instruction, then we consider this insn inherently - necessary. */ - return (inherently_necessary_set - || GET_CODE (PATTERN (x)) == ASM_INPUT - || asm_noperands (PATTERN (x)) >= 0); - } - default: - /* Found an impossible insn type. */ - abort (); - break; - } -} - -/* Propagate necessity through REG and SUBREG operands of CURRENT_RTX. - This function is called with for_each_rtx () on necessary - instructions. The DATA must be a varray of unprocessed - instructions. */ - -static int -propagate_necessity_through_operand (rtx *current_rtx, void *data) -{ - rtx x = *current_rtx; - varray_type *unprocessed_instructions = (varray_type *) data; - - if (x == NULL_RTX) - return 0; - switch ( GET_CODE (x)) - { - case REG: - if (CONVERT_REGISTER_TO_SSA_P (REGNO (x))) - { - rtx insn = VARRAY_RTX (ssa_definition, REGNO (x)); - if (insn != NULL_RTX && UNNECESSARY_P (insn)) - { - RESURRECT_INSN (insn); - VARRAY_PUSH_RTX (*unprocessed_instructions, insn); - } - } - return 0; - - default: - return 0; - } -} - -/* Indicate all insns initially assumed to be unnecessary. */ - -static void -mark_all_insn_unnecessary (void) -{ - rtx insn; - for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) { - if (INSN_P (insn)) - KILL_INSN (insn); - } - -} - -/* Find the label beginning block BB, adding one if necessary. */ - -static rtx -find_block_label (basic_block bb) -{ - rtx insn = bb->head; - if (LABEL_P (insn)) - return insn; - else - { - rtx new_label = emit_label_before (gen_label_rtx (), insn); - if (insn == bb->head) - bb->head = new_label; - return new_label; - } -} - -/* Remove INSN, updating its basic block structure. */ - -static void -delete_insn_bb (rtx insn) -{ - if (!insn) - abort (); - - /* Do not actually delete anything that is not an INSN. - - We can get here because we only consider INSNs as - potentially necessary. We leave it to later passes - to remove unnecessary notes, unused labels, etc. */ - if (! INSN_P (insn)) - return; - - delete_insn (insn); -} - -/* Perform the dead-code elimination. */ - -void -ssa_eliminate_dead_code (void) -{ - rtx insn; - basic_block bb; - /* Necessary instructions with operands to explore. */ - varray_type unprocessed_instructions; - /* Map element (b,e) is nonzero if the block is control dependent on - edge. "cdbte" abbreviates control dependent block to edge. */ - control_dependent_block_to_edge_map cdbte; - /* Element I is the immediate postdominator of block I. */ - dominance_info pdom; - struct edge_list *el; - - /* Initialize the data structures. */ - mark_all_insn_unnecessary (); - VARRAY_RTX_INIT (unprocessed_instructions, 64, - "unprocessed instructions"); - cdbte = control_dependent_block_to_edge_map_create (last_basic_block); - - /* Prepare for use of BLOCK_NUM (). */ - connect_infinite_loops_to_exit (); - - /* Compute control dependence. */ - pdom = calculate_dominance_info (CDI_POST_DOMINATORS); - el = create_edge_list (); - find_all_control_dependences (el, pdom, cdbte); - - /* Find inherently necessary instructions. */ - for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) - if (find_inherently_necessary (insn) && INSN_P (insn)) - { - RESURRECT_INSN (insn); - VARRAY_PUSH_RTX (unprocessed_instructions, insn); - } - - /* Propagate necessity using the operands of necessary instructions. */ - while (VARRAY_ACTIVE_SIZE (unprocessed_instructions) > 0) - { - rtx current_instruction; - int edge_number; - - current_instruction = VARRAY_TOP_RTX (unprocessed_instructions); - VARRAY_POP (unprocessed_instructions); - - /* Make corresponding control dependent edges necessary. */ - /* Assume the only JUMP_INSN is the block's last insn. It appears - that the last instruction of the program need not be a - JUMP_INSN. */ - - if (INSN_P (current_instruction) - && !JUMP_TABLE_DATA_P (current_instruction)) - { - /* Notes and labels contain no interesting operands. */ - EXECUTE_IF_CONTROL_DEPENDENT - (cdbte, current_instruction, edge_number, - { - rtx jump_insn = (INDEX_EDGE_PRED_BB (el, edge_number))->end; - if (GET_CODE (jump_insn) == JUMP_INSN - && UNNECESSARY_P (jump_insn)) - { - RESURRECT_INSN (jump_insn); - VARRAY_PUSH_RTX (unprocessed_instructions, jump_insn); - } - }); - - /* Propagate through the operands. */ - for_each_rtx (¤t_instruction, - &propagate_necessity_through_operand, - &unprocessed_instructions); - - /* PHI nodes are somewhat special in that each PHI alternative - has data and control dependencies. The data dependencies - are handled via propagate_necessity_through_operand. We - handle the control dependency here. - - We consider the control dependent edges leading to the - predecessor block associated with each PHI alternative - as necessary. */ - if (PHI_NODE_P (current_instruction)) - { - rtvec phi_vec = XVEC (SET_SRC (PATTERN (current_instruction)), 0); - int num_elem = GET_NUM_ELEM (phi_vec); - int v; - - for (v = num_elem - 2; v >= 0; v -= 2) - { - basic_block bb; - - bb = BASIC_BLOCK (INTVAL (RTVEC_ELT (phi_vec, v + 1))); - EXECUTE_IF_CONTROL_DEPENDENT - (cdbte, bb->end, edge_number, - { - rtx jump_insn; - - jump_insn = (INDEX_EDGE_PRED_BB (el, edge_number))->end; - if (((GET_CODE (jump_insn) == JUMP_INSN)) - && UNNECESSARY_P (jump_insn)) - { - RESURRECT_INSN (jump_insn); - VARRAY_PUSH_RTX (unprocessed_instructions, jump_insn); - } - }); - - } - } - } - } - - /* Remove the unnecessary instructions. */ - EXECUTE_IF_UNNECESSARY (insn, - { - if (any_condjump_p (insn)) - { - basic_block bb = BLOCK_FOR_INSN (insn); - basic_block pdom_bb = find_pdom (pdom, bb); - rtx lbl; - edge e; - - /* Egad. The immediate post dominator is the exit block. We - would like to optimize this conditional jump to jump directly - to the exit block. That can be difficult as we may not have - a suitable CODE_LABEL that allows us to fall unmolested into - the exit block. - - So, we just delete the conditional branch by turning it into - a deleted note. That is safe, but just not as optimal as - it could be. */ - if (pdom_bb == EXIT_BLOCK_PTR) - { - /* Since we're going to just delete the branch, we need - look at all the edges and remove all those which are not - a fallthru edge. */ - e = bb->succ; - while (e) - { - edge temp = e; - - e = e->succ_next; - if ((temp->flags & EDGE_FALLTHRU) == 0) - { - /* We've found a non-fallthru edge, find any PHI nodes - at the target and clean them up. */ - if (temp->dest != EXIT_BLOCK_PTR) - { - rtx insn - = first_insn_after_basic_block_note (temp->dest); - - while (PHI_NODE_P (insn)) - { - remove_phi_alternative (PATTERN (insn), temp->src); - insn = NEXT_INSN (insn); - } - } - - remove_edge (temp); - } - } - - /* Now "delete" the conditional jump. */ - PUT_CODE (insn, NOTE); - NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; - continue; - } - - /* We've found a conditional branch that is unnecessary. - - First, remove all outgoing edges from this block, updating - PHI nodes as appropriate. */ - e = bb->succ; - while (e) - { - edge temp = e; - - e = e->succ_next; - - if (temp->flags & EDGE_ABNORMAL) - continue; - - /* We found an edge that is not executable. First simplify - the PHI nodes in the target block. */ - if (temp->dest != EXIT_BLOCK_PTR) - { - rtx insn = first_insn_after_basic_block_note (temp->dest); - - while (PHI_NODE_P (insn)) - { - remove_phi_alternative (PATTERN (insn), temp->src); - insn = NEXT_INSN (insn); - } - } - - remove_edge (temp); - } - - /* Create an edge from this block to the post dominator. - What about the PHI nodes at the target? */ - make_edge (bb, pdom_bb, 0); - - /* Third, transform this insn into an unconditional - jump to the label for the immediate postdominator. */ - lbl = find_block_label (pdom_bb); - SET_SRC (PATTERN (insn)) = gen_rtx_LABEL_REF (VOIDmode, lbl); - INSN_CODE (insn) = -1; - JUMP_LABEL (insn) = lbl; - LABEL_NUSES (lbl)++; - - /* A barrier must follow any unconditional jump. Barriers - are not in basic blocks so this must occur after - deleting the conditional jump. */ - emit_barrier_after (insn); - } - else if (!JUMP_P (insn)) - delete_insn_bb (insn); - }); - - /* Remove fake edges from the CFG. */ - remove_fake_edges (); - - /* Find any blocks with no successors and ensure they are followed - by a BARRIER. delete_insn has the nasty habit of deleting barriers - when deleting insns. */ - FOR_EACH_BB (bb) - { - if (bb->succ == NULL) - { - rtx next = NEXT_INSN (bb->end); - - if (!next || GET_CODE (next) != BARRIER) - emit_barrier_after (bb->end); - } - } - /* Release allocated memory. */ - for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) { - if (INSN_P (insn)) - RESURRECT_INSN (insn); - } - - if (VARRAY_ACTIVE_SIZE (unprocessed_instructions) != 0) - abort (); - control_dependent_block_to_edge_map_free (cdbte); - free (pdom); - free_edge_list (el); -} diff --git a/gcc/ssa.c b/gcc/ssa.c deleted file mode 100644 index c12cdbe7afb..00000000000 --- a/gcc/ssa.c +++ /dev/null @@ -1,2214 +0,0 @@ -/* Static Single Assignment conversion routines for the GNU compiler. - Copyright (C) 2000, 2001, 2002, 2003 - Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* References: - - Building an Optimizing Compiler - Robert Morgan - Butterworth-Heinemann, 1998 - - Static Single Assignment Construction - Preston Briggs, Tim Harvey, Taylor Simpson - Technical Report, Rice University, 1995 - ftp://ftp.cs.rice.edu/public/preston/optimizer/SSA.ps.gz. */ - -#include "config.h" -#include "system.h" -#include "coretypes.h" -#include "tm.h" - -#include "rtl.h" -#include "expr.h" -#include "varray.h" -#include "partition.h" -#include "sbitmap.h" -#include "hashtab.h" -#include "regs.h" -#include "hard-reg-set.h" -#include "flags.h" -#include "function.h" -#include "real.h" -#include "insn-config.h" -#include "recog.h" -#include "basic-block.h" -#include "output.h" -#include "ssa.h" - -/* TODO: - - Handle subregs better, maybe. For now, if a reg that's set in a - subreg expression is duplicated going into SSA form, an extra copy - is inserted first that copies the entire reg into the duplicate, so - that the other bits are preserved. This isn't strictly SSA, since - at least part of the reg is assigned in more than one place (though - they are adjacent). - - ??? What to do about strict_low_part. Probably I'll have to split - them out of their current instructions first thing. - - Actually the best solution may be to have a kind of "mid-level rtl" - in which the RTL encodes exactly what we want, without exposing a - lot of niggling processor details. At some later point we lower - the representation, calling back into optabs to finish any necessary - expansion. */ - -/* All pseudo-registers and select hard registers are converted to SSA - form. When converting out of SSA, these select hard registers are - guaranteed to be mapped to their original register number. Each - machine's .h file should define CONVERT_HARD_REGISTER_TO_SSA_P - indicating which hard registers should be converted. - - When converting out of SSA, temporaries for all registers are - partitioned. The partition is checked to ensure that all uses of - the same hard register in the same machine mode are in the same - class. */ - -/* If conservative_reg_partition is nonzero, use a conservative - register partitioning algorithm (which leaves more regs after - emerging from SSA) instead of the coalescing one. This is being - left in for a limited time only, as a debugging tool until the - coalescing algorithm is validated. */ - -static int conservative_reg_partition; - -/* This flag is set when the CFG is in SSA form. */ -int in_ssa_form = 0; - -/* Element I is the single instruction that sets register I. */ -varray_type ssa_definition; - -/* Element I-PSEUDO is the normal register that originated the ssa - register in question. */ -varray_type ssa_rename_from; - -/* Element I is the normal register that originated the ssa - register in question. - - A hash table stores the (register, rtl) pairs. These are each - xmalloc'ed and deleted when the hash table is destroyed. */ -htab_t ssa_rename_from_ht; - -/* The running target ssa register for a given pseudo register. - (Pseudo registers appear in only one mode.) */ -static rtx *ssa_rename_to_pseudo; -/* Similar, but for hard registers. A hard register can appear in - many modes, so we store an equivalent pseudo for each of the - modes. */ -static rtx ssa_rename_to_hard[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES]; - -/* ssa_rename_from maps pseudo registers to the original corresponding - RTL. It is implemented as using a hash table. */ - -typedef struct { - unsigned int reg; - rtx original; -} ssa_rename_from_pair; - -struct ssa_rename_from_hash_table_data { - sbitmap canonical_elements; - partition reg_partition; -}; - -static rtx gen_sequence (void); -static void ssa_rename_from_initialize (void); -static rtx ssa_rename_from_lookup (int reg); -static unsigned int original_register (unsigned int regno); -static void ssa_rename_from_insert (unsigned int reg, rtx r); -static void ssa_rename_from_free (void); -typedef int (*srf_trav) (int regno, rtx r, sbitmap canonical_elements, - partition reg_partition); -static void ssa_rename_from_traverse (htab_trav callback_function, - sbitmap canonical_elements, partition reg_partition); -/*static Avoid warning message. */ void ssa_rename_from_print (void); -static int ssa_rename_from_print_1 (void **slot, void *data); -static hashval_t ssa_rename_from_hash_function (const void * srfp); -static int ssa_rename_from_equal (const void *srfp1, const void *srfp2); -static void ssa_rename_from_delete (void *srfp); - -static rtx ssa_rename_to_lookup (rtx reg); -static void ssa_rename_to_insert (rtx reg, rtx r); - -/* The number of registers that were live on entry to the SSA routines. */ -static unsigned int ssa_max_reg_num; - -/* Local function prototypes. */ - -struct rename_context; - -static inline rtx * phi_alternative (rtx, int); -static void compute_dominance_frontiers_1 (sbitmap *frontiers, - dominance_info idom, int bb, - sbitmap done); -static void find_evaluations_1 (rtx dest, rtx set, void *data); -static void find_evaluations (sbitmap *evals, int nregs); -static void compute_iterated_dominance_frontiers (sbitmap *idfs, - sbitmap *frontiers, - sbitmap *evals, int nregs); -static void insert_phi_node (int regno, int b); -static void insert_phi_nodes (sbitmap *idfs, sbitmap *evals, int nregs); -static void create_delayed_rename (struct rename_context *, rtx *); -static void apply_delayed_renames (struct rename_context *); -static int rename_insn_1 (rtx *ptr, void *data); -static void rename_block (int b, dominance_info dom); -static void rename_registers (int nregs, dominance_info idom); - -static inline int ephi_add_node (rtx reg, rtx *nodes, int *n_nodes); -static int * ephi_forward (int t, sbitmap visited, sbitmap *succ, int *tstack); -static void ephi_backward (int t, sbitmap visited, sbitmap *pred, rtx *nodes); -static void ephi_create (int t, sbitmap visited, sbitmap *pred, - sbitmap *succ, rtx *nodes); -static void eliminate_phi (edge e, partition reg_partition); -static int make_regs_equivalent_over_bad_edges (int bb, - partition reg_partition); - -/* These are used only in the conservative register partitioning - algorithms. */ -static int make_equivalent_phi_alternatives_equivalent - (int bb, partition reg_partition); -static partition compute_conservative_reg_partition (void); -static int record_canonical_element_1 (void **srfp, void *data); -static int check_hard_regs_in_partition (partition reg_partition); - -/* These are used in the register coalescing algorithm. */ -static int coalesce_if_unconflicting (partition p, conflict_graph conflicts, - int reg1, int reg2); -static int coalesce_regs_in_copies (basic_block bb, partition p, - conflict_graph conflicts); -static int coalesce_reg_in_phi (rtx, int dest_regno, int src_regno, - void *data); -static int coalesce_regs_in_successor_phi_nodes (basic_block bb, - partition p, - conflict_graph conflicts); -static partition compute_coalesced_reg_partition (void); -static int mark_reg_in_phi (rtx *ptr, void *data); -static void mark_phi_and_copy_regs (regset phi_set); - -static int rename_equivalent_regs_in_insn (rtx *ptr, void *data); -static void rename_equivalent_regs (partition reg_partition); - -/* Deal with hard registers. */ -static int conflicting_hard_regs_p (int reg1, int reg2); - -/* ssa_rename_to maps registers and machine modes to SSA pseudo registers. */ - -/* Find the register associated with REG in the indicated mode. */ - -static rtx -ssa_rename_to_lookup (rtx reg) -{ - if (!HARD_REGISTER_P (reg)) - return ssa_rename_to_pseudo[REGNO (reg) - FIRST_PSEUDO_REGISTER]; - else - return ssa_rename_to_hard[REGNO (reg)][GET_MODE (reg)]; -} - -/* Store a new value mapping REG to R in ssa_rename_to. */ - -static void -ssa_rename_to_insert (rtx reg, rtx r) -{ - if (!HARD_REGISTER_P (reg)) - ssa_rename_to_pseudo[REGNO (reg) - FIRST_PSEUDO_REGISTER] = r; - else - ssa_rename_to_hard[REGNO (reg)][GET_MODE (reg)] = r; -} - -/* Prepare ssa_rename_from for use. */ - -static void -ssa_rename_from_initialize (void) -{ - /* We use an arbitrary initial hash table size of 64. */ - ssa_rename_from_ht = htab_create (64, - &ssa_rename_from_hash_function, - &ssa_rename_from_equal, - &ssa_rename_from_delete); -} - -/* Find the REG entry in ssa_rename_from. Return NULL_RTX if no entry is - found. */ - -static rtx -ssa_rename_from_lookup (int reg) -{ - ssa_rename_from_pair srfp; - ssa_rename_from_pair *answer; - srfp.reg = reg; - srfp.original = NULL_RTX; - answer = htab_find_with_hash (ssa_rename_from_ht, (void *) &srfp, reg); - return (answer == 0 ? NULL_RTX : answer->original); -} - -/* Find the number of the original register specified by REGNO. If - the register is a pseudo, return the original register's number. - Otherwise, return this register number REGNO. */ - -static unsigned int -original_register (unsigned int regno) -{ - rtx original_rtx = ssa_rename_from_lookup (regno); - return original_rtx != NULL_RTX ? REGNO (original_rtx) : regno; -} - -/* Add mapping from R to REG to ssa_rename_from even if already present. */ - -static void -ssa_rename_from_insert (unsigned int reg, rtx r) -{ - void **slot; - ssa_rename_from_pair *srfp = xmalloc (sizeof (ssa_rename_from_pair)); - srfp->reg = reg; - srfp->original = r; - slot = htab_find_slot_with_hash (ssa_rename_from_ht, (const void *) srfp, - reg, INSERT); - if (*slot != 0) - free ((void *) *slot); - *slot = srfp; -} - -/* Apply the CALLBACK_FUNCTION to each element in ssa_rename_from. - CANONICAL_ELEMENTS and REG_PARTITION pass data needed by the only - current use of this function. */ - -static void -ssa_rename_from_traverse (htab_trav callback_function, - sbitmap canonical_elements, partition reg_partition) -{ - struct ssa_rename_from_hash_table_data srfhd; - srfhd.canonical_elements = canonical_elements; - srfhd.reg_partition = reg_partition; - htab_traverse (ssa_rename_from_ht, callback_function, (void *) &srfhd); -} - -/* Destroy ssa_rename_from. */ - -static void -ssa_rename_from_free (void) -{ - htab_delete (ssa_rename_from_ht); -} - -/* Print the contents of ssa_rename_from. */ - -/* static Avoid erroneous error message. */ -void -ssa_rename_from_print (void) -{ - printf ("ssa_rename_from's hash table contents:\n"); - htab_traverse (ssa_rename_from_ht, &ssa_rename_from_print_1, NULL); -} - -/* Print the contents of the hash table entry SLOT, passing the unused - attribute DATA. Used as a callback function with htab_traverse (). */ - -static int -ssa_rename_from_print_1 (void **slot, void *data ATTRIBUTE_UNUSED) -{ - ssa_rename_from_pair * p = *slot; - printf ("ssa_rename_from maps pseudo %i to original %i.\n", - p->reg, REGNO (p->original)); - return 1; -} - -/* Given a hash entry SRFP, yield a hash value. */ - -static hashval_t -ssa_rename_from_hash_function (const void *srfp) -{ - return ((const ssa_rename_from_pair *) srfp)->reg; -} - -/* Test whether two hash table entries SRFP1 and SRFP2 are equal. */ - -static int -ssa_rename_from_equal (const void *srfp1, const void *srfp2) -{ - return ssa_rename_from_hash_function (srfp1) == - ssa_rename_from_hash_function (srfp2); -} - -/* Delete the hash table entry SRFP. */ - -static void -ssa_rename_from_delete (void *srfp) -{ - free (srfp); -} - -/* Given the SET of a PHI node, return the address of the alternative - for predecessor block C. */ - -static inline rtx * -phi_alternative (rtx set, int c) -{ - rtvec phi_vec = XVEC (SET_SRC (set), 0); - int v; - - for (v = GET_NUM_ELEM (phi_vec) - 2; v >= 0; v -= 2) - if (INTVAL (RTVEC_ELT (phi_vec, v + 1)) == c) - return &RTVEC_ELT (phi_vec, v); - - return NULL; -} - -/* Given the SET of a phi node, remove the alternative for predecessor - block C. Return nonzero on success, or zero if no alternative is - found for C. */ - -int -remove_phi_alternative (rtx set, basic_block block) -{ - rtvec phi_vec = XVEC (SET_SRC (set), 0); - int num_elem = GET_NUM_ELEM (phi_vec); - int v, c; - - c = block->index; - for (v = num_elem - 2; v >= 0; v -= 2) - if (INTVAL (RTVEC_ELT (phi_vec, v + 1)) == c) - { - if (v < num_elem - 2) - { - RTVEC_ELT (phi_vec, v) = RTVEC_ELT (phi_vec, num_elem - 2); - RTVEC_ELT (phi_vec, v + 1) = RTVEC_ELT (phi_vec, num_elem - 1); - } - PUT_NUM_ELEM (phi_vec, num_elem - 2); - return 1; - } - - return 0; -} - -/* For all registers, find all blocks in which they are set. - - This is the transform of what would be local kill information that - we ought to be getting from flow. */ - -static sbitmap *fe_evals; -static int fe_current_bb; - -static void -find_evaluations_1 (rtx dest, rtx set ATTRIBUTE_UNUSED, - void *data ATTRIBUTE_UNUSED) -{ - if (GET_CODE (dest) == REG - && CONVERT_REGISTER_TO_SSA_P (REGNO (dest))) - SET_BIT (fe_evals[REGNO (dest)], fe_current_bb); -} - -static void -find_evaluations (sbitmap *evals, int nregs) -{ - basic_block bb; - - sbitmap_vector_zero (evals, nregs); - fe_evals = evals; - - FOR_EACH_BB_REVERSE (bb) - { - rtx p, last; - - fe_current_bb = bb->index; - p = bb->head; - last = bb->end; - while (1) - { - if (INSN_P (p)) - note_stores (PATTERN (p), find_evaluations_1, NULL); - - if (p == last) - break; - p = NEXT_INSN (p); - } - } -} - -/* Computing the Dominance Frontier: - - As described in Morgan, section 3.5, this may be done simply by - walking the dominator tree bottom-up, computing the frontier for - the children before the parent. When considering a block B, - there are two cases: - - (1) A flow graph edge leaving B that does not lead to a child - of B in the dominator tree must be a block that is either equal - to B or not dominated by B. Such blocks belong in the frontier - of B. - - (2) Consider a block X in the frontier of one of the children C - of B. If X is not equal to B and is not dominated by B, it - is in the frontier of B. -*/ - -static void -compute_dominance_frontiers_1 (sbitmap *frontiers, dominance_info idom, - int bb, sbitmap done) -{ - basic_block b = BASIC_BLOCK (bb); - edge e; - basic_block c; - - SET_BIT (done, bb); - sbitmap_zero (frontiers[bb]); - - /* Do the frontier of the children first. Not all children in the - dominator tree (blocks dominated by this one) are children in the - CFG, so check all blocks. */ - FOR_EACH_BB (c) - if (get_immediate_dominator (idom, c)->index == bb - && ! TEST_BIT (done, c->index)) - compute_dominance_frontiers_1 (frontiers, idom, c->index, done); - - /* Find blocks conforming to rule (1) above. */ - for (e = b->succ; e; e = e->succ_next) - { - if (e->dest == EXIT_BLOCK_PTR) - continue; - if (get_immediate_dominator (idom, e->dest)->index != bb) - SET_BIT (frontiers[bb], e->dest->index); - } - - /* Find blocks conforming to rule (2). */ - FOR_EACH_BB (c) - if (get_immediate_dominator (idom, c)->index == bb) - { - int x; - EXECUTE_IF_SET_IN_SBITMAP (frontiers[c->index], 0, x, - { - if (get_immediate_dominator (idom, BASIC_BLOCK (x))->index != bb) - SET_BIT (frontiers[bb], x); - }); - } -} - -void -compute_dominance_frontiers (sbitmap *frontiers, dominance_info idom) -{ - sbitmap done = sbitmap_alloc (last_basic_block); - sbitmap_zero (done); - - compute_dominance_frontiers_1 (frontiers, idom, 0, done); - - sbitmap_free (done); -} - -/* Computing the Iterated Dominance Frontier: - - This is the set of merge points for a given register. - - This is not particularly intuitive. See section 7.1 of Morgan, in - particular figures 7.3 and 7.4 and the immediately surrounding text. -*/ - -static void -compute_iterated_dominance_frontiers (sbitmap *idfs, sbitmap *frontiers, - sbitmap *evals, int nregs) -{ - sbitmap worklist; - int reg, passes = 0; - - worklist = sbitmap_alloc (last_basic_block); - - for (reg = 0; reg < nregs; ++reg) - { - sbitmap idf = idfs[reg]; - int b, changed; - - /* Start the iterative process by considering those blocks that - evaluate REG. We'll add their dominance frontiers to the - IDF, and then consider the blocks we just added. */ - sbitmap_copy (worklist, evals[reg]); - - /* Morgan's algorithm is incorrect here. Blocks that evaluate - REG aren't necessarily in REG's IDF. Start with an empty IDF. */ - sbitmap_zero (idf); - - /* Iterate until the worklist is empty. */ - do - { - changed = 0; - passes++; - EXECUTE_IF_SET_IN_SBITMAP (worklist, 0, b, - { - RESET_BIT (worklist, b); - /* For each block on the worklist, add to the IDF all - blocks on its dominance frontier that aren't already - on the IDF. Every block that's added is also added - to the worklist. */ - sbitmap_union_of_diff (worklist, worklist, frontiers[b], idf); - sbitmap_a_or_b (idf, idf, frontiers[b]); - changed = 1; - }); - } - while (changed); - } - - sbitmap_free (worklist); - - if (rtl_dump_file) - { - fprintf (rtl_dump_file, - "Iterated dominance frontier: %d passes on %d regs.\n", - passes, nregs); - } -} - -/* Insert the phi nodes. */ - -static void -insert_phi_node (int regno, int bb) -{ - basic_block b = BASIC_BLOCK (bb); - edge e; - int npred, i; - rtvec vec; - rtx phi, reg; - rtx insn; - int end_p; - - /* Find out how many predecessors there are. */ - for (e = b->pred, npred = 0; e; e = e->pred_next) - if (e->src != ENTRY_BLOCK_PTR) - npred++; - - /* If this block has no "interesting" preds, then there is nothing to - do. Consider a block that only has the entry block as a pred. */ - if (npred == 0) - return; - - /* This is the register to which the phi function will be assigned. */ - reg = regno_reg_rtx[regno]; - - /* Construct the arguments to the PHI node. The use of pc_rtx is just - a placeholder; we'll insert the proper value in rename_registers. */ - vec = rtvec_alloc (npred * 2); - for (e = b->pred, i = 0; e ; e = e->pred_next, i += 2) - if (e->src != ENTRY_BLOCK_PTR) - { - RTVEC_ELT (vec, i + 0) = pc_rtx; - RTVEC_ELT (vec, i + 1) = GEN_INT (e->src->index); - } - - phi = gen_rtx_PHI (VOIDmode, vec); - phi = gen_rtx_SET (VOIDmode, reg, phi); - - insn = first_insn_after_basic_block_note (b); - end_p = PREV_INSN (insn) == b->end; - emit_insn_before (phi, insn); - if (end_p) - b->end = PREV_INSN (insn); -} - -static void -insert_phi_nodes (sbitmap *idfs, sbitmap *evals ATTRIBUTE_UNUSED, int nregs) -{ - int reg; - - for (reg = 0; reg < nregs; ++reg) - if (CONVERT_REGISTER_TO_SSA_P (reg)) - { - int b; - EXECUTE_IF_SET_IN_SBITMAP (idfs[reg], 0, b, - { - if (REGNO_REG_SET_P (BASIC_BLOCK (b)->global_live_at_start, reg)) - insert_phi_node (reg, b); - }); - } -} - -/* Rename the registers to conform to SSA. - - This is essentially the algorithm presented in Figure 7.8 of Morgan, - with a few changes to reduce pattern search time in favor of a bit - more memory usage. */ - -/* One of these is created for each set. It will live in a list local - to its basic block for the duration of that block's processing. */ -struct rename_set_data -{ - struct rename_set_data *next; - /* This is the SET_DEST of the (first) SET that sets the REG. */ - rtx *reg_loc; - /* This is what used to be at *REG_LOC. */ - rtx old_reg; - /* This is the REG that will replace OLD_REG. It's set only - when the rename data is moved onto the DONE_RENAMES queue. */ - rtx new_reg; - /* This is what to restore ssa_rename_to_lookup (old_reg) to. It is - usually the previous contents of ssa_rename_to_lookup (old_reg). */ - rtx prev_reg; - /* This is the insn that contains all the SETs of the REG. */ - rtx set_insn; -}; - -/* This struct is used to pass information to callback functions while - renaming registers. */ -struct rename_context -{ - struct rename_set_data *new_renames; - struct rename_set_data *done_renames; - rtx current_insn; -}; - -/* Queue the rename of *REG_LOC. */ -static void -create_delayed_rename (struct rename_context *c, rtx *reg_loc) -{ - struct rename_set_data *r; - r = xmalloc (sizeof(*r)); - - if (GET_CODE (*reg_loc) != REG - || !CONVERT_REGISTER_TO_SSA_P (REGNO (*reg_loc))) - abort (); - - r->reg_loc = reg_loc; - r->old_reg = *reg_loc; - r->prev_reg = ssa_rename_to_lookup(r->old_reg); - r->set_insn = c->current_insn; - r->next = c->new_renames; - c->new_renames = r; -} - -/* This is part of a rather ugly hack to allow the pre-ssa regno to be - reused. If, during processing, a register has not yet been touched, - ssa_rename_to[regno][machno] will be NULL. Now, in the course of pushing - and popping values from ssa_rename_to, when we would ordinarily - pop NULL back in, we pop RENAME_NO_RTX. We treat this exactly the - same as NULL, except that it signals that the original regno has - already been reused. */ -#define RENAME_NO_RTX pc_rtx - -/* Move all the entries from NEW_RENAMES onto DONE_RENAMES by - applying all the renames on NEW_RENAMES. */ - -static void -apply_delayed_renames (struct rename_context *c) -{ - struct rename_set_data *r; - struct rename_set_data *last_r = NULL; - - for (r = c->new_renames; r != NULL; r = r->next) - { - int new_regno; - - /* Failure here means that someone has a PARALLEL that sets - a register twice (bad!). */ - if (ssa_rename_to_lookup (r->old_reg) != r->prev_reg) - abort (); - /* Failure here means we have changed REG_LOC before applying - the rename. */ - /* For the first set we come across, reuse the original regno. */ - if (r->prev_reg == NULL_RTX && !HARD_REGISTER_P (r->old_reg)) - { - r->new_reg = r->old_reg; - /* We want to restore RENAME_NO_RTX rather than NULL_RTX. */ - r->prev_reg = RENAME_NO_RTX; - } - else - r->new_reg = gen_reg_rtx (GET_MODE (r->old_reg)); - new_regno = REGNO (r->new_reg); - ssa_rename_to_insert (r->old_reg, r->new_reg); - - if (new_regno >= (int) ssa_definition->num_elements) - { - int new_limit = new_regno * 5 / 4; - VARRAY_GROW (ssa_definition, new_limit); - } - - VARRAY_RTX (ssa_definition, new_regno) = r->set_insn; - ssa_rename_from_insert (new_regno, r->old_reg); - last_r = r; - } - if (last_r != NULL) - { - last_r->next = c->done_renames; - c->done_renames = c->new_renames; - c->new_renames = NULL; - } -} - -/* Part one of the first step of rename_block, called through for_each_rtx. - Mark pseudos that are set for later update. Transform uses of pseudos. */ - -static int -rename_insn_1 (rtx *ptr, void *data) -{ - rtx x = *ptr; - struct rename_context *context = data; - - if (x == NULL_RTX) - return 0; - - switch (GET_CODE (x)) - { - case SET: - { - rtx *destp = &SET_DEST (x); - rtx dest = SET_DEST (x); - - /* An assignment to a paradoxical SUBREG does not read from - the destination operand, and thus does not need to be - wrapped into a SEQUENCE when translating into SSA form. - We merely strip off the SUBREG and proceed normally for - this case. */ - if (GET_CODE (dest) == SUBREG - && (GET_MODE_SIZE (GET_MODE (dest)) - > GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest)))) - && GET_CODE (SUBREG_REG (dest)) == REG - && CONVERT_REGISTER_TO_SSA_P (REGNO (SUBREG_REG (dest)))) - { - destp = &XEXP (dest, 0); - dest = XEXP (dest, 0); - } - - /* Some SETs also use the REG specified in their LHS. - These can be detected by the presence of - STRICT_LOW_PART, SUBREG, SIGN_EXTRACT, and ZERO_EXTRACT - in the LHS. Handle these by changing - (set (subreg (reg foo)) ...) - into - (sequence [(set (reg foo_1) (reg foo)) - (set (subreg (reg foo_1)) ...)]) - - FIXME: Much of the time this is too much. For some constructs - we know that the output register is strictly an output - (paradoxical SUBREGs and some libcalls for example). - - For those cases we are better off not making the false - dependency. */ - if (GET_CODE (dest) == STRICT_LOW_PART - || GET_CODE (dest) == SUBREG - || GET_CODE (dest) == SIGN_EXTRACT - || GET_CODE (dest) == ZERO_EXTRACT) - { - rtx i, reg; - reg = dest; - - while (GET_CODE (reg) == STRICT_LOW_PART - || GET_CODE (reg) == SUBREG - || GET_CODE (reg) == SIGN_EXTRACT - || GET_CODE (reg) == ZERO_EXTRACT) - reg = XEXP (reg, 0); - - if (GET_CODE (reg) == REG - && CONVERT_REGISTER_TO_SSA_P (REGNO (reg))) - { - /* Generate (set reg reg), and do renaming on it so - that it becomes (set reg_1 reg_0), and we will - replace reg with reg_1 in the SUBREG. */ - - struct rename_set_data *saved_new_renames; - saved_new_renames = context->new_renames; - context->new_renames = NULL; - i = emit_insn (gen_rtx_SET (VOIDmode, reg, reg)); - for_each_rtx (&i, rename_insn_1, data); - apply_delayed_renames (context); - context->new_renames = saved_new_renames; - } - } - else if (GET_CODE (dest) == REG - && CONVERT_REGISTER_TO_SSA_P (REGNO (dest))) - { - /* We found a genuine set of an interesting register. Tag - it so that we can create a new name for it after we finish - processing this insn. */ - - create_delayed_rename (context, destp); - - /* Since we do not wish to (directly) traverse the - SET_DEST, recurse through for_each_rtx for the SET_SRC - and return. */ - if (GET_CODE (x) == SET) - for_each_rtx (&SET_SRC (x), rename_insn_1, data); - return -1; - } - - /* Otherwise, this was not an interesting destination. Continue - on, marking uses as normal. */ - return 0; - } - - case REG: - if (CONVERT_REGISTER_TO_SSA_P (REGNO (x)) - && REGNO (x) < ssa_max_reg_num) - { - rtx new_reg = ssa_rename_to_lookup (x); - - if (new_reg != RENAME_NO_RTX && new_reg != NULL_RTX) - { - if (GET_MODE (x) != GET_MODE (new_reg)) - abort (); - *ptr = new_reg; - } - else - { - /* Undefined value used, rename it to a new pseudo register so - that it cannot conflict with an existing register. */ - *ptr = gen_reg_rtx (GET_MODE (x)); - } - } - return -1; - - case CLOBBER: - /* There is considerable debate on how CLOBBERs ought to be - handled in SSA. For now, we're keeping the CLOBBERs, which - means that we don't really have SSA form. There are a couple - of proposals for how to fix this problem, but neither is - implemented yet. */ - { - rtx dest = XCEXP (x, 0, CLOBBER); - if (REG_P (dest)) - { - if (CONVERT_REGISTER_TO_SSA_P (REGNO (dest)) - && REGNO (dest) < ssa_max_reg_num) - { - rtx new_reg = ssa_rename_to_lookup (dest); - if (new_reg != NULL_RTX && new_reg != RENAME_NO_RTX) - XCEXP (x, 0, CLOBBER) = new_reg; - } - /* Stop traversing. */ - return -1; - } - else - /* Continue traversing. */ - return 0; - } - - case PHI: - /* Never muck with the phi. We do that elsewhere, special-like. */ - return -1; - - default: - /* Anything else, continue traversing. */ - return 0; - } -} - -static rtx -gen_sequence (void) -{ - rtx first_insn = get_insns (); - rtx result; - rtx tem; - int i; - int len; - - /* Count the insns in the chain. */ - len = 0; - for (tem = first_insn; tem; tem = NEXT_INSN (tem)) - len++; - - result = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (len)); - - for (i = 0, tem = first_insn; tem; tem = NEXT_INSN (tem), i++) - XVECEXP (result, 0, i) = tem; - - return result; -} - -static void -rename_block (int bb, dominance_info idom) -{ - basic_block b = BASIC_BLOCK (bb); - edge e; - rtx insn, next, last; - struct rename_set_data *set_data = NULL; - basic_block c; - - /* Step One: Walk the basic block, adding new names for sets and - replacing uses. */ - - next = b->head; - last = b->end; - do - { - insn = next; - if (INSN_P (insn)) - { - struct rename_context context; - context.done_renames = set_data; - context.new_renames = NULL; - context.current_insn = insn; - - start_sequence (); - for_each_rtx (&PATTERN (insn), rename_insn_1, &context); - for_each_rtx (®_NOTES (insn), rename_insn_1, &context); - - /* Sometimes, we end up with a sequence of insns that - SSA needs to treat as a single insn. Wrap these in a - SEQUENCE. (Any notes now get attached to the SEQUENCE, - not to the old version inner insn.) */ - if (get_insns () != NULL_RTX) - { - rtx seq; - int i; - - emit (PATTERN (insn)); - seq = gen_sequence (); - /* We really want a SEQUENCE of SETs, not a SEQUENCE - of INSNs. */ - for (i = 0; i < XVECLEN (seq, 0); i++) - XVECEXP (seq, 0, i) = PATTERN (XVECEXP (seq, 0, i)); - PATTERN (insn) = seq; - } - end_sequence (); - - apply_delayed_renames (&context); - set_data = context.done_renames; - } - - next = NEXT_INSN (insn); - } - while (insn != last); - - /* Step Two: Update the phi nodes of this block's successors. */ - - for (e = b->succ; e; e = e->succ_next) - { - if (e->dest == EXIT_BLOCK_PTR) - continue; - - insn = first_insn_after_basic_block_note (e->dest); - - while (PHI_NODE_P (insn)) - { - rtx phi = PATTERN (insn); - rtx reg; - - /* Find out which of our outgoing registers this node is - intended to replace. Note that if this is not the first PHI - node to have been created for this register, we have to - jump through rename links to figure out which register - we're talking about. This can easily be recognized by - noting that the regno is new to this pass. */ - reg = SET_DEST (phi); - if (REGNO (reg) >= ssa_max_reg_num) - reg = ssa_rename_from_lookup (REGNO (reg)); - if (reg == NULL_RTX) - abort (); - reg = ssa_rename_to_lookup (reg); - - /* It is possible for the variable to be uninitialized on - edges in. Reduce the arity of the PHI so that we don't - consider those edges. */ - if (reg == NULL || reg == RENAME_NO_RTX) - { - if (! remove_phi_alternative (phi, b)) - abort (); - } - else - { - /* When we created the PHI nodes, we did not know what mode - the register should be. Now that we've found an original, - we can fill that in. */ - if (GET_MODE (SET_DEST (phi)) == VOIDmode) - PUT_MODE (SET_DEST (phi), GET_MODE (reg)); - else if (GET_MODE (SET_DEST (phi)) != GET_MODE (reg)) - abort (); - - *phi_alternative (phi, bb) = reg; - } - - insn = NEXT_INSN (insn); - } - } - - /* Step Three: Do the same to the children of this block in - dominator order. */ - - FOR_EACH_BB (c) - if (get_immediate_dominator (idom, c)->index == bb) - rename_block (c->index, idom); - - /* Step Four: Update the sets to refer to their new register, - and restore ssa_rename_to to its previous state. */ - - while (set_data) - { - struct rename_set_data *next; - rtx old_reg = *set_data->reg_loc; - - if (*set_data->reg_loc != set_data->old_reg) - abort (); - *set_data->reg_loc = set_data->new_reg; - - ssa_rename_to_insert (old_reg, set_data->prev_reg); - - next = set_data->next; - free (set_data); - set_data = next; - } -} - -static void -rename_registers (int nregs, dominance_info idom) -{ - VARRAY_RTX_INIT (ssa_definition, nregs * 3, "ssa_definition"); - ssa_rename_from_initialize (); - - ssa_rename_to_pseudo = alloca (nregs * sizeof(rtx)); - memset (ssa_rename_to_pseudo, 0, nregs * sizeof(rtx)); - memset (ssa_rename_to_hard, 0, - FIRST_PSEUDO_REGISTER * NUM_MACHINE_MODES * sizeof (rtx)); - - rename_block (0, idom); - - /* ??? Update basic_block_live_at_start, and other flow info - as needed. */ - - ssa_rename_to_pseudo = NULL; -} - -/* The main entry point for moving to SSA. */ - -void -convert_to_ssa (void) -{ - /* Element I is the set of blocks that set register I. */ - sbitmap *evals; - - /* Dominator bitmaps. */ - sbitmap *dfs; - sbitmap *idfs; - - /* Element I is the immediate dominator of block I. */ - dominance_info idom; - - int nregs; - - basic_block bb; - - /* Don't do it twice. */ - if (in_ssa_form) - abort (); - - /* Need global_live_at_{start,end} up to date. Do not remove any - dead code. We'll let the SSA optimizers do that. */ - life_analysis (get_insns (), NULL, 0); - - idom = calculate_dominance_info (CDI_DOMINATORS); - - if (rtl_dump_file) - { - fputs (";; Immediate Dominators:\n", rtl_dump_file); - FOR_EACH_BB (bb) - fprintf (rtl_dump_file, ";\t%3d = %3d\n", bb->index, - get_immediate_dominator (idom, bb)->index); - fflush (rtl_dump_file); - } - - /* Compute dominance frontiers. */ - - dfs = sbitmap_vector_alloc (last_basic_block, last_basic_block); - compute_dominance_frontiers (dfs, idom); - - if (rtl_dump_file) - { - dump_sbitmap_vector (rtl_dump_file, ";; Dominance Frontiers:", - "; Basic Block", dfs, last_basic_block); - fflush (rtl_dump_file); - } - - /* Compute register evaluations. */ - - ssa_max_reg_num = max_reg_num (); - nregs = ssa_max_reg_num; - evals = sbitmap_vector_alloc (nregs, last_basic_block); - find_evaluations (evals, nregs); - - /* Compute the iterated dominance frontier for each register. */ - - idfs = sbitmap_vector_alloc (nregs, last_basic_block); - compute_iterated_dominance_frontiers (idfs, dfs, evals, nregs); - - if (rtl_dump_file) - { - dump_sbitmap_vector (rtl_dump_file, ";; Iterated Dominance Frontiers:", - "; Register", idfs, nregs); - fflush (rtl_dump_file); - } - - /* Insert the phi nodes. */ - - insert_phi_nodes (idfs, evals, nregs); - - /* Rename the registers to satisfy SSA. */ - - rename_registers (nregs, idom); - - /* All done! Clean up and go home. */ - - sbitmap_vector_free (dfs); - sbitmap_vector_free (evals); - sbitmap_vector_free (idfs); - in_ssa_form = 1; - - reg_scan (get_insns (), max_reg_num (), 1); - free_dominance_info (idom); -} - -/* REG is the representative temporary of its partition. Add it to the - set of nodes to be processed, if it hasn't been already. Return the - index of this register in the node set. */ - -static inline int -ephi_add_node (rtx reg, rtx *nodes, int *n_nodes) -{ - int i; - for (i = *n_nodes - 1; i >= 0; --i) - if (REGNO (reg) == REGNO (nodes[i])) - return i; - - nodes[i = (*n_nodes)++] = reg; - return i; -} - -/* Part one of the topological sort. This is a forward (downward) search - through the graph collecting a stack of nodes to process. Assuming no - cycles, the nodes at top of the stack when we are finished will have - no other dependencies. */ - -static int * -ephi_forward (int t, sbitmap visited, sbitmap *succ, int *tstack) -{ - int s; - - SET_BIT (visited, t); - - EXECUTE_IF_SET_IN_SBITMAP (succ[t], 0, s, - { - if (! TEST_BIT (visited, s)) - tstack = ephi_forward (s, visited, succ, tstack); - }); - - *tstack++ = t; - return tstack; -} - -/* Part two of the topological sort. The is a backward search through - a cycle in the graph, copying the data forward as we go. */ - -static void -ephi_backward (int t, sbitmap visited, sbitmap *pred, rtx *nodes) -{ - int p; - - SET_BIT (visited, t); - - EXECUTE_IF_SET_IN_SBITMAP (pred[t], 0, p, - { - if (! TEST_BIT (visited, p)) - { - ephi_backward (p, visited, pred, nodes); - emit_move_insn (nodes[p], nodes[t]); - } - }); -} - -/* Part two of the topological sort. Create the copy for a register - and any cycle of which it is a member. */ - -static void -ephi_create (int t, sbitmap visited, sbitmap *pred, sbitmap *succ, rtx *nodes) -{ - rtx reg_u = NULL_RTX; - int unvisited_predecessors = 0; - int p; - - /* Iterate through the predecessor list looking for unvisited nodes. - If there are any, we have a cycle, and must deal with that. At - the same time, look for a visited predecessor. If there is one, - we won't need to create a temporary. */ - - EXECUTE_IF_SET_IN_SBITMAP (pred[t], 0, p, - { - if (! TEST_BIT (visited, p)) - unvisited_predecessors = 1; - else if (!reg_u) - reg_u = nodes[p]; - }); - - if (unvisited_predecessors) - { - /* We found a cycle. Copy out one element of the ring (if necessary), - then traverse the ring copying as we go. */ - - if (!reg_u) - { - reg_u = gen_reg_rtx (GET_MODE (nodes[t])); - emit_move_insn (reg_u, nodes[t]); - } - - EXECUTE_IF_SET_IN_SBITMAP (pred[t], 0, p, - { - if (! TEST_BIT (visited, p)) - { - ephi_backward (p, visited, pred, nodes); - emit_move_insn (nodes[p], reg_u); - } - }); - } - else - { - /* No cycle. Just copy the value from a successor. */ - - int s; - EXECUTE_IF_SET_IN_SBITMAP (succ[t], 0, s, - { - SET_BIT (visited, t); - emit_move_insn (nodes[t], nodes[s]); - return; - }); - } -} - -/* Convert the edge to normal form. */ - -static void -eliminate_phi (edge e, partition reg_partition) -{ - int n_nodes; - sbitmap *pred, *succ; - sbitmap visited; - rtx *nodes; - int *stack, *tstack; - rtx insn; - int i; - - /* Collect an upper bound on the number of registers needing processing. */ - - insn = first_insn_after_basic_block_note (e->dest); - - n_nodes = 0; - while (PHI_NODE_P (insn)) - { - insn = next_nonnote_insn (insn); - n_nodes += 2; - } - - if (n_nodes == 0) - return; - - /* Build the auxiliary graph R(B). - - The nodes of the graph are the members of the register partition - present in Phi(B). There is an edge from FIND(T0)->FIND(T1) for - each T0 = PHI(...,T1,...), where T1 is for the edge from block C. */ - - nodes = alloca (n_nodes * sizeof(rtx)); - pred = sbitmap_vector_alloc (n_nodes, n_nodes); - succ = sbitmap_vector_alloc (n_nodes, n_nodes); - sbitmap_vector_zero (pred, n_nodes); - sbitmap_vector_zero (succ, n_nodes); - - insn = first_insn_after_basic_block_note (e->dest); - - n_nodes = 0; - for (; PHI_NODE_P (insn); insn = next_nonnote_insn (insn)) - { - rtx* preg = phi_alternative (PATTERN (insn), e->src->index); - rtx tgt = SET_DEST (PATTERN (insn)); - rtx reg; - - /* There may be no phi alternative corresponding to this edge. - This indicates that the phi variable is undefined along this - edge. */ - if (preg == NULL) - continue; - reg = *preg; - - if (GET_CODE (reg) != REG || GET_CODE (tgt) != REG) - abort (); - - reg = regno_reg_rtx[partition_find (reg_partition, REGNO (reg))]; - tgt = regno_reg_rtx[partition_find (reg_partition, REGNO (tgt))]; - /* If the two registers are already in the same partition, - nothing will need to be done. */ - if (reg != tgt) - { - int ireg, itgt; - - ireg = ephi_add_node (reg, nodes, &n_nodes); - itgt = ephi_add_node (tgt, nodes, &n_nodes); - - SET_BIT (pred[ireg], itgt); - SET_BIT (succ[itgt], ireg); - } - } - - if (n_nodes == 0) - goto out; - - /* Begin a topological sort of the graph. */ - - visited = sbitmap_alloc (n_nodes); - sbitmap_zero (visited); - - tstack = stack = alloca (n_nodes * sizeof (int)); - - for (i = 0; i < n_nodes; ++i) - if (! TEST_BIT (visited, i)) - tstack = ephi_forward (i, visited, succ, tstack); - - sbitmap_zero (visited); - - /* As we find a solution to the tsort, collect the implementation - insns in a sequence. */ - start_sequence (); - - while (tstack != stack) - { - i = *--tstack; - if (! TEST_BIT (visited, i)) - ephi_create (i, visited, pred, succ, nodes); - } - - insn = get_insns (); - end_sequence (); - insert_insn_on_edge (insn, e); - if (rtl_dump_file) - fprintf (rtl_dump_file, "Emitting copy on edge (%d,%d)\n", - e->src->index, e->dest->index); - - sbitmap_free (visited); -out: - sbitmap_vector_free (pred); - sbitmap_vector_free (succ); -} - -/* For basic block B, consider all phi insns which provide an - alternative corresponding to an incoming abnormal critical edge. - Place the phi alternative corresponding to that abnormal critical - edge in the same register class as the destination of the set. - - From Morgan, p. 178: - - For each abnormal critical edge (C, B), - if T0 = phi (T1, ..., Ti, ..., Tm) is a phi node in B, - and C is the ith predecessor of B, - then T0 and Ti must be equivalent. - - Return nonzero iff any such cases were found for which the two - regs were not already in the same class. */ - -static int -make_regs_equivalent_over_bad_edges (int bb, partition reg_partition) -{ - int changed = 0; - basic_block b = BASIC_BLOCK (bb); - rtx phi; - - /* Advance to the first phi node. */ - phi = first_insn_after_basic_block_note (b); - - /* Scan all the phi nodes. */ - for (; - PHI_NODE_P (phi); - phi = next_nonnote_insn (phi)) - { - edge e; - int tgt_regno; - rtx set = PATTERN (phi); - rtx tgt = SET_DEST (set); - - /* The set target is expected to be an SSA register. */ - if (GET_CODE (tgt) != REG - || !CONVERT_REGISTER_TO_SSA_P (REGNO (tgt))) - abort (); - tgt_regno = REGNO (tgt); - - /* Scan incoming abnormal critical edges. */ - for (e = b->pred; e; e = e->pred_next) - if ((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e)) - { - rtx *alt = phi_alternative (set, e->src->index); - int alt_regno; - - /* If there is no alternative corresponding to this edge, - the value is undefined along the edge, so just go on. */ - if (alt == 0) - continue; - - /* The phi alternative is expected to be an SSA register. */ - if (GET_CODE (*alt) != REG - || !CONVERT_REGISTER_TO_SSA_P (REGNO (*alt))) - abort (); - alt_regno = REGNO (*alt); - - /* If the set destination and the phi alternative aren't - already in the same class... */ - if (partition_find (reg_partition, tgt_regno) - != partition_find (reg_partition, alt_regno)) - { - /* ... make them such. */ - if (conflicting_hard_regs_p (tgt_regno, alt_regno)) - /* It is illegal to unify a hard register with a - different register. */ - abort (); - - partition_union (reg_partition, - tgt_regno, alt_regno); - ++changed; - } - } - } - - return changed; -} - -/* Consider phi insns in basic block BB pairwise. If the set target - of both insns are equivalent pseudos, make the corresponding phi - alternatives in each phi corresponding equivalent. - - Return nonzero if any new register classes were unioned. */ - -static int -make_equivalent_phi_alternatives_equivalent (int bb, partition reg_partition) -{ - int changed = 0; - basic_block b = BASIC_BLOCK (bb); - rtx phi; - - /* Advance to the first phi node. */ - phi = first_insn_after_basic_block_note (b); - - /* Scan all the phi nodes. */ - for (; - PHI_NODE_P (phi); - phi = next_nonnote_insn (phi)) - { - rtx set = PATTERN (phi); - /* The regno of the destination of the set. */ - int tgt_regno = REGNO (SET_DEST (PATTERN (phi))); - - rtx phi2 = next_nonnote_insn (phi); - - /* Scan all phi nodes following this one. */ - for (; - PHI_NODE_P (phi2); - phi2 = next_nonnote_insn (phi2)) - { - rtx set2 = PATTERN (phi2); - /* The regno of the destination of the set. */ - int tgt2_regno = REGNO (SET_DEST (set2)); - - /* Are the set destinations equivalent regs? */ - if (partition_find (reg_partition, tgt_regno) == - partition_find (reg_partition, tgt2_regno)) - { - edge e; - /* Scan over edges. */ - for (e = b->pred; e; e = e->pred_next) - { - int pred_block = e->src->index; - /* Identify the phi alternatives from both phi - nodes corresponding to this edge. */ - rtx *alt = phi_alternative (set, pred_block); - rtx *alt2 = phi_alternative (set2, pred_block); - - /* If one of the phi nodes doesn't have a - corresponding alternative, just skip it. */ - if (alt == 0 || alt2 == 0) - continue; - - /* Both alternatives should be SSA registers. */ - if (GET_CODE (*alt) != REG - || !CONVERT_REGISTER_TO_SSA_P (REGNO (*alt))) - abort (); - if (GET_CODE (*alt2) != REG - || !CONVERT_REGISTER_TO_SSA_P (REGNO (*alt2))) - abort (); - - /* If the alternatives aren't already in the same - class ... */ - if (partition_find (reg_partition, REGNO (*alt)) - != partition_find (reg_partition, REGNO (*alt2))) - { - /* ... make them so. */ - if (conflicting_hard_regs_p (REGNO (*alt), REGNO (*alt2))) - /* It is illegal to unify a hard register with - a different register. */ - abort (); - - partition_union (reg_partition, - REGNO (*alt), REGNO (*alt2)); - ++changed; - } - } - } - } - } - - return changed; -} - -/* Compute a conservative partition of outstanding pseudo registers. - See Morgan 7.3.1. */ - -static partition -compute_conservative_reg_partition (void) -{ - basic_block bb; - int changed = 0; - - /* We don't actually work with hard registers, but it's easier to - carry them around anyway rather than constantly doing register - number arithmetic. */ - partition p = - partition_new (ssa_definition->num_elements); - - /* The first priority is to make sure registers that might have to - be copied on abnormal critical edges are placed in the same - partition. This saves us from having to split abnormal critical - edges. */ - FOR_EACH_BB_REVERSE (bb) - changed += make_regs_equivalent_over_bad_edges (bb->index, p); - - /* Now we have to insure that corresponding arguments of phi nodes - assigning to corresponding regs are equivalent. Iterate until - nothing changes. */ - while (changed > 0) - { - changed = 0; - FOR_EACH_BB_REVERSE (bb) - changed += make_equivalent_phi_alternatives_equivalent (bb->index, p); - } - - return p; -} - -/* The following functions compute a register partition that attempts - to eliminate as many reg copies and phi node copies as possible by - coalescing registers. This is the strategy: - - 1. As in the conservative case, the top priority is to coalesce - registers that otherwise would cause copies to be placed on - abnormal critical edges (which isn't possible). - - 2. Figure out which regs are involved (in the LHS or RHS) of - copies and phi nodes. Compute conflicts among these regs. - - 3. Walk around the instruction stream, placing two regs in the - same class of the partition if one appears on the LHS and the - other on the RHS of a copy or phi node and the two regs don't - conflict. The conflict information of course needs to be - updated. - - 4. If anything has changed, there may be new opportunities to - coalesce regs, so go back to 2. -*/ - -/* If REG1 and REG2 don't conflict in CONFLICTS, place them in the - same class of partition P, if they aren't already. Update - CONFLICTS appropriately. - - Returns one if REG1 and REG2 were placed in the same class but were - not previously; zero otherwise. - - See Morgan figure 11.15. */ - -static int -coalesce_if_unconflicting (partition p, conflict_graph conflicts, - int reg1, int reg2) -{ - int reg; - - /* Work only on SSA registers. */ - if (!CONVERT_REGISTER_TO_SSA_P (reg1) || !CONVERT_REGISTER_TO_SSA_P (reg2)) - return 0; - - /* Find the canonical regs for the classes containing REG1 and - REG2. */ - reg1 = partition_find (p, reg1); - reg2 = partition_find (p, reg2); - - /* If they're already in the same class, there's nothing to do. */ - if (reg1 == reg2) - return 0; - - /* If the regs conflict, our hands are tied. */ - if (conflicting_hard_regs_p (reg1, reg2) || - conflict_graph_conflict_p (conflicts, reg1, reg2)) - return 0; - - /* We're good to go. Put the regs in the same partition. */ - partition_union (p, reg1, reg2); - - /* Find the new canonical reg for the merged class. */ - reg = partition_find (p, reg1); - - /* Merge conflicts from the two previous classes. */ - conflict_graph_merge_regs (conflicts, reg, reg1); - conflict_graph_merge_regs (conflicts, reg, reg2); - - return 1; -} - -/* For each register copy insn in basic block BB, place the LHS and - RHS regs in the same class in partition P if they do not conflict - according to CONFLICTS. - - Returns the number of changes that were made to P. - - See Morgan figure 11.14. */ - -static int -coalesce_regs_in_copies (basic_block bb, partition p, conflict_graph conflicts) -{ - int changed = 0; - rtx insn; - rtx end = bb->end; - - /* Scan the instruction stream of the block. */ - for (insn = bb->head; insn != end; insn = NEXT_INSN (insn)) - { - rtx pattern; - rtx src; - rtx dest; - - /* If this isn't a set insn, go to the next insn. */ - if (GET_CODE (insn) != INSN) - continue; - pattern = PATTERN (insn); - if (GET_CODE (pattern) != SET) - continue; - - src = SET_SRC (pattern); - dest = SET_DEST (pattern); - - /* We're only looking for copies. */ - if (GET_CODE (src) != REG || GET_CODE (dest) != REG) - continue; - - /* Coalesce only if the reg modes are the same. As long as - each reg's rtx is unique, it can have only one mode, so two - pseudos of different modes can't be coalesced into one. - - FIXME: We can probably get around this by inserting SUBREGs - where appropriate, but for now we don't bother. */ - if (GET_MODE (src) != GET_MODE (dest)) - continue; - - /* Found a copy; see if we can use the same reg for both the - source and destination (and thus eliminate the copy, - ultimately). */ - changed += coalesce_if_unconflicting (p, conflicts, - REGNO (src), REGNO (dest)); - } - - return changed; -} - -struct phi_coalesce_context -{ - partition p; - conflict_graph conflicts; - int changed; -}; - -/* Callback function for for_each_successor_phi. If the set - destination and the phi alternative regs do not conflict, place - them in the same partition class. DATA is a pointer to a - phi_coalesce_context struct. */ - -static int -coalesce_reg_in_phi (rtx insn ATTRIBUTE_UNUSED, int dest_regno, - int src_regno, void *data) -{ - struct phi_coalesce_context *context = - (struct phi_coalesce_context *) data; - - /* Attempt to use the same reg, if they don't conflict. */ - context->changed - += coalesce_if_unconflicting (context->p, context->conflicts, - dest_regno, src_regno); - return 0; -} - -/* For each alternative in a phi function corresponding to basic block - BB (in phi nodes in successor block to BB), place the reg in the - phi alternative and the reg to which the phi value is set into the - same class in partition P, if allowed by CONFLICTS. - - Return the number of changes that were made to P. - - See Morgan figure 11.14. */ - -static int -coalesce_regs_in_successor_phi_nodes (basic_block bb, partition p, - conflict_graph conflicts) -{ - struct phi_coalesce_context context; - context.p = p; - context.conflicts = conflicts; - context.changed = 0; - - for_each_successor_phi (bb, &coalesce_reg_in_phi, &context); - - return context.changed; -} - -/* Compute and return a partition of pseudos. Where possible, - non-conflicting pseudos are placed in the same class. - - The caller is responsible for deallocating the returned partition. */ - -static partition -compute_coalesced_reg_partition (void) -{ - basic_block bb; - int changed = 0; - regset_head phi_set_head; - regset phi_set = &phi_set_head; - - partition p = - partition_new (ssa_definition->num_elements); - - /* The first priority is to make sure registers that might have to - be copied on abnormal critical edges are placed in the same - partition. This saves us from having to split abnormal critical - edges (which can't be done). */ - FOR_EACH_BB_REVERSE (bb) - make_regs_equivalent_over_bad_edges (bb->index, p); - - INIT_REG_SET (phi_set); - - do - { - conflict_graph conflicts; - - changed = 0; - - /* Build the set of registers involved in phi nodes, either as - arguments to the phi function or as the target of a set. */ - CLEAR_REG_SET (phi_set); - mark_phi_and_copy_regs (phi_set); - - /* Compute conflicts. */ - conflicts = conflict_graph_compute (phi_set, p); - - /* FIXME: Better would be to process most frequently executed - blocks first, so that most frequently executed copies would - be more likely to be removed by register coalescing. But any - order will generate correct, if non-optimal, results. */ - FOR_EACH_BB_REVERSE (bb) - { - changed += coalesce_regs_in_copies (bb, p, conflicts); - changed += - coalesce_regs_in_successor_phi_nodes (bb, p, conflicts); - } - - conflict_graph_delete (conflicts); - } - while (changed > 0); - - FREE_REG_SET (phi_set); - - return p; -} - -/* Mark the regs in a phi node. PTR is a phi expression or one of its - components (a REG or a CONST_INT). DATA is a reg set in which to - set all regs. Called from for_each_rtx. */ - -static int -mark_reg_in_phi (rtx *ptr, void *data) -{ - rtx expr = *ptr; - regset set = (regset) data; - - switch (GET_CODE (expr)) - { - case REG: - SET_REGNO_REG_SET (set, REGNO (expr)); - /* Fall through. */ - case CONST_INT: - case PHI: - return 0; - default: - abort (); - } -} - -/* Mark in PHI_SET all pseudos that are used in a phi node -- either - set from a phi expression, or used as an argument in one. Also - mark regs that are the source or target of a reg copy. Uses - ssa_definition. */ - -static void -mark_phi_and_copy_regs (regset phi_set) -{ - unsigned int reg; - - /* Scan the definitions of all regs. */ - for (reg = 0; reg < VARRAY_SIZE (ssa_definition); ++reg) - if (CONVERT_REGISTER_TO_SSA_P (reg)) - { - rtx insn = VARRAY_RTX (ssa_definition, reg); - rtx pattern; - rtx src; - - if (insn == NULL - || (GET_CODE (insn) == NOTE - && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)) - continue; - pattern = PATTERN (insn); - /* Sometimes we get PARALLEL insns. These aren't phi nodes or - copies. */ - if (GET_CODE (pattern) != SET) - continue; - src = SET_SRC (pattern); - - if (GET_CODE (src) == REG) - { - /* It's a reg copy. */ - SET_REGNO_REG_SET (phi_set, reg); - SET_REGNO_REG_SET (phi_set, REGNO (src)); - } - else if (GET_CODE (src) == PHI) - { - /* It's a phi node. Mark the reg being set. */ - SET_REGNO_REG_SET (phi_set, reg); - /* Mark the regs used in the phi function. */ - for_each_rtx (&src, mark_reg_in_phi, phi_set); - } - /* ... else nothing to do. */ - } -} - -/* Rename regs in insn PTR that are equivalent. DATA is the register - partition which specifies equivalences. */ - -static int -rename_equivalent_regs_in_insn (rtx *ptr, void* data) -{ - rtx x = *ptr; - partition reg_partition = (partition) data; - - if (x == NULL_RTX) - return 0; - - switch (GET_CODE (x)) - { - case REG: - if (CONVERT_REGISTER_TO_SSA_P (REGNO (x))) - { - unsigned int regno = REGNO (x); - unsigned int new_regno = partition_find (reg_partition, regno); - rtx canonical_element_rtx = ssa_rename_from_lookup (new_regno); - - if (canonical_element_rtx != NULL_RTX && - HARD_REGISTER_P (canonical_element_rtx)) - { - if (REGNO (canonical_element_rtx) != regno) - *ptr = canonical_element_rtx; - } - else if (regno != new_regno) - { - rtx new_reg = regno_reg_rtx[new_regno]; - if (GET_MODE (x) != GET_MODE (new_reg)) - abort (); - *ptr = new_reg; - } - } - return -1; - - case PHI: - /* No need to rename the phi nodes. We'll check equivalence - when inserting copies. */ - return -1; - - default: - /* Anything else, continue traversing. */ - return 0; - } -} - -/* Record the register's canonical element stored in SRFP in the - canonical_elements sbitmap packaged in DATA. This function is used - as a callback function for traversing ssa_rename_from. */ - -static int -record_canonical_element_1 (void **srfp, void *data) -{ - unsigned int reg = ((ssa_rename_from_pair *) *srfp)->reg; - sbitmap canonical_elements = - ((struct ssa_rename_from_hash_table_data *) data)->canonical_elements; - partition reg_partition = - ((struct ssa_rename_from_hash_table_data *) data)->reg_partition; - - SET_BIT (canonical_elements, partition_find (reg_partition, reg)); - return 1; -} - -/* For each class in the REG_PARTITION corresponding to a particular - hard register and machine mode, check that there are no other - classes with the same hard register and machine mode. Returns - nonzero if this is the case, i.e., the partition is acceptable. */ - -static int -check_hard_regs_in_partition (partition reg_partition) -{ - /* CANONICAL_ELEMENTS has a nonzero bit if a class with the given register - number and machine mode has already been seen. This is a - problem with the partition. */ - sbitmap canonical_elements; - int element_index; - int already_seen[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES]; - int reg; - int mach_mode; - - /* Collect a list of canonical elements. */ - canonical_elements = sbitmap_alloc (max_reg_num ()); - sbitmap_zero (canonical_elements); - ssa_rename_from_traverse (&record_canonical_element_1, - canonical_elements, reg_partition); - - /* We have not seen any hard register uses. */ - for (reg = 0; reg < FIRST_PSEUDO_REGISTER; ++reg) - for (mach_mode = 0; mach_mode < NUM_MACHINE_MODES; ++mach_mode) - already_seen[reg][mach_mode] = 0; - - /* Check for classes with the same hard register and machine mode. */ - EXECUTE_IF_SET_IN_SBITMAP (canonical_elements, 0, element_index, - { - rtx hard_reg_rtx = ssa_rename_from_lookup (element_index); - if (hard_reg_rtx != NULL_RTX && - HARD_REGISTER_P (hard_reg_rtx) && - already_seen[REGNO (hard_reg_rtx)][GET_MODE (hard_reg_rtx)] != 0) - /* Two distinct partition classes should be mapped to the same - hard register. */ - return 0; - }); - - sbitmap_free (canonical_elements); - - return 1; -} - -/* Rename regs that are equivalent in REG_PARTITION. Also collapse - any SEQUENCE insns. */ - -static void -rename_equivalent_regs (partition reg_partition) -{ - basic_block b; - - FOR_EACH_BB_REVERSE (b) - { - rtx next = b->head; - rtx last = b->end; - rtx insn; - - do - { - insn = next; - if (INSN_P (insn)) - { - for_each_rtx (&PATTERN (insn), - rename_equivalent_regs_in_insn, - reg_partition); - for_each_rtx (®_NOTES (insn), - rename_equivalent_regs_in_insn, - reg_partition); - - if (GET_CODE (PATTERN (insn)) == SEQUENCE) - { - rtx s = PATTERN (insn); - int slen = XVECLEN (s, 0); - int i; - - if (slen <= 1) - abort (); - - PATTERN (insn) = XVECEXP (s, 0, slen-1); - for (i = 0; i < slen - 1; i++) - emit_insn_before (XVECEXP (s, 0, i), insn); - } - } - - next = NEXT_INSN (insn); - } - while (insn != last); - } -} - -/* The main entry point for moving from SSA. */ - -void -convert_from_ssa (void) -{ - basic_block b, bb; - partition reg_partition; - rtx insns = get_insns (); - - /* Need global_live_at_{start,end} up to date. There should not be - any significant dead code at this point, except perhaps dead - stores. So do not take the time to perform dead code elimination. - - Register coalescing needs death notes, so generate them. */ - life_analysis (insns, NULL, PROP_DEATH_NOTES); - - /* Figure out which regs in copies and phi nodes don't conflict and - therefore can be coalesced. */ - if (conservative_reg_partition) - reg_partition = compute_conservative_reg_partition (); - else - reg_partition = compute_coalesced_reg_partition (); - - if (!check_hard_regs_in_partition (reg_partition)) - /* Two separate partitions should correspond to the same hard - register but do not. */ - abort (); - - rename_equivalent_regs (reg_partition); - - /* Eliminate the PHI nodes. */ - FOR_EACH_BB_REVERSE (b) - { - edge e; - - for (e = b->pred; e; e = e->pred_next) - if (e->src != ENTRY_BLOCK_PTR) - eliminate_phi (e, reg_partition); - } - - partition_delete (reg_partition); - - /* Actually delete the PHI nodes. */ - FOR_EACH_BB_REVERSE (bb) - { - rtx insn = bb->head; - - while (1) - { - /* If this is a PHI node delete it. */ - if (PHI_NODE_P (insn)) - { - if (insn == bb->end) - bb->end = PREV_INSN (insn); - insn = delete_insn (insn); - } - /* Since all the phi nodes come at the beginning of the - block, if we find an ordinary insn, we can stop looking - for more phi nodes. */ - else if (INSN_P (insn)) - break; - /* If we've reached the end of the block, stop. */ - else if (insn == bb->end) - break; - else - insn = NEXT_INSN (insn); - } - } - - /* Commit all the copy nodes needed to convert out of SSA form. */ - commit_edge_insertions (); - - in_ssa_form = 0; - - count_or_remove_death_notes (NULL, 1); - - /* Deallocate the data structures. */ - ssa_definition = 0; - ssa_rename_from_free (); -} - -/* Scan phi nodes in successors to BB. For each such phi node that - has a phi alternative value corresponding to BB, invoke FN. FN - is passed the entire phi node insn, the regno of the set - destination, the regno of the phi argument corresponding to BB, - and DATA. - - If FN ever returns nonzero, stops immediately and returns this - value. Otherwise, returns zero. */ - -int -for_each_successor_phi (basic_block bb, successor_phi_fn fn, void *data) -{ - edge e; - - if (bb == EXIT_BLOCK_PTR) - return 0; - - /* Scan outgoing edges. */ - for (e = bb->succ; e != NULL; e = e->succ_next) - { - rtx insn; - - basic_block successor = e->dest; - if (successor == ENTRY_BLOCK_PTR - || successor == EXIT_BLOCK_PTR) - continue; - - /* Advance to the first non-label insn of the successor block. */ - insn = first_insn_after_basic_block_note (successor); - - if (insn == NULL) - continue; - - /* Scan phi nodes in the successor. */ - for ( ; PHI_NODE_P (insn); insn = NEXT_INSN (insn)) - { - int result; - rtx phi_set = PATTERN (insn); - rtx *alternative = phi_alternative (phi_set, bb->index); - rtx phi_src; - - /* This phi function may not have an alternative - corresponding to the incoming edge, indicating the - assigned variable is not defined along the edge. */ - if (alternative == NULL) - continue; - phi_src = *alternative; - - /* Invoke the callback. */ - result = (*fn) (insn, REGNO (SET_DEST (phi_set)), - REGNO (phi_src), data); - - /* Terminate if requested. */ - if (result != 0) - return result; - } - } - - return 0; -} - -/* Assuming the ssa_rename_from mapping has been established, yields - nonzero if 1) only one SSA register of REG1 and REG2 comes from a - hard register or 2) both SSA registers REG1 and REG2 come from - different hard registers. */ - -static int -conflicting_hard_regs_p (int reg1, int reg2) -{ - int orig_reg1 = original_register (reg1); - int orig_reg2 = original_register (reg2); - if (HARD_REGISTER_NUM_P (orig_reg1) && HARD_REGISTER_NUM_P (orig_reg2) - && orig_reg1 != orig_reg2) - return 1; - if (HARD_REGISTER_NUM_P (orig_reg1) && !HARD_REGISTER_NUM_P (orig_reg2)) - return 1; - if (!HARD_REGISTER_NUM_P (orig_reg1) && HARD_REGISTER_NUM_P (orig_reg2)) - return 1; - - return 0; -} diff --git a/gcc/ssa.h b/gcc/ssa.h deleted file mode 100644 index ab3cdf1a789..00000000000 --- a/gcc/ssa.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Static Single Assignment (SSA) definitions for GCC - Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. - Written by Jeffrey D. Oldham <oldham@codesourcery.com>. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later -version. - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - - -/* Main SSA routines. */ -extern void convert_to_ssa (void); -extern void convert_from_ssa (void); -typedef int (*successor_phi_fn) (rtx, int, int, void *); -extern int for_each_successor_phi (basic_block bb, successor_phi_fn, - void *); -void compute_dominance_frontiers (sbitmap *frontiers, dominance_info idom); -extern int remove_phi_alternative (rtx, basic_block); - - -/* Optimizations. */ -/* In ssa-dce.c */ -extern void ssa_eliminate_dead_code (void); - -/* In ssa-ccp.c */ -extern void ssa_const_prop (void); - - -/* SSA definitions and uses. */ -/* This flag is set when the CFG is in SSA form. */ -extern int in_ssa_form; - -/* Element I is the single instruction that sets register I. */ -extern GTY(()) varray_type ssa_definition; - -/* Element I is an INSN_LIST of instructions that use register I. */ -extern varray_type ssa_uses; - - -/* Specify which hard registers should be converted. */ - -/* All pseudo-registers (having register number >= - FIRST_PSEUDO_REGISTER) and hard registers satisfying - CONVERT_HARD_REGISTER_TO_SSA_P are converted to SSA form. */ - -/* Given a hard register number REG_NO, return nonzero if and only if - the register should be converted to SSA. */ - -#ifndef CONVERT_HARD_REGISTER_TO_SSA_P -#define CONVERT_HARD_REGISTER_TO_SSA_P(REG_NO) (0) /* default of no hard registers */ -#endif /* CONVERT_HARD_REGISTER_TO_SSA_P */ - -/* Given a register number REG_NO, return nonzero if and only if the - register should be converted to SSA. */ - -#define CONVERT_REGISTER_TO_SSA_P(REG_NO) \ - ((!HARD_REGISTER_NUM_P (REG_NO)) || \ - (CONVERT_HARD_REGISTER_TO_SSA_P (REG_NO))) diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template18.C b/gcc/testsuite/g++.old-deja/g++.jason/template18.C deleted file mode 100644 index bf293ed2b86..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.jason/template18.C +++ /dev/null @@ -1,18 +0,0 @@ -// { dg-do link } -// { dg-options "-g -fno-inline -Wno-deprecated -fexternal-templates" } -// GROUPS passed templates -// Bug: g++ emits template instances when it shouldn't. -// Suppressed-instantiation tests like this are known to break on -// Cygwin, because of the MULTIPLE_SYMBOL_SPACES stuff. This is OK. - - -#pragma implementation "irrelevant_file" -#line 1 "template18.h" -#pragma interface -template <class T> inline T min (T a, T b) { return a<b?a:b; } -#line 13 "template18.C" - -main() -{ - min (1, 1); // { dg-error "" "" { target *-*-* } 0 } should produce an undefined symbol error. -} diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template37.C b/gcc/testsuite/g++.old-deja/g++.jason/template37.C deleted file mode 100644 index 23309a46b68..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.jason/template37.C +++ /dev/null @@ -1,40 +0,0 @@ -// { dg-do run } -// { dg-options "-Wno-deprecated -fexternal-templates" } -// { dg-warning "switch.*deprecated" "" { target *-*-* } 0 } - -// PRMS Id: 9930 -// Test of -fexternal-templates hackery in new template code - - #pragma implementation "foo.hh" - #pragma interface "foo.hh" - - template<class T> - class ONE - { - public: - static void func(); - }; - - template<class T> - void ONE<T>::func() - { - } - - template <> - class ONE<int> - { - public: - static void func(); - }; - - void ONE<int>::func() - { - } - -int main() - { - ONE<char>::func(); - ONE<int>::func(); - - return 0; - } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C deleted file mode 100644 index c27aa8d2df7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C +++ /dev/null @@ -1,19 +0,0 @@ -//Build don't link: -#include <vector> -#include <algorithm> - -template <class T> class Expr -{ -public : -Expr(){}; -Expr(const T&){}; -}; - -template <class T > -inline bool compare(const Expr<T> a, const Expr<T> b){ return true; }; - -int main() -{ - std::vector<int> a(3); - std::sort( a.begin(), a.end(), compare ); // ERROR - no matching function -} diff --git a/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.x b/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.x deleted file mode 100644 index 38c693d2f00..00000000000 --- a/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.x +++ /dev/null @@ -1,3 +0,0 @@ -# Doesn't compile due to use of literal ISO8859.1 characters. PR 11439. -set torture_compile_xfail "*-*-*" -return 0 diff --git a/gcc/testsuite/gcc.dg/20020201-2.c b/gcc/testsuite/gcc.dg/20020201-2.c deleted file mode 100644 index 2a13c8d83ca..00000000000 --- a/gcc/testsuite/gcc.dg/20020201-2.c +++ /dev/null @@ -1,30 +0,0 @@ -/* This testcase caused ICE because gcc was not able to add instructions - on edge from ENTRY block successor to itself. */ -/* { dg-do compile } */ -/* { dg-options "-O3 -fssa" } */ - -struct A { int a1; int a2; }; -struct B { long int b[32]; }; - -extern int bar (struct B *, struct A *); - -int -foo (struct B x) -{ - struct A a, b; - struct B c; - int d; - - while (1) - { - a.a1 = 0; - a.a2 = 0; - b = a; - c = x; - d = bar (&c, &b); - if (d >= 0) - return d; - } - - return 0; -} diff --git a/gcc/testsuite/gcc.dg/20020201-4.c b/gcc/testsuite/gcc.dg/20020201-4.c deleted file mode 100644 index 3c83fe76047..00000000000 --- a/gcc/testsuite/gcc.dg/20020201-4.c +++ /dev/null @@ -1,16 +0,0 @@ -/* This testcase failed because recog_for_combine used to pass a different - pattern than contained in insn to recog. */ -/* { dg-do compile } */ -/* { dg-options "-O2 -fssa -fssa-ccp" } */ -/* { dg-options "-O2 -march=i686 -fssa -fssa-ccp" { target i?86-*-* } } */ - -extern int bar (char *); - -int -foo (void) -{ - char b[512]; - - bar (b); - return __builtin_strlen (b); -} diff --git a/gcc/testsuite/gcc.dg/20020304-1.c b/gcc/testsuite/gcc.dg/20020304-1.c deleted file mode 100644 index f6d6b4e49a7..00000000000 --- a/gcc/testsuite/gcc.dg/20020304-1.c +++ /dev/null @@ -1,37 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O -fssa -fssa-ccp" } */ - -double a[10][35], b[10][8]; -int c, c, d, e, f, g, h; - -int foo () -{ - int i, j, k, l; - - if (c > 10) - c = 10; - - for (j = 0; j < c; j++) - { - k = 0; - for (l = 0; l < h; l++) - { - if (d != 5) - return -1; - k = l * g; - a[j][k] = (double) e; k++; - a[j][k] = (double) f; k++; - } - for (i = 0;i < 35; i++) - { - if (a[j][i] >= 0.9) - a[j][i] = 0.9; - if (a[j][i] <= 0.1) - a[j][i] = 0.1; - } - k = 0; - b[j][k] = (double) e; k++; - b[j][k] = (double) f; k++; - } - return 0; -} diff --git a/gcc/tree.h b/gcc/tree.h index e6217413e90..4e8a9f721fc 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -210,6 +210,8 @@ struct tree_common GTY(()) TREE_PROTECTED in BLOCK ..._DECL + CALL_FROM_THUNK_P in + CALL_EXPR side_effects_flag: @@ -262,6 +264,7 @@ struct tree_common GTY(()) TREE_DEPRECATED in ..._DECL + */ /* Define accessors for the fields that all tree nodes have @@ -621,6 +624,10 @@ extern void tree_operand_check_failed (int, enum tree_code, argument list. */ #define CALL_EXPR_HAS_RETURN_SLOT_ADDR(NODE) ((NODE)->common.private_flag) +/* In a CALL_EXPR, means that the call is the jump from a thunk to the + thunked-to function. */ +#define CALL_FROM_THUNK_P(NODE) ((NODE)->common.protected_flag) + /* In a type, nonzero means that all objects of the type are guaranteed by the language or front-end to be properly aligned, so we can indicate that a MEM of this type is aligned at least to the alignment of the type, even if it diff --git a/gcc/treelang/.cvsignore b/gcc/treelang/.cvsignore deleted file mode 100644 index 6e2fad745bf..00000000000 --- a/gcc/treelang/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -lex.c -parse.c -parse.h -parse.output -*.info* diff --git a/include/ChangeLog b/include/ChangeLog index 049942f4ee3..c9a0739859d 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,17 @@ +2003-12-23 Zack Weinberg <zack@codesourcery.com> + Nathan Sidwell <nathan@codesourcery.com> + Mark Mitchell <mark@codesourcery.com> + + * libiberty.h (pmkpipe): New function. + (pexec): Likewise. + (pexec_set_program_name): Likewise. + (WIFSIGNALED): Define. + (WTERMSIG): Likewise. + (WIFEXITED): Likewise. + (WEXITSTATUS): Likewise. + (WSTOPSIG): Likewise. + (WCOREDUMP): Likewise. + 2003-10-22 Joseph S. Myers <jsm@polyomino.org.uk> * obstack.h: Merge the following change from gnulib: diff --git a/include/libiberty.h b/include/libiberty.h index 761b2cf060f..d6a38be4b6c 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -74,7 +74,7 @@ extern char **dupargv PARAMS ((char **)) ATTRIBUTE_MALLOC; to find the declaration so provide a fully prototyped one. If it is 1, we found it so don't provide any declaration at all. */ #if !HAVE_DECL_BASENAME -#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (HAVE_DECL_BASENAME) +#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__sun__) || defined (HAVE_DECL_BASENAME) extern char *basename PARAMS ((const char *)); #else extern char *basename (); @@ -274,10 +274,65 @@ extern void hex_init PARAMS ((void)); extern int pexecute PARAMS ((const char *, char * const *, const char *, const char *, char **, char **, int)); -/* Wait for pexecute to finish. */ +/* Slightly lower level routines which are more flexible than pexecute: */ +extern int pmkpipe PARAMS ((int[2])); + +extern int pexec PARAMS ((const char *, char * const *, int, int, int, int)); + +/* Wait for a process created by pexecute or pexec to finish. */ extern int pwait PARAMS ((int, int *, int)); +/* Set the program name used for error messages by pexec. */ +extern void pexec_set_program_name PARAMS ((const char *)); + +#if !defined(_WIN32) || defined(__CYGWIN__) + +#ifndef WIFSIGNALED +#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f) +#endif +#ifndef WTERMSIG +#define WTERMSIG(S) ((S) & 0x7f) +#endif +#ifndef WIFEXITED +#define WIFEXITED(S) (((S) & 0xff) == 0) +#endif +#ifndef WEXITSTATUS +#define WEXITSTATUS(S) (((S) & 0xff00) >> 8) +#endif +#ifndef WSTOPSIG +#define WSTOPSIG WEXITSTATUS +#endif +#ifndef WCOREDUMP +#define WCOREDUMP(S) ((S) & WCOREFLG) +#endif +#ifndef WCOREFLG +#define WCOREFLG 0200 +#endif + +#else /* defined(_WIN32) && ! defined(__CYGWIN__) */ + +#ifndef WIFSIGNALED +#define WIFSIGNALED(S) ((void)(S), 0) +#endif +#ifndef WTERMSIG +#define WTERMSIG(S) ((void)(S), 0) +#endif +#ifndef WIFEXITED +#define WIFEXITED(S) ((void)(S), 1) +#endif +#ifndef WEXITSTATUS +#define WEXITSTATUS(S) (S) +#endif +#ifndef WSTOPSIG +#define WSTOPSIG WEXITSTATUS +#endif +#ifndef WCOREDUMP +#define WCOREDUMP(S) ((void)(S), 0) +#endif + +#endif + #if !HAVE_DECL_ASPRINTF /* Like sprintf but provides a pointer to malloc'd storage, which must be freed by the caller. */ diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 6264fbf5a0b..264d1cb01f6 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,11 @@ +2003-12-23 Zack Weinberg <zack@codesourcery.com> + Nathan Sidwell <nathan@codesourcery.com> + Mark Mitchell <mark@codesourcery.com> + + * pex-common.c (STDERR_FILE_NO): Define. + * pex-win32.c: Rework extensively. + * pex-unix.c: Likewise. + 2003-10-20 J. Brobecker <brobecker@gnat.com> * cplus-dem.c (demangle_template): Register a new Btype only diff --git a/libiberty/pex-common.h b/libiberty/pex-common.h index da2f71e1247..ad971ea7029 100644 --- a/libiberty/pex-common.h +++ b/libiberty/pex-common.h @@ -33,6 +33,9 @@ Boston, MA 02111-1307, USA. */ /* stdout file number. */ #define STDOUT_FILE_NO 1 +/* stderr file number. */ +#define STDERR_FILE_NO 2 + /* value of `pipe': port index for reading. */ #define READ_PORT 0 diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c index 14fe71ed09c..d29e4688591 100644 --- a/libiberty/pex-unix.c +++ b/libiberty/pex-unix.c @@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */ #include <stdio.h> #include <errno.h> +#include <fcntl.h> #ifdef NEED_DECLARATION_ERRNO extern int errno; #endif @@ -44,53 +45,64 @@ extern int errno; #define waitpid(pid, status, flags) wait(status) #endif -extern int execv (); -extern int execvp (); +/* These are needed to prevent the build from bombing out on + platforms (such as embedded targets) where no pex-*.c + will work at all (but we try to build this one anyway). */ +extern int execvp(); +extern int execv(); + +#define xdup2(a, b) do { \ + if (a != -1) \ + if (dup2 (a, b) < 0) \ + { \ + fprintf (stderr, "%s: dup2(%d, %d): %s\n", \ + this_program, a, b, xstrerror(errno)); \ + exit(127); \ + } \ +} while (0); + +#define xclose(fd) do { \ + if (fd != -1) \ + { \ + close (fd); \ + fd = -1; \ + } \ +} while (0) + +static const char *this_program = "<unknown>"; + +/* Execute PROGRAM with argument vector ARGV. If SEARCH is false, + PROGRAM is expected to be a usable pathname already; otherwise it + is looked for in the locations specified by the PATH environment + variable (as per execvp). + + STDIN_FD, STDOUT_FD, and STDERR_FD are file descriptors which + should be established as the child process's stdin, stdout, or + stderr, respectively, or -1 if the child should inherit the + parent's value of that descriptor. If any of these is not -1, it + should be a valid file descriptor marked close-on-exec. */ int -pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) +pexec (program, argv, search, stdin_fd, stdout_fd, stderr_fd) const char *program; - char * const *argv; - const char *this_pname; - const char *temp_base ATTRIBUTE_UNUSED; - char **errmsg_fmt, **errmsg_arg; - int flags; + char *const *argv; + int search; + int stdin_fd; + int stdout_fd; + int stderr_fd; { - int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv); int pid; - int pdes[2]; - int input_desc, output_desc; int retries, sleep_interval; - /* Pipe waiting from last process, to be used as input for the next one. - Value is STDIN_FILE_NO if no pipe is waiting - (i.e. the next command is the first of a group). */ - static int last_pipe_input; - /* If this is the first process, initialize. */ - if (flags & PEXECUTE_FIRST) - last_pipe_input = STDIN_FILE_NO; + /* Canonicalize file descriptor arguments. */ + stdin_fd = (stdin_fd == STDIN_FILE_NO) ? -1 : stdin_fd; + stdout_fd = (stdout_fd == STDOUT_FILE_NO) ? -1 : stdout_fd; + stderr_fd = (stderr_fd == STDERR_FILE_NO) ? -1 : stderr_fd; - input_desc = last_pipe_input; - - /* If this isn't the last process, make a pipe for its output, - and record it as waiting to be the input to the next process. */ - if (! (flags & PEXECUTE_LAST)) - { - if (pipe (pdes) < 0) - { - *errmsg_fmt = "pipe"; - *errmsg_arg = NULL; - return -1; - } - output_desc = pdes[WRITE_PORT]; - last_pipe_input = pdes[READ_PORT]; - } - else - { - /* Last process. */ - output_desc = STDOUT_FILE_NO; - last_pipe_input = STDIN_FILE_NO; - } + /* If exec fails, the child will write a message to stderr, using + fprintf. It must therefore use exit(), not _exit(). So we have + to flush pending output here to avoid duplicate output. */ + fflush (NULL); /* Fork a subprocess; wait and retry if it fails. */ sleep_interval = 1; @@ -98,59 +110,134 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) for (retries = 0; retries < 4; retries++) { pid = fork (); - if (pid >= 0) + if (__builtin_expect (pid >= 0, 1)) break; sleep (sleep_interval); sleep_interval *= 2; } - switch (pid) + if (pid != 0) { - case -1: - *errmsg_fmt = "fork"; - *errmsg_arg = NULL; + /* Parent; fork either succeeded or failed. In either case we + close the file descriptors passed to the child, to make life + easier for callers. Don't clobber errno while doing so. */ + int serrno = errno; + xclose (stdin_fd); + xclose (stdout_fd); + xclose (stderr_fd); + errno = serrno; + + return pid; + } + + /* We are the child. Set up I/O redirections and call exec. + FIXME: Report errors without calling fprintf() in the child + (so we can use vfork). */ + xdup2 (stdin_fd, STDIN_FILE_NO); + xdup2 (stdout_fd, STDOUT_FILE_NO); + xdup2 (stderr_fd, STDERR_FILE_NO); + + (search ? execvp : execv) (program, argv); + + /* If we got here exec failed. */ +/*fprintf (stderr, install_error_msg, XXX completely wrong format string */ + fprintf (stderr, "%s tried to exec %s but failed (%s)\n", + this_program, program, xstrerror (errno)); + exit (127); +} + +/* Create a pipe suitable for use with pexec - in particular, both + ends of the pipe are set close-on-exec. Returns 0 if successful, + -1 otherwise. Returns the pipe in the array argument, just as + pipe(2) does. */ + +int +pmkpipe (thepipe) + int thepipe[2]; +{ + if (pipe (thepipe)) + return -1; + + if (fcntl (thepipe[0], F_SETFD, FD_CLOEXEC) + || fcntl (thepipe[1], F_SETFD, FD_CLOEXEC)) + { + int serrno = errno; + close (thepipe[0]); + close (thepipe[1]); + errno = serrno; return -1; + } + return 0; +} - case 0: /* child */ - /* Move the input and output pipes into place, if necessary. */ - if (input_desc != STDIN_FILE_NO) - { - close (STDIN_FILE_NO); - dup (input_desc); - close (input_desc); - } - if (output_desc != STDOUT_FILE_NO) +int +pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) + const char *program; + char * const *argv; + const char *this_pname ATTRIBUTE_UNUSED; + const char *temp_base ATTRIBUTE_UNUSED; + char **errmsg_fmt, **errmsg_arg; + int flags; +{ + /* Pipe waiting from last process, to be used as input for the next + one. Value is -1 if no pipe is waiting (i.e. the next command is + the first of a group). */ + static int last_pipe_input = -1; + + int pid; + int pdesc[2]; + int serrno; + int child_stdin = -2, child_stdout = -2; +#if 0 +FILE* P = fopen("/dev/pts/1", "w"); +printf(P, "pex-unix.c:pexecute called with program %s\n", program); +#endif + /* If this is the first process, last_pipe_input ought to be -1. */ + if (flags & PEXECUTE_FIRST) + if (last_pipe_input != -1) + abort (); + + child_stdin = last_pipe_input; + + /* If this is the last process, don't do anything with its output + pipe. */ + if (flags & PEXECUTE_LAST) + child_stdout = -1; + else + { + /* Create a pipe to go between this process and the next one in + the pipeline. */ + if (pmkpipe (pdesc)) { - close (STDOUT_FILE_NO); - dup (output_desc); - close (output_desc); + *errmsg_fmt = "pipe"; + *errmsg_arg = NULL; + return -1; } + last_pipe_input = pdesc[READ_PORT]; + child_stdout = pdesc[WRITE_PORT]; + } - /* Close the parent's descs that aren't wanted here. */ - if (last_pipe_input != STDIN_FILE_NO) - close (last_pipe_input); - - /* Exec the program. */ - (*func) (program, argv); - - fprintf (stderr, "%s: ", this_pname); - fprintf (stderr, install_error_msg, program); - fprintf (stderr, ": %s\n", xstrerror (errno)); - exit (-1); - /* NOTREACHED */ - return 0; - - default: - /* In the parent, after forking. - Close the descriptors that we made for this child. */ - if (input_desc != STDIN_FILE_NO) - close (input_desc); - if (output_desc != STDOUT_FILE_NO) - close (output_desc); - - /* Return child's process number. */ - return pid; + pid = pexec (program, argv, (flags & PEXECUTE_SEARCH), + child_stdin, child_stdout, -1); + + serrno = errno; + xclose (child_stdin); + xclose (child_stdout); + + /* To prevent a file descriptor leak, close last_pipe_input if pexec + failed. */ + if (pid == -1) + xclose (last_pipe_input); + + errno = serrno; + + if (pid == -1) + { + *errmsg_fmt = "fork"; + *errmsg_arg = NULL; } + + return pid; } int @@ -164,3 +251,10 @@ pwait (pid, status, flags) pid = waitpid (pid, status, 0); return pid; } + +void +pexec_set_program_name (name) + const char *name; +{ + this_program = name; +} diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c index 27a5bb4e309..402e07b23a2 100644 --- a/libiberty/pex-win32.c +++ b/libiberty/pex-win32.c @@ -21,117 +21,302 @@ Boston, MA 02111-1307, USA. */ #include "pex-common.h" -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_SYS_WAIT_H -#include <sys/wait.h> -#endif - -#include <process.h> +#define WIN32_LEAN_AND_MEAN +#include <windows.h> #include <io.h> #include <fcntl.h> -#include <signal.h> - -/* mingw32 headers may not define the following. */ +#include <string.h> +#include <stdlib.h> + +static const char *this_program; + +#define xclose(fd) do { \ + if (fd != -1) \ + { \ + _close (fd); \ + fd = -1; \ + } \ +} while (0) + +/* Returns a string containing a text error message, after a Windows + "system call" failed. Caller is responsible for deallocating it + (with LocalFree()). */ +static char * +get_last_error_as_text () +{ + DWORD last_error = GetLastError(); + LPSTR result; -#ifndef _P_WAIT -# define _P_WAIT 0 -# define _P_NOWAIT 1 -# define _P_OVERLAY 2 -# define _P_NOWAITO 3 -# define _P_DETACH 4 + /* We assume the error message belongs to 'the system' as opposed + to some module (which we would have to load, and we don't know + which one it is). */ + DWORD flags = (FORMAT_MESSAGE_ALLOCATE_BUFFER + | FORMAT_MESSAGE_IGNORE_INSERTS + | FORMAT_MESSAGE_FROM_SYSTEM); -# define WAIT_CHILD 0 -# define WAIT_GRANDCHILD 1 -#endif + /* Default language. */ + DWORD langid = MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT); -/* This is a kludge to get around the Microsoft C spawn functions' propensity - to remove the outermost set of double quotes from all arguments. */ + /* Yes, you are supposed to cast LPSTR* to LPSTR in the fifth + argument. This interface is intrinsically type-unsafe. */ + FormatMessageA(flags, 0, last_error, langid, (LPSTR) &result, 0, 0); -static const char * const * -fix_argv (argvec) - char **argvec; + return result; +} + +static char * +argv_to_cmdline(argv) + char *const *argv; { - int i; - char * command0 = argvec[0]; + char *cmdline; + char *p; + size_t cmdline_len; + int i, j; - /* Ensure that the executable pathname uses Win32 backslashes. */ - for (; *command0 != '\0'; command0++) - if (*command0 == '/') - *command0 = '\\'; - - for (i = 1; argvec[i] != 0; i++) + cmdline_len = 0; + for (i = 0; argv[i]; i++) + { + /* We quote every last argument. This simplifies the problem; + we need only escape embedded double-quote and backslash + characters. */ + for (j = 0; argv[i][j]; j++) + if (argv[i][j] == '\\' || argv[i][j] == '"') + cmdline_len++; + cmdline_len += j; + cmdline_len += 3; /* for leading and trailing quotes and space */ + } + + cmdline = xmalloc (cmdline_len); + p = cmdline; + for (i = 0; argv[i]; i++) + { + *p++ = '"'; + for (j = 0; argv[i][j]; j++) + { + if (argv[i][j] == '\\' || argv[i][j] == '"') + *p++ = '\\'; + *p++ = argv[i][j]; + } + *p++ = '"'; + *p++ = ' '; + } + p[-1] = '\0'; + return cmdline; +} + +static const char *const +std_suffixes[] = { + ".com", + ".exe", + ".bat", + ".cmd", + 0 +}; +static const char *const +no_suffixes[] = { + "", + 0 +}; + +static char * +find_executable (program, search) + const char *program; + int search; +{ + char *full_executable; + char *e; + size_t fe_len; + const char *path = 0; + const char *const *ext; + const char *p, *q; + size_t proglen = strlen (program); + int has_extension = !!strchr (program, '.'); + int has_slash = (strchr (program, '/') || strchr (program, '\\')); + HANDLE h; + + if (has_slash) + search = 0; + + if (search) + path = getenv ("PATH"); + if (!path) + path = ""; + + fe_len = 0; + for (p = path; *p; p = q) { - int len, j; - char *temp, *newtemp; - - temp = argvec[i]; - len = strlen (temp); - for (j = 0; j < len; j++) - { - if (temp[j] == '"') - { - newtemp = xmalloc (len + 2); - strncpy (newtemp, temp, j); - newtemp [j] = '\\'; - strncpy (&newtemp [j+1], &temp [j], len-j); - newtemp [len+1] = 0; - temp = newtemp; - len++; - j++; - } - } - - argvec[i] = temp; - } - - for (i = 0; argvec[i] != 0; i++) + q = p; + while (*q != ';' && *q != '\0') + q++; + if ((size_t)(q - p) > fe_len) + fe_len = q - p; + if (*q == ';') + q++; + } + fe_len = fe_len + 1 + proglen + (has_extension ? 1 : 5); + full_executable = xmalloc (fe_len); + + p = path; + do { - if (strpbrk (argvec[i], " \t")) - { - int len, trailing_backslash; - char *temp; - - len = strlen (argvec[i]); - trailing_backslash = 0; - - /* There is an added complication when an arg with embedded white - space ends in a backslash (such as in the case of -iprefix arg - passed to cpp). The resulting quoted strings gets misinterpreted - by the command interpreter -- it thinks that the ending quote - is escaped by the trailing backslash and things get confused. - We handle this case by escaping the trailing backslash, provided - it was not escaped in the first place. */ - if (len > 1 - && argvec[i][len-1] == '\\' - && argvec[i][len-2] != '\\') - { - trailing_backslash = 1; - ++len; /* to escape the final backslash. */ - } - - len += 2; /* and for the enclosing quotes. */ - - temp = xmalloc (len + 1); - temp[0] = '"'; - strcpy (temp + 1, argvec[i]); - if (trailing_backslash) - temp[len-2] = '\\'; - temp[len-1] = '"'; - temp[len] = '\0'; - - argvec[i] = temp; + q = p; + while (*q != ';' && *q != '\0') + q++; + + e = full_executable; + memcpy (e, p, q - p); + e += (q - p); + if (q - p) + *e++ = '\\'; + strcpy (e, program); + + if (*q == ';') + q++; + + for (e = full_executable; *e; e++) + if (*e == '/') + *e = '\\'; + + /* At this point, e points to the terminating NUL character for + full_executable. */ + for (ext = has_extension ? no_suffixes : std_suffixes; *ext; ext++) + { + /* Remove any current extension. */ + *e = '\0'; + /* Add the new one. */ + strcat (full_executable, *ext); + + /* Attempt to open this file. */ + h = CreateFile (full_executable, GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, + 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); + if (h != INVALID_HANDLE_VALUE) + goto found; } + p = q; } + while (*p); + free (full_executable); + return 0; + + found: + CloseHandle (h); + return full_executable; +} + +int +pexec (program, argv, search, stdin_fd, stdout_fd, stderr_fd) + const char *program; + char *const *argv; + int search; + int stdin_fd; + int stdout_fd; + int stderr_fd; +{ + char *cmdline = argv_to_cmdline (argv); + char *executable = find_executable (program, search); + STARTUPINFO si; + PROCESS_INFORMATION pinf; + HANDLE me; + + /* Canonicalize file descriptor arguments. */ + stdin_fd = (stdin_fd == STDIN_FILE_NO) ? -1 : stdin_fd; + stdout_fd = (stdout_fd == STDOUT_FILE_NO) ? -1 : stdout_fd; + stderr_fd = (stderr_fd == STDERR_FILE_NO) ? -1 : stderr_fd; + + memset (&si, 0, sizeof si); + si.cb = sizeof si; + si.dwFlags = STARTF_USESTDHANDLES; + + me = GetCurrentProcess(); + + if (!DuplicateHandle (me, + (stdin_fd == -1) + ? GetStdHandle (STD_INPUT_HANDLE) + : (HANDLE)_get_osfhandle (stdin_fd), + me, &si.hStdInput, + 0, TRUE, DUPLICATE_SAME_ACCESS)) + goto cleanup; + if (!DuplicateHandle (me, + (stdout_fd == -1) + ? GetStdHandle (STD_OUTPUT_HANDLE) + : (HANDLE)_get_osfhandle (stdout_fd), + me, &si.hStdOutput, + 0, TRUE, DUPLICATE_SAME_ACCESS)) + goto cleanup; + if (!DuplicateHandle (me, + (stderr_fd == -1) + ? GetStdHandle (STD_ERROR_HANDLE) + : (HANDLE)_get_osfhandle (stderr_fd), + me, &si.hStdError, + 0, TRUE, DUPLICATE_SAME_ACCESS)) + goto cleanup; + + + if (!CreateProcess (executable, cmdline, + 0, 0, TRUE, 0, 0, 0, + &si, &pinf)) + goto cleanup; + + CloseHandle (pinf.hProcess); + CloseHandle (pinf.hThread); + + done: + /* Close file descriptors passed to the child (whether or not we + managed to create a child). */ + xclose (stdin_fd); + xclose (stdout_fd); + xclose (stderr_fd); + + free (executable); + free (cmdline); + + return pinf.dwProcessId; + + cleanup: + { + /* Error strings on win32 include newlines. */ + char *errstr = get_last_error_as_text (); + fprintf (stderr, "%s tried to spawn %s but failed: %s", + this_program, program, errstr); + LocalFree (errstr); + } + CloseHandle (si.hStdInput); + CloseHandle (si.hStdOutput); + CloseHandle (si.hStdError); + pinf.dwProcessId = -1; + goto done; +} + +/* MSVCRT's _pipe() creates pipes that can be inherited, which is not + what we want, so we go directly to CreatePipe(). */ +int +pmkpipe (thepipe) + int thepipe[2]; +{ + HANDLE read_port; + HANDLE write_port; - return (const char * const *) argvec; + if (!CreatePipe (&read_port, &write_port, 0, 0)) + return -1; + + thepipe[0] = _open_osfhandle ((long)read_port, _O_RDONLY); + thepipe[1] = _open_osfhandle ((long)write_port, _O_WRONLY); + if (thepipe[0] == -1 || thepipe[1] == -1) + { + if (thepipe[0] == -1) + CloseHandle (read_port); + else + _close (thepipe[0]); + if (thepipe[1] == -1) + CloseHandle (write_port); + else + _close (thepipe[1]); + return -1; + } + return 0; } -/* Win32 supports pipes */ int pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) const char *program; @@ -141,110 +326,88 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) char **errmsg_fmt, **errmsg_arg; int flags; { - int pid; - int pdes[2]; - int org_stdin = -1; - int org_stdout = -1; - int input_desc, output_desc; + /* Pipe waiting from last process, to be used as input for the next + one. Value is -1 if no pipe is waiting (i.e. the next command is + the first of a group). */ + static int last_pipe_input = -1; - /* Pipe waiting from last process, to be used as input for the next one. - Value is STDIN_FILE_NO if no pipe is waiting - (i.e. the next command is the first of a group). */ - static int last_pipe_input; + int pid; + int pdesc[2]; + int serrno; + int child_stdin = -2, child_stdout = -2; - /* If this is the first process, initialize. */ + /* If this is the first process, last_pipe_input ought to be -1. */ if (flags & PEXECUTE_FIRST) - last_pipe_input = STDIN_FILE_NO; + if (last_pipe_input != -1) + abort (); - input_desc = last_pipe_input; + child_stdin = last_pipe_input; - /* If this isn't the last process, make a pipe for its output, - and record it as waiting to be the input to the next process. */ - if (! (flags & PEXECUTE_LAST)) + /* If this is the last process, don't do anything with its output + pipe. */ + if (flags & PEXECUTE_LAST) + child_stdout = -1; + else { - if (_pipe (pdes, 256, O_BINARY) < 0) + /* Create a pipe to go between this process and the next one in + the pipeline. */ + if (pmkpipe (pdesc)) { *errmsg_fmt = "pipe"; *errmsg_arg = NULL; return -1; } - output_desc = pdes[WRITE_PORT]; - last_pipe_input = pdes[READ_PORT]; - } - else - { - /* Last process. */ - output_desc = STDOUT_FILE_NO; - last_pipe_input = STDIN_FILE_NO; - } - - if (input_desc != STDIN_FILE_NO) - { - org_stdin = dup (STDIN_FILE_NO); - dup2 (input_desc, STDIN_FILE_NO); - close (input_desc); + last_pipe_input = pdesc[READ_PORT]; + child_stdout = pdesc[WRITE_PORT]; } - if (output_desc != STDOUT_FILE_NO) - { - org_stdout = dup (STDOUT_FILE_NO); - dup2 (output_desc, STDOUT_FILE_NO); - close (output_desc); - } + pid = pexec (program, argv, (flags & PEXECUTE_SEARCH), + child_stdin, child_stdout, -1); - pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv) - (_P_NOWAIT, program, fix_argv(argv)); + serrno = errno; + xclose (child_stdin); + xclose (child_stdout); - if (input_desc != STDIN_FILE_NO) - { - dup2 (org_stdin, STDIN_FILE_NO); - close (org_stdin); - } + /* To prevent a file descriptor leak, close last_pipe_input if pexec + failed. */ + if (pid == -1) + xclose (last_pipe_input); - if (output_desc != STDOUT_FILE_NO) - { - dup2 (org_stdout, STDOUT_FILE_NO); - close (org_stdout); - } + errno = serrno; if (pid == -1) { - *errmsg_fmt = install_error_msg; - *errmsg_arg = (char*) program; - return -1; + *errmsg_fmt = "spawn"; + *errmsg_arg = NULL; } return pid; } -/* MS CRTDLL doesn't return enough information in status to decide if the - child exited due to a signal or not, rather it simply returns an - integer with the exit code of the child; eg., if the child exited with - an abort() call and didn't have a handler for SIGABRT, it simply returns - with status = 3. We fix the status code to conform to the usual WIF* - macros. Note that WIFSIGNALED will never be true under CRTDLL. */ - int pwait (pid, status, flags) int pid; int *status; int flags ATTRIBUTE_UNUSED; { - int termstat; - - pid = _cwait (&termstat, pid, WAIT_CHILD); - - /* ??? Here's an opportunity to canonicalize the values in STATUS. - Needed? */ - - /* cwait returns the child process exit code in termstat. - A value of 3 indicates that the child caught a signal, but not - which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we - report SIGABRT. */ - if (termstat == 3) - *status = SIGABRT; - else - *status = (((termstat) & 0xff) << 8); + HANDLE proch = OpenProcess (SYNCHRONIZE | PROCESS_QUERY_INFORMATION, + FALSE, pid); + if (proch == 0) + return -1; + if (WaitForSingleObject (proch, INFINITE) != WAIT_OBJECT_0) + { + CloseHandle (proch); + return -1; + } + GetExitCodeProcess (proch, (DWORD *)status); + CloseHandle (proch); return pid; } + +void +pexec_set_program_name (name) + const char *name; +{ + this_program = name; +} diff --git a/libjava/gnu/awt/gtk/GtkButtonPeer.java b/libjava/gnu/awt/gtk/GtkButtonPeer.java deleted file mode 100644 index 62ad4199da9..00000000000 --- a/libjava/gnu/awt/gtk/GtkButtonPeer.java +++ /dev/null @@ -1,61 +0,0 @@ -/* GtkButtonPeer.java -- Implements ButtonPeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -This library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published -by the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Library General Public License for more details. - -You should have received a copy of the GNU Library General Public License -along with this library; if not, write to the Free Software Foundation -Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */ - - -package gnu.awt.gtk; - -import java.awt.*; -import java.awt.event.MouseEvent; -import java.awt.event.KeyEvent; -import java.awt.peer.*; - -public class GtkButtonPeer extends GtkComponentPeer - implements ButtonPeer -{ - protected native void create (); - public native void setLabel (String label); - - public GtkButtonPeer (Button b) - { - super (b); - } - - public void handleEvent (AWTEvent e) - { -// if (e.getID () == MouseEvent.MOUSE_CLICKED && isEnabled () -// && !modalHasGrab ()) -// { -// MouseEvent me = (MouseEvent) e; -// if (!me.isConsumed () -// && (me.getModifiers () & MouseEvent.BUTTON1_MASK) != 0) -// postActionEvent (((Button)awtComponent).getActionCommand (), -// me.getModifiers ()); -// } - -// if (e.getID () == KeyEvent.KEY_PRESSED) -// { -// KeyEvent ke = (KeyEvent) e; -// if (!ke.isConsumed () && ke.getKeyCode () == KeyEvent.VK_SPACE) -// postActionEvent (((Button)awtComponent).getActionCommand (), -// ke.getModifiers ()); -// } - - super.handleEvent (e); - } -} diff --git a/libjava/gnu/awt/gtk/GtkComponentPeer.java b/libjava/gnu/awt/gtk/GtkComponentPeer.java deleted file mode 100644 index 82d2714c81e..00000000000 --- a/libjava/gnu/awt/gtk/GtkComponentPeer.java +++ /dev/null @@ -1,269 +0,0 @@ -/* GtkComponentPeer.java -- Implements ComponentPeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -This library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published -by the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Library General Public License for more details. - -You should have received a copy of the GNU Library General Public License -along with this library; if not, write to the Free Software Foundation -Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */ - - -package gnu.awt.gtk; - -import java.awt.*; -import java.awt.event.*; -import java.awt.image.*; -import java.awt.peer.ComponentPeer; - -public abstract class GtkComponentPeer implements ComponentPeer -{ - // We need to put a reference to the Event Queue somewhere. This seems like - // a convenient place. - static EventQueue eventQueue = new EventQueue(); - - Component awtComponent; - gnu.gcj.RawData ptr; // Actual gtk object. - - static - { - // This will start the main toolkit thread. - GtkToolkit.instance.init(); - } - - public int checkImage (Image image, int width, int height, - ImageObserver observer) - { - return -1; - /* - GtkImage i = (GtkImage) image; - return i.checkImage (); - */ - } - - public Image createImage (ImageProducer producer) - { - return null; - //return new GtkImage (producer, null); - } - - public Image createImage (int width, int height) - { - return null; - /* - GdkGraphics g = new GdkGraphics (width, height); - return new GtkOffScreenImage (null, g, width, height); - */ - } - - public void disable () - { - setEnabled (false); - } - - native public void dispose (); - - public void enable () - { - setEnabled (true); - } - - /** - * Get the graphics configuration of the component. The color model - * of the component can be derived from the configuration. - */ - public GraphicsConfiguration getGraphicsConfiguration () - { - return null; - } - - public FontMetrics getFontMetrics (Font font) - { - return null; - //return new GdkFontMetrics (font); - } - - public Graphics getGraphics () - { - throw new InternalError (); - } - - public native Point getLocationOnScreen (); - public native Dimension getMinimumSize(); - public native Dimension getPreferredSize(); - - public Toolkit getToolkit () - { - return GtkToolkit.instance; - } - - public void handleEvent(AWTEvent e) - { - } - - public void hide () - { - setVisible (false); - } - - public void show () - { - setVisible (true); - } - - public boolean isFocusTraversable () - { - return true; - } - - public Dimension minimumSize () - { - return getMinimumSize(); - } - - public Dimension preferredSize() - { - return getPreferredSize(); - } - - public void paint (Graphics g) - { - awtComponent.paint (g); // ??? - } - - public boolean prepareImage (Image image, int width, int height, - ImageObserver observer) - { - /* - GtkImage i = (GtkImage) image; - - if (i.isLoaded ()) return true; - - class PrepareImage extends Thread - { - GtkImage image; - ImageObserver observer; - - PrepareImage (GtkImage image, ImageObserver observer) - { - this.image = image; - this.observer = observer; - } - - public void run () - { - // XXX: need to return data to image observer - image.source.startProduction (null); - } - } - - new PrepareImage (i, observer).start (); - */ - return false; - } - - public void print (Graphics g) - { - throw new RuntimeException (); - } - - native public void requestFocus (); - - public void repaint (long tm, int x, int y, int width, int height) - { - // ??? - eventQueue.postEvent (new PaintEvent ( - awtComponent, PaintEvent.UPDATE, new Rectangle (x, y, width, height))); - } - - - public void reshape (int x, int y, int width, int height) - { - setBounds (x, y, width, height); - } - - public native void setBounds (int x, int y, int width, int height); - public native void setCursor (Cursor cursor); - - public native void setEnabled (boolean b); - - public native void setEventMask(long eventMask); - public native void setFont(Font font); - public native void setForeground(Color color); - public native void setBackground (Color c); - public native void setVisible(boolean visible); - - native void realize(); - - protected GtkComponentPeer (Component awtComponent) - { - this.awtComponent = awtComponent; - create(); - - // TODO: Each of these calls will currently perform a separate native lock. - // It may be desirable to use our own, recusive mutex implementation by - // passing our threads implementation to g_threads_init(). - // This would greatly reduce locking calls in the peer code, and allow us - // to aquire the lock from java code. - Rectangle r = awtComponent.getBounds(); - setBounds (r.x, r.y, r.width, r.height); - - Color c = awtComponent.getForeground(); - if (c != null) - setForeground (c); - c = awtComponent.getBackground(); - if (c != null) - setBackground (c); - setEnabled (awtComponent.isEnabled()); - Font f = awtComponent.getFont(); - if (f != null) - setFont (awtComponent.getFont()); - - realize(); - } - - protected native void create (); - - // FIXME: It may make sense to do the following directly from the native - // code. - protected void postMouseEvent(int id, long when, int mods, int x, int y, - int clickCount, boolean popupTrigger) - { - eventQueue.postEvent(new MouseEvent(awtComponent, id, when, mods, x, y, - clickCount, popupTrigger)); - } - - protected void postExposeEvent (int x, int y, int width, int height) - { - eventQueue.postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT, - new Rectangle (x, y, width, height))); - } - - protected void postKeyEvent (int id, long when, int mods, - int keyCode, char keyChar) - { - eventQueue.postEvent (new KeyEvent (awtComponent, id, when, mods, - keyCode, keyChar)); - } - - protected void postFocusEvent (int id, boolean temporary) - { - eventQueue.postEvent (new FocusEvent (awtComponent, id, temporary)); - } - - protected void postItemEvent (Object item, int stateChange) - { - eventQueue.postEvent (new ItemEvent ((ItemSelectable)awtComponent, - ItemEvent.ITEM_STATE_CHANGED, - item, stateChange)); - } -} diff --git a/libjava/gnu/awt/gtk/GtkContainerPeer.java b/libjava/gnu/awt/gtk/GtkContainerPeer.java deleted file mode 100644 index 18f4f6b75ea..00000000000 --- a/libjava/gnu/awt/gtk/GtkContainerPeer.java +++ /dev/null @@ -1,55 +0,0 @@ -/* GtkContainerPeer.java -- Implements ContainerPeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -This library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published -by the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Library General Public License for more details. - -You should have received a copy of the GNU Library General Public License -along with this library; if not, write to the Free Software Foundation -Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */ - - -package gnu.awt.gtk; - -import java.awt.*; -import java.awt.event.*; -import java.awt.peer.ContainerPeer; - -public abstract class GtkContainerPeer extends GtkComponentPeer - implements ContainerPeer -{ - // FIXME? - static Insets insets = new Insets(0,0,0,0); - - protected GtkContainerPeer (Container awtContainer) - { - super (awtContainer); - } - - public Insets getInsets() - { - // FIXME? - return insets; - } - - public void beginValidate() - { - // FIXME - } - - public void endValidate() - { - // FIXME - } - - protected native void create(); -} diff --git a/libjava/gnu/awt/gtk/GtkFramePeer.java b/libjava/gnu/awt/gtk/GtkFramePeer.java deleted file mode 100644 index e73a55bea7f..00000000000 --- a/libjava/gnu/awt/gtk/GtkFramePeer.java +++ /dev/null @@ -1,42 +0,0 @@ -/* GtkFramePeer.java -- Implements FramePeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -This library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published -by the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Library General Public License for more details. - -You should have received a copy of the GNU Library General Public License -along with this library; if not, write to the Free Software Foundation -Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */ - - -package gnu.awt.gtk; - -import java.awt.*; -import java.awt.event.*; -import java.awt.peer.FramePeer; - -public class GtkFramePeer extends GtkWindowPeer - implements FramePeer -{ - protected GtkFramePeer (Frame awtFrame) - { - super (awtFrame); - //init (); - } - - public native void setIconImage(Image image); - public native void setMenuBar(MenuBar mb); - public native void setResizable(boolean resizable); - public native void setTitle(String title); - - protected native void create(); -} diff --git a/libjava/gnu/awt/gtk/GtkLabelPeer.java b/libjava/gnu/awt/gtk/GtkLabelPeer.java deleted file mode 100644 index 46743c61923..00000000000 --- a/libjava/gnu/awt/gtk/GtkLabelPeer.java +++ /dev/null @@ -1,37 +0,0 @@ -/* GtkLabelPeer.java -- Implements LabelPeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -This library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published -by the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Library General Public License for more details. - -You should have received a copy of the GNU Library General Public License -along with this library; if not, write to the Free Software Foundation -Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */ - - -package gnu.awt.gtk; - -import java.awt.*; -import java.awt.peer.*; - -public class GtkLabelPeer extends GtkComponentPeer - implements LabelPeer -{ - public GtkLabelPeer (Label l) - { - super (l); - } - - public native void setText (String text); - public native void setAlignment (int alignment); - protected native void create (); -} diff --git a/libjava/gnu/awt/gtk/GtkMainThread.java b/libjava/gnu/awt/gtk/GtkMainThread.java deleted file mode 100644 index efe22153ed1..00000000000 --- a/libjava/gnu/awt/gtk/GtkMainThread.java +++ /dev/null @@ -1,36 +0,0 @@ -/* GtkMainThread.java -- Runs gtk_main() - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -This library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published -by the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Library General Public License for more details. - -You should have received a copy of the GNU Library General Public License -along with this library; if not, write to the Free Software Foundation -Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */ - - -package gnu.awt.gtk; - -public class GtkMainThread extends Thread -{ - native void gtkMain(); - - public GtkMainThread() - { - super ("GtkMain"); - } - - public void run() - { - gtkMain(); - } -} diff --git a/libjava/gnu/awt/gtk/GtkToolkit.java b/libjava/gnu/awt/gtk/GtkToolkit.java deleted file mode 100644 index 4173e5e9b40..00000000000 --- a/libjava/gnu/awt/gtk/GtkToolkit.java +++ /dev/null @@ -1,314 +0,0 @@ -/* GtkToolkit.java -- Implements an AWT Toolkit using GTK for peers - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -This library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published -by the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Library General Public License for more details. - -You should have received a copy of the GNU Library General Public License -along with this library; if not, write to the Free Software Foundation -Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */ - - -package gnu.awt.gtk; - -import java.awt.*; -import java.net.*; -import java.util.Hashtable; -import java.util.Properties; -import java.util.MissingResourceException; -import java.awt.datatransfer.*; -import java.awt.image.*; -import java.awt.peer.*; - -public class GtkToolkit extends java.awt.Toolkit -{ - static GtkMainThread gtkthread; - static EventQueue evtqueue; - static Hashtable containers = new Hashtable(); - static Clipboard systemClipboard; - static GtkToolkit instance = null; - - public GtkToolkit () - { - gtkInit(); - instance = this; - //systemClipboard = new GtkClipboard (); - } - - // Start the thread to run the GTK event loop. This is called from - // a GtkComponentPeer static initializer. - void init () - { - gtkthread = new GtkMainThread (); - gtkthread.start(); - } - - static native void gtkInit(); - - native public void beep (); - - public int checkImage (Image image, int width, int height, - ImageObserver observer) - { - return ImageObserver.ALLBITS; - -// GtkImage i = (GtkImage) image; -// return i.checkImage (); - } - - public Image createImage(String filename) - { - return null; - } - - public Image createImage(URL url) - { - return null; - } - - public Image createImage (ImageProducer producer) - { -// return new GtkImage (producer, null); - return null; - } - - public Image createImage (byte[] imagedata, int imageoffset, - int imagelength) - { - System.out.println ("createImage byte[] NOT SUPPORTED"); - return null; - } - - public ColorModel getColorModel () - { - return ColorModel.getRGBdefault (); - } - - public String[] getFontList () - { - return (new String[] { "Dialog", - "DialogInput", - "Monospaced", - "Serif", - "SansSerif" }); - } - - public FontMetrics getFontMetrics (Font font) - { -// return new GdkFontMetrics (font); - return null; - } - - public Image getImage (String filename) - { -// return new GtkImage (new GdkPixbufDecoder (filename), null); - return null; - } - - public Image getImage (URL url) - { -// return new GtkImage (new GdkPixbufDecoder (url), null); - return null; - } - - /* - public PrintJob getPrintJob (Frame frame, String jobtitle, Properties props) - { - return null; - } - */ - native public int getScreenResolution(); - - native public Dimension getScreenSize (); - - public Clipboard getSystemClipboard() - { - return systemClipboard; - } - - public boolean prepareImage (Image image, int width, int height, - ImageObserver observer) - { - return false; - } - - native public void sync (); - - protected void setComponentState (Component c, GtkComponentPeer cp) - { - /* Make the Peer reflect the state of the Component */ - if (! (c instanceof Window)) - { - cp.setCursor (c.getCursor ()); - - Rectangle bounds = c.getBounds (); - cp.setBounds (bounds.x, bounds.y, bounds.width, bounds.height); - if (c instanceof Canvas) - System.out.println ("width " + bounds.width + " height " + bounds.height); - - cp.setVisible (c.isVisible ()); - } - } - - protected ButtonPeer createButton (Button b) - { - return null; - /* - GtkButtonPeer bp = new GtkButtonPeer (b); - Rectangle bounds = b.getBounds (); - bp.setBounds (bounds.x, bounds.y, bounds.width, bounds.height); - return bp; - */ - } - - protected CanvasPeer createCanvas (Canvas c) - { -// return new GtkCanvasPeer (c); - return null; - } - - protected CheckboxPeer createCheckbox (Checkbox cb) - { - return null; - /* - if (cb.getCheckboxGroup () != null) - return new GtkRadioButtonPeer (cb); - else - return new GtkCheckButtonPeer (cb); - */ - } - - protected CheckboxMenuItemPeer createCheckboxMenuItem (CheckboxMenuItem cmi) - { - return null; - //return new GtkCheckboxMenuItemPeer (cmi); - } - - protected ChoicePeer createChoice (Choice c) - { - return null; - //return new GtkChoicePeer (c); - } - - protected DialogPeer createDialog (Dialog d) - { - return null; - //return new GtkDialogPeer (d); - } - - protected FileDialogPeer createFileDialog (FileDialog fd) - { - return null; - //return new GtkFileDialogPeer (fd); - } - - protected FramePeer createFrame (Frame f) - { - return new GtkFramePeer (f); - } - - protected LabelPeer createLabel (Label label) - { - return null; - //return new GtkLabelPeer (label); - } - - protected ListPeer createList (List list) - { - return null; - //return new GtkListPeer (list); - } - - protected MenuPeer createMenu (Menu m) - { - return null; - //return new GtkMenuPeer (m); - } - - protected MenuBarPeer createMenuBar (MenuBar mb) - { - return null; - //return new GtkMenuBarPeer (mb); - } - - protected MenuItemPeer createMenuItem (MenuItem mi) - { - return null; - //return new GtkMenuItemPeer (mi); - } - - protected PanelPeer createPanel (Panel p) - { - return null; - //return new GtkPanelPeer (p); - } - - protected PopupMenuPeer createPopupMenu (PopupMenu target) - { - return null; - //return new GtkPopupMenuPeer (target); - } - - protected ScrollPanePeer createScrollPane (ScrollPane sp) - { - return null; - //return new GtkScrollPanePeer (sp); - } - - protected ScrollbarPeer createScrollbar (Scrollbar sb) - { - return null; - //return new GtkScrollbarPeer (sb); - } - - protected TextAreaPeer createTextArea (TextArea ta) - { - return null; - //return new GtkTextAreaPeer (ta); - } - - protected TextFieldPeer createTextField (TextField tf) - { - return null; - //return new GtkTextFieldPeer (tf); - } - - protected WindowPeer createWindow (Window w) - { - return new GtkWindowPeer (w); - } - - protected FontPeer getFontPeer (String name, int style) - { - return null; - /* - try - { - GtkFontPeer fp = new GtkFontPeer (name, style); - return fp; - } - catch (MissingResourceException ex) - { - return null; - } - */ - } - - protected EventQueue getSystemEventQueueImpl() - { - return GtkComponentPeer.eventQueue; - } - - protected void loadSystemColors (int[] systemColors) - { - } -} diff --git a/libjava/gnu/awt/gtk/GtkWindowPeer.java b/libjava/gnu/awt/gtk/GtkWindowPeer.java deleted file mode 100644 index a2428362d1d..00000000000 --- a/libjava/gnu/awt/gtk/GtkWindowPeer.java +++ /dev/null @@ -1,39 +0,0 @@ -/* GtkWindowPeer.java -- Implements WindowPeer with GTK - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of the peer AWT libraries of GNU Classpath. - -This library is free software; you can redistribute it and/or modify -it under the terms of the GNU Library General Public License as published -by the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Library General Public License for more details. - -You should have received a copy of the GNU Library General Public License -along with this library; if not, write to the Free Software Foundation -Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */ - - -package gnu.awt.gtk; - -import java.awt.*; -import java.awt.event.*; -import java.awt.peer.WindowPeer; - -public class GtkWindowPeer extends GtkContainerPeer - implements WindowPeer -{ - protected GtkWindowPeer (Window awtWindow) - { - super (awtWindow); - } - - public native void toBack(); - public native void toFront(); - - protected native void create(); -} diff --git a/libjava/gnu/awt/gtk/gtkcommon.cc b/libjava/gnu/awt/gtk/gtkcommon.cc deleted file mode 100644 index 6a12130da89..00000000000 --- a/libjava/gnu/awt/gtk/gtkcommon.cc +++ /dev/null @@ -1,14 +0,0 @@ -// -*- c++ -*- -// gtkutils.cc - Common functions for the gtk AWT peers. - -/* Copyright (C) 2000 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include <gtk/gtk.h> - -#include "gtkcommon.h" diff --git a/libjava/gnu/awt/gtk/gtkcommon.h b/libjava/gnu/awt/gtk/gtkcommon.h deleted file mode 100644 index 207d2cf1f0e..00000000000 --- a/libjava/gnu/awt/gtk/gtkcommon.h +++ /dev/null @@ -1,85 +0,0 @@ -// -*- c++ -*- -// gtkutils.h - Common defines and inline functions for the gtk AWT peers. - -/* Copyright (C) 2000 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#ifndef __GTKCOMMON_H__ -#define __GTKCOMMON_H__ - -#include <gtk/gtk.h> -#include <gdk/gdkx.h> - -#include <java/awt/Color.h> - -class _Jv_GdkThreadLock -{ -public: - _Jv_GdkThreadLock () - { - GDK_THREADS_ENTER (); - } - - ~_Jv_GdkThreadLock () - { - GDK_THREADS_LEAVE (); - } -}; - -// Convert AWT Color to gdk color value. -static inline void -_Jv_ConvertAwtColor(java::awt::Color* awtcolor, GdkColor* gdkcolor) -{ - jint rgb = awtcolor->getRGB(); - gushort r = (rgb >> 16) & 0xFF; - gushort g = (rgb >> 8) & 0xFF; - gushort b = rgb & 0xFF; - - gdkcolor->red = (r << 8) + r; - gdkcolor->green = (g << 8) + g; - gdkcolor->blue = (b << 8) + b; - - // FIXME: Deal with colormap? gdk_color_alloc()? -} - -// Convert gdk color value to AWT Color. -static inline java::awt::Color* -_Jv_ConvertGtkColor (GdkColor* gdkcolor) -{ - jint r = gdkcolor->red >> 8; - jint g = gdkcolor->green >> 8; - jint b = gdkcolor->blue >> 8; - - java::awt::Color *c = new java::awt::Color(r,g,b); - - return c; -} - -static inline void -_Jv_GdkScaleColor (GdkColor* oldc, GdkColor* newc, gfloat scale) -{ - // FIXME: Need to deal with overflows or find a better way - *newc = *oldc; - newc->red += (gushort) (newc->red * scale); - newc->green += (gushort) (newc->green * scale); - newc->blue += (gushort) (newc->blue * scale); -} - -// Normally the X queue gets flushed automatically when gtk's event loop goes -// idle. However, some calls do not cause any activitity on the event loop, -// so we need to occasionally flush pending requests manually because we arn't -// running from the gtk_main thread. Note that gdk_flush calls XSync(), which -// is more than what is needed here. -static inline void -_Jv_FlushRequests () -{ - // FIXME: What about platforms that arn't X? - XFlush (GDK_DISPLAY ()); -} - -#endif /* __GTKUTILS_H__ */ diff --git a/libjava/gnu/awt/gtk/natGtkButtonPeer.cc b/libjava/gnu/awt/gtk/natGtkButtonPeer.cc deleted file mode 100644 index 1608616f25e..00000000000 --- a/libjava/gnu/awt/gtk/natGtkButtonPeer.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Native Gtk AWT button code - -#include <config.h> - -#include <gcj/cni.h> - -#include "gtkcommon.h" -#include <gnu/awt/gtk/GtkButtonPeer.h> -#include <java/awt/Button.h> - -void -gnu::awt::gtk::GtkButtonPeer::setLabel (java::lang::String *label) -{ - _Jv_GdkThreadLock sync; - jsize len = 0; - if (label) - len = JvGetStringUTFLength (label); - char buf[len + 1]; - // FIXME: this can allocate an unbounded amount. Should use heap - // even though it is slower. - if (label) - JvGetStringUTFRegion (label, 0, len, buf); - buf[len] = '\0'; - // The button child is a label. - GtkBin *bin = GTK_BIN (ptr); - gtk_label_set_text (GTK_LABEL (bin->child), buf); -} - -void -gnu::awt::gtk::GtkButtonPeer::create () -{ - if (! ptr) - { - _Jv_GdkThreadLock sync; - // This is a little inefficient. - ptr = (gnu::gcj::RawData *) gtk_button_new_with_label (""); - - using namespace ::java::awt; - Button *button = reinterpret_cast<Button *> (awtComponent); - setLabel (button->getLabel ()); - } - - gnu::awt::gtk::GtkComponentPeer::create (); -} - -// void -// gnu::awt::gtk::GtkButtonPeer::clicked (::gnu::gcj::RawData *button_wrap, -// ::gnu::gcj::RawData *peer_wrap) -// { -// GtkButtonPeer *button = reinterpret_cast<GtkButtonPeer *> (peer_wrap); - -// } diff --git a/libjava/gnu/awt/gtk/natGtkComponentPeer.cc b/libjava/gnu/awt/gtk/natGtkComponentPeer.cc deleted file mode 100644 index d7b6c66e6f6..00000000000 --- a/libjava/gnu/awt/gtk/natGtkComponentPeer.cc +++ /dev/null @@ -1,265 +0,0 @@ -// This file was created by `gcjh -stubs'. -*- c++ -*- -// -// This file is intended to give you a head start on implementing native -// methods using CNI. -// Be aware: running `gcjh -stubs ' once more for this class may -// overwrite any edits you have made to this file. - -#include <config.h> - -#include <gcj/cni.h> - -#include <java/awt/Point.h> -#include <java/awt/Dimension.h> -#include <java/awt/Cursor.h> - -#include "gtkcommon.h" - -#include <gnu/awt/gtk/GtkComponentPeer.h> - - -void -gnu::awt::gtk::GtkComponentPeer::dispose () -{ - GDK_THREADS_ENTER (); - gtk_widget_destroy (GTK_WIDGET (ptr)); - GDK_THREADS_LEAVE (); -} - - -::java::awt::Point * -gnu::awt::gtk::GtkComponentPeer::getLocationOnScreen () -{ - gint x, y; - _Jv_GdkThreadLock sync; - gdk_window_get_root_origin (GTK_WIDGET (ptr)->window, &x, &y); - return new ::java::awt::Point (x, y); -} - - -::java::awt::Dimension * -gnu::awt::gtk::GtkComponentPeer::getMinimumSize () -{ - GtkRequisition req; - ::java::awt::Dimension *dim = new ::java::awt::Dimension (); - - GDK_THREADS_ENTER (); - - gtk_widget_size_request (GTK_WIDGET (ptr), &req); - - GDK_THREADS_LEAVE (); - - dim->width = (jint) req.width; - dim->height = (jint) req.height; - return dim; -} - - -::java::awt::Dimension * -gnu::awt::gtk::GtkComponentPeer::getPreferredSize () -{ - return getMinimumSize (); -} - - -void -gnu::awt::gtk::GtkComponentPeer::requestFocus () -{ - GDK_THREADS_ENTER (); - - gtk_widget_grab_focus (GTK_WIDGET (ptr)); - - GDK_THREADS_LEAVE (); -} - - -void -gnu::awt::gtk::GtkComponentPeer::setBounds (jint x, jint y, - jint width, jint height) -{ - GDK_THREADS_ENTER (); - - GtkWidget *widget = GTK_WIDGET (ptr); - gtk_widget_set_usize (widget, width, height); - //gtk_layout_move (GTK_LAYOUT (widget->parent), widget, x, y); - - GDK_THREADS_LEAVE (); -} - - -void -gnu::awt::gtk::GtkComponentPeer::setCursor (::java::awt::Cursor *cursor) -{ - GdkCursorType type; - - switch (cursor->type) - { - case ::java::awt::Cursor::CROSSHAIR_CURSOR: - type = GDK_CROSSHAIR; - break; - case ::java::awt::Cursor::TEXT_CURSOR: - type = GDK_XTERM; - break; - case ::java::awt::Cursor::WAIT_CURSOR: - type = GDK_WATCH; - break; - case ::java::awt::Cursor::SW_RESIZE_CURSOR: - type = GDK_BOTTOM_LEFT_CORNER; - break; - case ::java::awt::Cursor::SE_RESIZE_CURSOR: - type = GDK_BOTTOM_RIGHT_CORNER; - break; - case ::java::awt::Cursor::NW_RESIZE_CURSOR: - type = GDK_TOP_LEFT_CORNER; - break; - case ::java::awt::Cursor::NE_RESIZE_CURSOR: - type = GDK_TOP_RIGHT_CORNER; - break; - case ::java::awt::Cursor::N_RESIZE_CURSOR: - type = GDK_TOP_SIDE; - break; - case ::java::awt::Cursor::S_RESIZE_CURSOR: - type = GDK_RIGHT_SIDE; - break; - case ::java::awt::Cursor::W_RESIZE_CURSOR: - type = GDK_LEFT_SIDE; - break; - case ::java::awt::Cursor::E_RESIZE_CURSOR: - type = GDK_BOTTOM_SIDE; - break; - case ::java::awt::Cursor::HAND_CURSOR: - type = GDK_HAND1; - break; - case ::java::awt::Cursor::MOVE_CURSOR: - type = GDK_FLEUR; - break; - case ::java::awt::Cursor::CUSTOM_CURSOR: - // FIXME: not implemented yet. We want a gtk-specific subclass - // of Cursor which holds a new gdk cursor. For now, fall - // through. - - case ::java::awt::Cursor::DEFAULT_CURSOR: - default: - type = GDK_LEFT_PTR; - break; - } - - _Jv_GdkThreadLock sync; - GtkWidget *widget = GTK_WIDGET (ptr); - GdkCursor *cursor = gdk_cursor_new (type); - gdk_window_set_cursor (widget->window, cursor); - gdk_cursor_destroy (cursor); -} - - -void -gnu::awt::gtk::GtkComponentPeer::setEnabled (jboolean enabled) -{ - GDK_THREADS_ENTER (); - - gtk_widget_set_sensitive (GTK_WIDGET (ptr), enabled); - - GDK_THREADS_LEAVE (); -} - - -void -gnu::awt::gtk::GtkComponentPeer::setEventMask (jlong) -{ - // TODO -} - - -void -gnu::awt::gtk::GtkComponentPeer::setFont (::java::awt::Font *) -{ - // TODO -} - - -void -gnu::awt::gtk::GtkComponentPeer::setForeground (::java::awt::Color *color) -{ - // FIXME: This doesn't work if component is already realized/visible - - GdkColor gcolor; - _Jv_ConvertAwtColor(color, &gcolor); - - GDK_THREADS_ENTER (); - - GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (ptr)); - - style->bg[GTK_STATE_NORMAL] = gcolor; - style->bg[GTK_STATE_ACTIVE] = gcolor; - style->bg[GTK_STATE_PRELIGHT] = gcolor; - style->bg[GTK_STATE_SELECTED] = gcolor; - style->bg[GTK_STATE_INSENSITIVE] = gcolor; - - gtk_widget_set_style (GTK_WIDGET (ptr), style); - - GDK_THREADS_LEAVE (); -} - - -void -gnu::awt::gtk::GtkComponentPeer::setBackground (::java::awt::Color *color) -{ - // FIXME: This doesn't work if component is already realized/visible - - GdkColor gcolor; - _Jv_ConvertAwtColor(color, &gcolor); - - GDK_THREADS_ENTER (); - - GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (ptr)); - - style->bg[GTK_STATE_NORMAL] = gcolor; - style->bg[GTK_STATE_ACTIVE] = gcolor; - style->bg[GTK_STATE_PRELIGHT] = gcolor; - style->bg[GTK_STATE_SELECTED] = gcolor; - style->bg[GTK_STATE_INSENSITIVE] = gcolor; - // gtk allows us to set color values for different states of the - // widget. AWT only provides a single background color, so scale it - // to get some reasonable values. -// _Jv_GdkScaleColor (&gcolor, &style->bg[GTK_STATE_ACTIVE], -0.1); -// _Jv_GdkScaleColor (&gcolor, &style->bg[GTK_STATE_PRELIGHT], 0.2); -// _Jv_GdkScaleColor (&gcolor, &style->bg[GTK_STATE_SELECTED], -0.2); -// _Jv_GdkScaleColor (&gcolor, &style->bg[GTK_STATE_INSENSITIVE], -0.2); - - gtk_widget_set_style (GTK_WIDGET (ptr), style); - - GDK_THREADS_LEAVE (); -} - - -void -gnu::awt::gtk::GtkComponentPeer::setVisible (jboolean visible) -{ - GDK_THREADS_ENTER (); - - GtkWidget *widget = GTK_WIDGET (ptr); - - if (visible) - gtk_widget_show (widget); - else - gtk_widget_hide (widget); - - _Jv_FlushRequests (); - - GDK_THREADS_LEAVE (); -} - - -void -gnu::awt::gtk::GtkComponentPeer::create () -{ -} - - -void -gnu::awt::gtk::GtkComponentPeer::realize () -{ - GDK_THREADS_ENTER (); - gtk_widget_realize (GTK_WIDGET (ptr)); - GDK_THREADS_LEAVE (); -} diff --git a/libjava/gnu/awt/gtk/natGtkContainerPeer.cc b/libjava/gnu/awt/gtk/natGtkContainerPeer.cc deleted file mode 100644 index 0d5656d4f72..00000000000 --- a/libjava/gnu/awt/gtk/natGtkContainerPeer.cc +++ /dev/null @@ -1,15 +0,0 @@ -// This file was created by `gcjh -stubs'. -*- c++ -*- -// -// This file is intended to give you a head start on implementing native -// methods using CNI. -// Be aware: running `gcjh -stubs ' once more for this class may -// overwrite any edits you have made to this file. - -#include <gnu/awt/gtk/GtkContainerPeer.h> -#include <gcj/cni.h> - -void -gnu::awt::gtk::GtkContainerPeer::create () -{ - gnu::awt::gtk::GtkComponentPeer::create(); -} diff --git a/libjava/gnu/awt/gtk/natGtkFramePeer.cc b/libjava/gnu/awt/gtk/natGtkFramePeer.cc deleted file mode 100644 index b9b4d95a34e..00000000000 --- a/libjava/gnu/awt/gtk/natGtkFramePeer.cc +++ /dev/null @@ -1,51 +0,0 @@ -// This file was created by `gcjh -stubs'. -*- c++ -*- -// -// This file is intended to give you a head start on implementing native -// methods using CNI. -// Be aware: running `gcjh -stubs ' once more for this class may -// overwrite any edits you have made to this file. - -#include <gnu/awt/gtk/GtkFramePeer.h> -#include <gcj/cni.h> - -#include <gtk/gtk.h> - -void -gnu::awt::gtk::GtkFramePeer::setIconImage (::java::awt::Image *) -{ - // TODO -} - - -void -gnu::awt::gtk::GtkFramePeer::setMenuBar (::java::awt::MenuBar *) -{ - // TODO -} - - -void -gnu::awt::gtk::GtkFramePeer::setResizable (jboolean) -{ - // TODO -} - - -void -gnu::awt::gtk::GtkFramePeer::setTitle (::java::lang::String *) -{ - // TODO -} - -void -gnu::awt::gtk::GtkFramePeer::create () -{ - if (ptr == NULL) - { - GDK_THREADS_ENTER (); - ptr = (gnu::gcj::RawData *) gtk_window_new(GTK_WINDOW_TOPLEVEL); - GDK_THREADS_LEAVE (); - } - - gnu::awt::gtk::GtkContainerPeer::create(); -} diff --git a/libjava/gnu/awt/gtk/natGtkLabelPeer.cc b/libjava/gnu/awt/gtk/natGtkLabelPeer.cc deleted file mode 100644 index 95fc7f63d17..00000000000 --- a/libjava/gnu/awt/gtk/natGtkLabelPeer.cc +++ /dev/null @@ -1,59 +0,0 @@ -// Native Gtk AWT label code. - -#include <config.h> - -#include <gcj/cni.h> - -#include "gtkcommon.h" - -#include <gnu/awt/gtk/GtkLabelPeer.h> -#include <java/awt/Label.h> - -void -gnu::awt::gtk::GtkLabelPeer::setText (java::lang::String *text) -{ - _Jv_GdkThreadLock sync; - jsize len = 0; - if (text) - len = JvGetStringUTFLength (text); - // FIXME: this can allocate an unbounded amount. Should use heap - // even though it is slower. - char buf[len + 1]; - if (text) - JvGetStringUTFRegion (text, 0, len, buf); - buf[len] = '\0'; - gtk_label_set_text (GTK_LABEL (ptr), buf); -} - -void -gnu::awt::gtk::GtkLabelPeer::setAlignment (jint alignment) -{ - using namespace java::awt; - - gfloat value = 0.5; - if (alignment == Label::LEFT) - value = 0.0; - else if (alignment == Label::RIGHT) - value = 1.0; - - _Jv_GdkThreadLock sync; - gtk_misc_set_alignment (GTK_MISC (ptr), 0.5f, value); -} - -void -gnu::awt::gtk::GtkLabelPeer::create () -{ - if (! ptr) - { - _Jv_GdkThreadLock sync; - // This is a little inefficient. - ptr = (gnu::gcj::RawData *) gtk_label_new (""); - - using namespace ::java::awt; - Label *label = reinterpret_cast<Label *> (awtComponent); - setText (label->getText ()); - setAlignment (label->getAlignment ()); - } - - gnu::awt::gtk::GtkComponentPeer::create (); -} diff --git a/libjava/gnu/awt/gtk/natGtkMainThread.cc b/libjava/gnu/awt/gtk/natGtkMainThread.cc deleted file mode 100644 index 9cc492c31ed..00000000000 --- a/libjava/gnu/awt/gtk/natGtkMainThread.cc +++ /dev/null @@ -1,22 +0,0 @@ -// This file was created by `gcjh -stubs'. -*- c++ -*- -// -// This file is intended to give you a head start on implementing native -// methods using CNI. -// Be aware: running `gcjh -stubs ' once more for this class may -// overwrite any edits you have made to this file. - -#include <gnu/awt/gtk/GtkMainThread.h> -#include <gcj/cni.h> - -#include <gtk/gtk.h> - - -void -gnu::awt::gtk::GtkMainThread::gtkMain () -{ - GDK_THREADS_ENTER (); - gtk_main (); - GDK_THREADS_LEAVE (); -} - - diff --git a/libjava/gnu/awt/gtk/natGtkToolkit.cc b/libjava/gnu/awt/gtk/natGtkToolkit.cc deleted file mode 100644 index e7949395235..00000000000 --- a/libjava/gnu/awt/gtk/natGtkToolkit.cc +++ /dev/null @@ -1,75 +0,0 @@ -// This file was created by `gcjh -stubs'. -*- c++ -*- -// -// This file is intended to give you a head start on implementing native -// methods using CNI. -// Be aware: running `gcjh -stubs ' once more for this class may -// overwrite any edits you have made to this file. - -#include <java/awt/Dimension.h> - -#include <gnu/awt/gtk/GtkToolkit.h> -#include <gcj/cni.h> - -#include <gtk/gtk.h> - - -// GTK requires the program's argc and argv variables. -extern char **_Jv_argv; -extern int _Jv_argc; - -// Call gtk_init. It is very important that this happen before any other -// gtk calls. -void -gnu::awt::gtk::GtkToolkit::gtkInit () -{ - // Initialize GLib in thread-safe mode. We assume that GLib is using the - // same native threads library as libgcj. Refer to comments in - // GtkComponentPeer constructor. - g_thread_init (NULL); - gtk_init (&_Jv_argc, &_Jv_argv); -} - -void -gnu::awt::gtk::GtkToolkit::beep () -{ - GDK_THREADS_ENTER (); - gdk_beep (); - GDK_THREADS_LEAVE (); -} - -jint -gnu::awt::gtk::GtkToolkit::getScreenResolution () -{ - jint res; - - GDK_THREADS_ENTER (); - - res = (int) (gdk_screen_width () / (gdk_screen_width_mm () / 25.4)); - - GDK_THREADS_LEAVE (); - return res; -} - -::java::awt::Dimension * -gnu::awt::gtk::GtkToolkit::getScreenSize () -{ - ::java::awt::Dimension *dim = new ::java::awt::Dimension (); - - GDK_THREADS_ENTER (); - - dim->width = gdk_screen_width (); - dim->height = gdk_screen_height (); - - GDK_THREADS_LEAVE (); - return dim; -} - -void -gnu::awt::gtk::GtkToolkit::sync () -{ - GDK_THREADS_ENTER (); - gdk_flush (); - GDK_THREADS_LEAVE (); -} - - diff --git a/libjava/gnu/awt/gtk/natGtkWindowPeer.cc b/libjava/gnu/awt/gtk/natGtkWindowPeer.cc deleted file mode 100644 index d3f05c951c0..00000000000 --- a/libjava/gnu/awt/gtk/natGtkWindowPeer.cc +++ /dev/null @@ -1,40 +0,0 @@ -// This file was created by `gcjh -stubs'. -*- c++ -*- -// -// This file is intended to give you a head start on implementing native -// methods using CNI. -// Be aware: running `gcjh -stubs ' once more for this class may -// overwrite any edits you have made to this file. - -#include <gnu/awt/gtk/GtkWindowPeer.h> -#include <gcj/cni.h> - -#include <gtk/gtk.h> - -void -gnu::awt::gtk::GtkWindowPeer::toBack () -{ - GDK_THREADS_ENTER (); - gdk_window_lower (GTK_WIDGET (ptr)->window); - GDK_THREADS_LEAVE (); -} - -void -gnu::awt::gtk::GtkWindowPeer::toFront () -{ - GDK_THREADS_ENTER (); - gdk_window_raise (GTK_WIDGET (ptr)->window); - GDK_THREADS_LEAVE (); -} - -void -gnu::awt::gtk::GtkWindowPeer::create () -{ - if (ptr == NULL) - { - GDK_THREADS_ENTER (); - ptr = (gnu::gcj::RawData *) gtk_window_new(GTK_WINDOW_POPUP); - GDK_THREADS_LEAVE (); - } - - gnu::awt::gtk::GtkContainerPeer::create(); -} diff --git a/libjava/gnu/java/nio/natPipeImpl.cc b/libjava/gnu/java/nio/natPipeImpl.cc deleted file mode 100644 index caae89cdd1a..00000000000 --- a/libjava/gnu/java/nio/natPipeImpl.cc +++ /dev/null @@ -1,38 +0,0 @@ -// natPipeImpl.cc - -/* Copyright (C) 2003 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include <config.h> -#include <platform.h> - -#include <errno.h> -#include <string.h> -#include <unistd.h> - -#include <gnu/java/nio/PipeImpl.h> -//#include <gnu/java/nio/PipeImpl$SinkChannelImpl.h> -//#include <gnu/java/nio/PipeImpl$SourceChannelImpl.h> -#include <java/io/IOException.h> -#include <java/nio/channels/spi/SelectorProvider.h> - -void -gnu::java::nio::PipeImpl::nativeInit (::java::nio::channels::spi::SelectorProvider* /*provider*/) -{ - int filedes [2]; - - if (_Jv_pipe (filedes) < 0) - throw new ::java::io::IOException (JvNewStringUTF (strerror (errno))); - - /* FIXME - source = new gnu::java::nio::PipeImpl$SourceChannelImpl - (this, provider, filedes [0]); - sink = new gnu::java::nio::PipeImpl$SinkChannelImpl - (this, provider, filedes [1]); - */ -} diff --git a/libjava/gnu/java/nio/natSelectorImpl.cc b/libjava/gnu/java/nio/natSelectorImpl.cc deleted file mode 100644 index 764167aaee2..00000000000 --- a/libjava/gnu/java/nio/natSelectorImpl.cc +++ /dev/null @@ -1,91 +0,0 @@ -// natSelectorImpl.cc - -/* Copyright (C) 2002, 2003 Free Software Foundation - - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ - -#include <config.h> -#include <platform.h> - -#include <errno.h> -#include <string.h> - -#include <gnu/java/nio/SelectorImpl.h> -#include <java/io/IOException.h> - -void -helper_put_filedescriptors (jintArray fdArray, fd_set& fds, int& max_fd) -{ - jint* tmpFDArray = elements (fdArray); - - for (int index = 0; index < JvGetArrayLength (fdArray); index++) - { - FD_SET (tmpFDArray [index], &fds); - - if (tmpFDArray [index] > max_fd) - max_fd = tmpFDArray [index]; - } -} - -void -helper_get_filedescriptors (jintArray& fdArray, fd_set fds) -{ - jint* tmpFDArray = elements (fdArray); - - for (int index = 0; index < JvGetArrayLength (fdArray); index++) - if (!FD_ISSET (tmpFDArray [index], &fds)) - tmpFDArray [index] = 0; -} - -jint -gnu::java::nio::SelectorImpl::implSelect (jintArray read, jintArray write, - jintArray except, jlong timeout) -{ - jint result; - int max_fd = 0; - fd_set read_fds; - fd_set write_fds; - fd_set except_fds; - struct timeval real_time_data; - struct timeval *time_data = NULL; - - real_time_data.tv_sec = 0; - real_time_data.tv_usec = timeout; - - // If not legal timeout value is given, use NULL. - // This means an infinite timeout. - if (timeout >= 0) - { - time_data = &real_time_data; - } - - // Reset all fd_set structures - FD_ZERO (&read_fds); - FD_ZERO (&write_fds); - FD_ZERO (&except_fds); - - // Fill the fd_set data structures for the _Jv_select() call. - helper_put_filedescriptors (read, read_fds, max_fd); - helper_put_filedescriptors (write, write_fds, max_fd); - helper_put_filedescriptors (except, except_fds, max_fd); - - // Actually do the select - result = _Jv_select (max_fd + 1, &read_fds, &write_fds, &except_fds, time_data); - - if (result < 0) - { - char* strerr = strerror (errno); - throw new ::java::io::IOException (JvNewStringUTF (strerr)); - } - - // Set the file descriptors according to the values returned from select(). - helper_get_filedescriptors (read, read_fds); - helper_get_filedescriptors (write, write_fds); - helper_get_filedescriptors (except, except_fds); - - return result; -} diff --git a/libjava/libltdl/acconfig.h b/libjava/libltdl/acconfig.h deleted file mode 100644 index efa668c4dc7..00000000000 --- a/libjava/libltdl/acconfig.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Some of these are defined here, not in configure.in, because - they're AC_DEFINEd in two different places, which causes two - defines to appear. Some C compilers might now appreciate it... */ - -/* Define if you have the libdl library or equivalent. */ -#undef HAVE_LIBDL - -/* Define if you have the GNU dld library. */ -#undef HAVE_DLD - -/* Define if you have the shl_load function. */ -#undef HAVE_SHL_LOAD - -/* Define if you are using the Boehm GC. */ -#undef HAVE_BOEHM_GC diff --git a/libjava/libltdl/config.h.in b/libjava/libltdl/config.h.in deleted file mode 100644 index 95e384928b3..00000000000 --- a/libjava/libltdl/config.h.in +++ /dev/null @@ -1,98 +0,0 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ - -/* Define to empty if the keyword does not work. */ -#undef const - -/* Define as __inline if that's what the C compiler calls it. */ -#undef inline - -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define if you are using the Boehm GC. */ -#undef HAVE_BOEHM_GC - -/* Define if you have the dlerror function. */ -#undef HAVE_DLERROR - -/* Define if you have the index function. */ -#undef HAVE_INDEX - -/* Define if you have the rindex function. */ -#undef HAVE_RINDEX - -/* Define if you have the strchr function. */ -#undef HAVE_STRCHR - -/* Define if you have the strcmp function. */ -#undef HAVE_STRCMP - -/* Define if you have the strrchr function. */ -#undef HAVE_STRRCHR - -/* Define if you have the <ctype.h> header file. */ -#undef HAVE_CTYPE_H - -/* Define if you have the <dl.h> header file. */ -#undef HAVE_DL_H - -/* Define if you have the <dld.h> header file. */ -#undef HAVE_DLD_H - -/* Define if you have the <dlfcn.h> header file. */ -#undef HAVE_DLFCN_H - -/* Define if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define if you have the <stdio.h> header file. */ -#undef HAVE_STDIO_H - -/* Define if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to the extension used for shared libraries, say, .so. */ -#undef LTDL_SHLIB_EXT - -/* Define to the name of the environment variable that determines the dynamic library search path. */ -#undef LTDL_SHLIBPATH_VAR - -/* Define to the system default library search path. */ -#undef LTDL_SYSSEARCHPATH - -/* Define to the sub-directory in which libtool stores uninstalled libraries. */ -#undef LTDL_OBJDIR - -/* Define if libtool can extract symbol lists from object files. */ -#undef HAVE_PRELOADED_SYMBOLS - -/* Define if you have the libdl library or equivalent. */ -#undef HAVE_LIBDL - -/* Define if you have the libdl library or equivalent. */ -#undef HAVE_LIBDL - -/* Define if you have the libdl library or equivalent. */ -#undef HAVE_LIBDL - -/* Define if you have the shl_load function. */ -#undef HAVE_SHL_LOAD - -/* Define if you have the shl_load function. */ -#undef HAVE_SHL_LOAD - -/* Define if you have the GNU dld library. */ -#undef HAVE_DLD - -/* Define if dlsym() requires a leading underscode in symbol names. */ -#undef NEED_USCORE - diff --git a/libjava/libltdl/configure.in b/libjava/libltdl/configure.in deleted file mode 100644 index 3c1fa37356f..00000000000 --- a/libjava/libltdl/configure.in +++ /dev/null @@ -1,63 +0,0 @@ -dnl Process this file with autoconf to create configure. - -AC_INIT(ltdl.c) - -AC_ARG_WITH(auxdir, -[ --with-auxdir=DIR path to autoconf auxiliary files], -[AC_CONFIG_AUX_DIR($with_auxdir) -dnl This is here just to satisfy automake. -ifelse(not,equal,[AC_CONFIG_AUX_DIR(../..)])], -[AC_CONFIG_AUX_DIR_DEFAULT]) - -# This is another blatant hack to work around automake bugs. -mkinstalldirs="$ac_aux_dir/mkinstalldirs" -AC_SUBST(mkinstalldirs) - -if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then - if test -f ${srcdir}/ltconfig && test -f ${srcdir}/ltmain.sh; then - # if libltdl is libtoolized, it is assumed to be stand-alone and - # installed unless the command line overrides it (tested above) - enable_ltdl_install=yes - else - AC_MSG_WARN([*** The top-level configure must select either]) - AC_MSG_WARN([*** [A""C_LIBLTDL_INSTALLABLE] or [A""C_LIBLTDL_CONVENIENCE].]) - AC_MSG_ERROR([*** Maybe you want to --enable-ltdl-install?]) - fi -fi - -AM_INIT_AUTOMAKE(libltdl,1.1,-) -AM_CONFIG_HEADER(config.h) -AM_MAINTAINER_MODE - -AC_PROG_CC -AC_C_CONST -AC_C_INLINE - -AC_LIBTOOL_WIN32_DLL -AM_PROG_LIBTOOL -AC_SUBST(LIBTOOL_DEPS) - -AC_MSG_CHECKING([for garbage collector to use]) -AC_ARG_ENABLE(java-gc, -changequote(<<,>>)dnl -<< --enable-java-gc=TYPE choose garbage collector [boehm]>>, -changequote([,]) - GC=$enableval, - GC=boehm) - -GCINCS= -if test "$GC" = "boehm"; then - GCINCS="`cat ../../boehm-gc/boehm-cflags`" - AC_DEFINE(HAVE_BOEHM_GC) -fi -AC_SUBST(GCINCS) - -AC_LIB_LTDL - -dnl Output the makefile -AC_OUTPUT(Makefile) - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff --git a/libjava/libltdl/stamp-h.in b/libjava/libltdl/stamp-h.in deleted file mode 100644 index 9788f70238c..00000000000 --- a/libjava/libltdl/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/libstdc++-v3/testsuite/20_util/allocator_members.cc b/libstdc++-v3/testsuite/20_util/allocator_members.cc deleted file mode 100644 index 4170a9d9a96..00000000000 --- a/libstdc++-v3/testsuite/20_util/allocator_members.cc +++ /dev/null @@ -1,89 +0,0 @@ -// 2001-06-14 Benjamin Kosnik <bkoz@redhat.com> - -// Copyright (C) 2001, 2002 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// 20.4.1.1 allocator members - -#include <memory> -#include <stdexcept> -#include <cstdlib> -#include <testsuite_hooks.h> - -struct gnu { }; - -bool check_new = false; -bool check_delete = false; - -void* -operator new(std::size_t n) throw(std::bad_alloc) -{ - check_new = true; - return std::malloc(n); -} - -void operator delete(void *v) throw() -{ - check_delete = true; - return std::free(v); -} - -void test01() -{ - bool test __attribute__((unused)) = true; - std::allocator<gnu> obj; - - // XXX These should work for various size allocation and - // deallocations. Currently, they only work as expected for sizes > - // _MAX_BYTES as defined in stl_alloc.h, which happes to be 128. - gnu* pobj = obj.allocate(256); - VERIFY( check_new ); - - obj.deallocate(pobj, 256); - VERIFY( check_delete ); -} - -// libstdc++/8230 -void test02() -{ - bool test __attribute__((unused)) = true; - try - { - std::allocator<int> alloc; - const std::allocator<int>::size_type n = alloc.max_size(); - int* p = alloc.allocate(n + 1); - p[n] = 2002; - } - catch(const std::bad_alloc& e) - { - // Allowed. - test = true; - } - catch(...) - { - test = false; - } - VERIFY( test ); -} - -int main() -{ - test01(); - test02(); - return 0; -} diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc deleted file mode 100644 index 8683de6e463..00000000000 --- a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc +++ /dev/null @@ -1,181 +0,0 @@ -// 1999-06-28 bkoz - -// Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// 24.5.3 template class istreambuf_iterator - -#include <sstream> -#include <iterator> -#include <testsuite_hooks.h> - -void test01() -{ - using namespace std; - - // Check for required base class. - typedef istreambuf_iterator<char> test_iterator; - typedef char_traits<char>::off_type off_type; - typedef iterator<input_iterator_tag, char, off_type, char*, char&> base_iterator; - - istringstream isstream("this tag"); - test_iterator r_it(isstream); - base_iterator* base __attribute__((unused)) = &r_it; - - // Check for required typedefs - typedef test_iterator::value_type value_type; - typedef test_iterator::difference_type difference_type; - typedef test_iterator::pointer pointer; - typedef test_iterator::reference reference; - typedef test_iterator::iterator_category iteratory_category; - - typedef test_iterator::char_type char_type; - typedef test_iterator::traits_type traits_type; - typedef test_iterator::istream_type istream_type; - typedef test_iterator::streambuf_type streambuf_type; -} - -bool test02(void) -{ - - typedef std::istreambuf_iterator<char> cistreambuf_iter; - typedef cistreambuf_iter::streambuf_type cstreambuf_type; - bool test __attribute__((unused)) = true; - const char slit01[] = "playa hermosa, liberia, guanacaste"; - std::string str01(slit01); - std::istringstream istrs00(str01); - std::istringstream istrs01(str01); - - // ctor sanity checks - cistreambuf_iter istrb_it01(istrs00); - cistreambuf_iter istrb_it02; - std::string tmp(istrb_it01, istrb_it02); - VERIFY( tmp == str01 ); - - cistreambuf_iter istrb_it03(0); - cistreambuf_iter istrb_it04; - VERIFY( istrb_it03 == istrb_it04 ); - - cistreambuf_iter istrb_it05(istrs01); - cistreambuf_iter istrb_it06(istrs01.rdbuf()); - VERIFY( istrb_it05 == istrb_it06 ); - - // bool equal(istreambuf_iter& b) - cistreambuf_iter istrb_it07(0); - cistreambuf_iter istrb_it08; - VERIFY( istrb_it07.equal(istrb_it08) ); - cistreambuf_iter istrb_it09(0); - cistreambuf_iter istrb_it10; - VERIFY( istrb_it10.equal(istrb_it09) ); - - cistreambuf_iter istrb_it11(istrs01); - cistreambuf_iter istrb_it12(istrs01.rdbuf()); - VERIFY( istrb_it11.equal(istrb_it12) ); - cistreambuf_iter istrb_it13(istrs01); - cistreambuf_iter istrb_it14(istrs01.rdbuf()); - VERIFY( istrb_it14.equal(istrb_it13) ); - - cistreambuf_iter istrb_it15(istrs01); - cistreambuf_iter istrb_it16; - VERIFY( !(istrb_it15.equal(istrb_it16)) ); - cistreambuf_iter istrb_it17(istrs01); - cistreambuf_iter istrb_it18; - VERIFY( !(istrb_it18.equal(istrb_it17)) ); - - // bool operator==(const istreambuf_iterator&a, const istreambuf_iterator& b) - // bool operator!=(const istreambuf_iterator&a, const istreambuf_iterator& b) - cistreambuf_iter istrb_it19(0); - cistreambuf_iter istrb_it20; - VERIFY( istrb_it19 == istrb_it20 ); - - cistreambuf_iter istrb_it21(istrs01); - cistreambuf_iter istrb_it22(istrs01.rdbuf()); - VERIFY( istrb_it22 == istrb_it21 ); - - cistreambuf_iter istrb_it23(istrs01); - cistreambuf_iter istrb_it24; - VERIFY( istrb_it23 != istrb_it24 ); - - cistreambuf_iter istrb_it25(0); - cistreambuf_iter istrb_it26(istrs01.rdbuf()); - VERIFY( istrb_it25 != istrb_it26 ); - - // charT operator*() const - // istreambuf_iterator& operator++(); - // istreambuf_iterator& operator++(int); - cistreambuf_iter istrb_it27(istrs01.rdbuf()); - char c; - for (std::size_t i = 0; i < sizeof(slit01) - 2; ++i) - { - c = *istrb_it27++; - VERIFY( c == slit01[i] ); - } - - std::istringstream istrs02(str01); - cistreambuf_iter istrb_it28(istrs02); - for (std::size_t i = 0; i < sizeof(slit01) - 2;) - { - c = *++istrb_it28; - VERIFY( c == slit01[++i] ); - } - return test; -} - -// libstdc++/2627 -void test03() -{ - bool test __attribute__((unused)) = true; - const std::string s("free the vieques"); - - // 1 - std::string res_postfix; - std::istringstream iss01(s); - std::istreambuf_iterator<char> isbufit01(iss01); - for (std::size_t j = 0; j < s.size(); ++j, isbufit01++) - res_postfix += *isbufit01; - - // 2 - std::string res_prefix; - std::istringstream iss02(s); - std::istreambuf_iterator<char> isbufit02(iss02); - for (std::size_t j = 0; j < s.size(); ++j, ++isbufit02) - res_prefix += *isbufit02; - - // 3 mixed - std::string res_mixed; - std::istringstream iss03(s); - std::istreambuf_iterator<char> isbufit03(iss03); - for (std::size_t j = 0; j < (s.size() / 2); ++j) - { - res_mixed += *isbufit03; - ++isbufit03; - res_mixed += *isbufit03; - isbufit03++; - } - - VERIFY ( res_postfix == res_prefix ); - VERIFY ( res_mixed == res_prefix ); -} - -int main() -{ - test01(); - test02(); - test03(); - return 0; -} diff --git a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc deleted file mode 100644 index 3bc6bbbcf98..00000000000 --- a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc +++ /dev/null @@ -1,118 +0,0 @@ -// 2001-04-30 Benjamin Kosnik <bkoz@redhat.com> - -// Copyright (C) 2001, 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// 24.5.4 template class ostreambuf_iterator - -#include <sstream> -#include <iterator> -#include <testsuite_hooks.h> - -void test01() -{ - using namespace std; - - // Check for required base class. - typedef ostreambuf_iterator<char> test_iterator; - typedef iterator<output_iterator_tag, void, void, void, void> base_iterator; - ostringstream osstream("this tag"); - test_iterator r_it(osstream); - base_iterator* base __attribute__((unused)) = &r_it; - - // Check for required typedefs - typedef test_iterator::value_type value_type; - typedef test_iterator::difference_type difference_type; - typedef test_iterator::pointer pointer; - typedef test_iterator::reference reference; - typedef test_iterator::iterator_category iteratory_category; - - typedef test_iterator::char_type char_type; - typedef test_iterator::traits_type traits_type; - typedef test_iterator::ostream_type ostream_type; - typedef test_iterator::streambuf_type streambuf_type; -} - -bool test02(void) -{ - typedef std::ostreambuf_iterator<char> costreambuf_iter; - typedef costreambuf_iter::streambuf_type cstreambuf_type; - bool test __attribute__((unused)) = true; - const char slit01[] = "playa hermosa, liberia, guanacaste"; - const char slit02[] = "bodega bay, lost coast, california"; - std::string str01(slit01); - std::string str02(slit02); - std::string tmp; - std::stringbuf strbuf01; - std::stringbuf strbuf02(str01); - std::ostringstream ostrs00(str01); - std::ostringstream ostrs01(str01); - - // ctor sanity checks - costreambuf_iter ostrb_it01(ostrs00); - VERIFY( !ostrb_it01.failed() ); - ostrb_it01++; - ++ostrb_it01; - VERIFY( !ostrb_it01.failed() ); - ostrb_it01 = 'a'; - VERIFY( !ostrb_it01.failed() ); - *ostrb_it01; - VERIFY( !ostrb_it01.failed() ); - - costreambuf_iter ostrb_it02(NULL); - VERIFY( ostrb_it02.failed() ); - ostrb_it02++; - ++ostrb_it02; - VERIFY( ostrb_it02.failed() ); - *ostrb_it02; - VERIFY( ostrb_it02.failed() ); - ostrb_it02 = 'a'; - VERIFY( ostrb_it02.failed() ); - - // charT operator*() const - // ostreambuf_iterator& operator++(); - // ostreambuf_iterator& operator++(int); - costreambuf_iter ostrb_it27(ostrs01); - VERIFY( !ostrb_it27.failed() ); - int j = str02.size(); - for (int i = 0; i < j; ++i) - ostrb_it27 = str02[i]; - VERIFY( !ostrb_it27.failed() ); - tmp = ostrs01.str(); - VERIFY ( tmp != str01 ); - VERIFY ( tmp == str02 ); - - costreambuf_iter ostrb_it28(ostrs00); - VERIFY( !ostrb_it28.failed() ); - j = ostrs00.str().size(); - for (int i = 0; i < j + 2; ++i) - ostrb_it28 = 'b'; - VERIFY( !ostrb_it28.failed() ); - tmp = ostrs00.str(); - VERIFY ( tmp != str01 ); - VERIFY ( tmp != str02 ); - return test; -} - -int main() -{ - test01(); - test02(); - - return 0; -} diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf.cc b/libstdc++-v3/testsuite/ext/stdio_filebuf.cc deleted file mode 100644 index 8b313b3f31f..00000000000 --- a/libstdc++-v3/testsuite/ext/stdio_filebuf.cc +++ /dev/null @@ -1,36 +0,0 @@ -// 2003-02-11 Paolo Carlini <pcarlini@unitus.it> - -// Copyright (C) 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// stdio_filebuf.h - -#include <ext/stdio_filebuf.h> -#include <testsuite_hooks.h> - -// { dg-do compile } - -// libstdc++/9320 -namespace test -{ - using namespace std; - using __gnu_test::pod_char; - typedef short type_t; - template class __gnu_cxx::stdio_filebuf<type_t, char_traits<type_t> >; - template class __gnu_cxx::stdio_filebuf<pod_char, char_traits<pod_char> >; -} // test diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf_2.cc b/libstdc++-v3/testsuite/ext/stdio_filebuf_2.cc deleted file mode 100644 index 1ef57eecb21..00000000000 --- a/libstdc++-v3/testsuite/ext/stdio_filebuf_2.cc +++ /dev/null @@ -1,59 +0,0 @@ -// 2003-04-12 Paolo Carlini <pcarlini at unitus dot it> - -// Copyright (C) 2003 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -// stdio_filebuf.h - -#include <ext/stdio_filebuf.h> -#include <cstdio> -#include <fstream> -#include <testsuite_hooks.h> - -// Small stack-based buffers (i.e., using _M_unbuf) were not flushed -// out by _M_really_overflow upon overflow. -void test01() -{ - using namespace std; - bool test __attribute__((unused)) = true; - - const char* name = "tmp_file1"; - FILE* file = fopen(name, "w"); - { - using namespace __gnu_cxx; - stdio_filebuf<char> sbuf(file, ios_base::out, 2); - sbuf.sputc('T'); - sbuf.sputc('S'); - sbuf.sputc('P'); - } - fclose(file); - - filebuf fbuf; - fbuf.open(name, ios_base::in); - char buf[10]; - streamsize n = fbuf.sgetn(buf, sizeof(buf)); - fbuf.close(); - - VERIFY( n == 3 ); - VERIFY( !memcmp(buf, "TSP", 3) ); -} - -int main() -{ - test01(); -} diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc deleted file mode 100644 index 5134cadfbe9..00000000000 --- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc +++ /dev/null @@ -1,140 +0,0 @@ -// 2003-05-01 Petur Runolfsson <peturr02@ru.is> - -// Copyright (C) 2003 Free Software Foundation -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -#include <ext/stdio_sync_filebuf.h> -#include <testsuite_hooks.h> - -void test01() -{ - using namespace std; - - bool test __attribute__((unused)) = true; - const char* c_lit = "black pearl jasmine tea"; - int size = strlen(c_lit); - const char* name = "stdiobuf-1.txt"; - - FILE* fout = fopen(name, "w"); - fwrite(c_lit, 1, size, fout); - fclose(fout); - - FILE* fin = fopen(name, "r"); - __gnu_cxx::stdio_sync_filebuf<char> sbuf(fin); - - VERIFY( sbuf.sgetc() == c_lit[0] ); - VERIFY( getc(fin) == c_lit[0] ); - VERIFY( sbuf.sgetc() == c_lit[1] ); - VERIFY( sbuf.sbumpc() == c_lit[1] ); - VERIFY( ungetc('Z', fin) == 'Z' ); - VERIFY( sbuf.sbumpc() == 'Z' ); - VERIFY( getc(fin) == c_lit[2] ); - VERIFY( sbuf.sputbackc('X') == 'X' ); - VERIFY( getc(fin) == 'X' ); - - char buf[5]; - memset(buf, 'x', 5); - VERIFY( sbuf.sgetn(buf, 5) == 5 ); - VERIFY( !memcmp(buf, c_lit + 3, 5) ); - VERIFY( getc(fin) == c_lit[8] ); - - fclose(fin); -} - -// libstdc++/12048 -void test02() -{ - bool test __attribute__((unused)) = true; - const char* name = "cin_unget-1.txt"; - - std::FILE* file = std::fopen(name, "r"); - __gnu_cxx::stdio_sync_filebuf<char> sbuf(file); - int c1 = sbuf.sbumpc(); - VERIFY( c1 != EOF ); - int c2 = sbuf.sungetc(); - VERIFY( c2 != EOF ); - int c3 = sbuf.sbumpc(); - VERIFY( c3 == c1 ); - - std::fclose(file); -} - -// libstdc++/12048 -void test03() -{ - bool test __attribute__((unused)) = true; - const char* name = "cin_unget-1.txt"; - - std::FILE* file = std::fopen(name, "r"); - __gnu_cxx::stdio_sync_filebuf<char> sbuf(file); - int c1 = sbuf.sbumpc(); - VERIFY( c1 != EOF ); - int c2 = sbuf.sungetc(); - VERIFY( c2 != EOF ); - int c3 = std::fgetc(file); - VERIFY( c3 == c1 ); - - std::fclose(file); -} - -// libstdc++/12048 -void test04() -{ - bool test __attribute__((unused)) = true; - const char* name = "cin_unget-1.txt"; - - std::FILE* file = std::fopen(name, "r"); - __gnu_cxx::stdio_sync_filebuf<char> sbuf(file); - char buf[2]; - VERIFY( sbuf.sgetn(buf, 2) == 2 ); - int c2 = sbuf.sungetc(); - VERIFY( c2 != EOF ); - int c3 = sbuf.sbumpc(); - VERIFY( c3 == std::char_traits<char>::to_int_type(buf[1]) ); - - std::fclose(file); -} - -// libstdc++/12048 -void test05() -{ - bool test __attribute__((unused)) = true; - const char* name = "cin_unget-1.txt"; - - std::FILE* file = std::fopen(name, "r"); - __gnu_cxx::stdio_sync_filebuf<char> sbuf(file); - char buf[2]; - VERIFY( sbuf.sgetn(buf, 2) == 2 ); - int c2 = sbuf.sungetc(); - VERIFY( c2 != EOF ); - int c3 = std::fgetc(file); - VERIFY( c3 == std::char_traits<char>::to_int_type(buf[1]) ); - - std::fclose(file); -} - -int main () -{ - test01(); - test02(); - test03(); - test04(); - test05(); - - return 0; -} diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc deleted file mode 100644 index 96831c3c2f4..00000000000 --- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc +++ /dev/null @@ -1,142 +0,0 @@ -// 2003-05-01 Petur Runolfsson <peturr02@ru.is> - -// Copyright (C) 2003 Free Software Foundation -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 2, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING. If not, write to the Free -// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, -// USA. - -#include <ext/stdio_sync_filebuf.h> -#include <testsuite_hooks.h> - -void test01() -{ - using namespace std; - typedef char_traits<wchar_t> traits_type; - - bool test __attribute__((unused)) = true; - const char* c_lit = "black pearl jasmine tea"; - const wchar_t* w_lit = L"black pearl jasmine tea"; - int size = strlen(c_lit); - const char* name = "stdiobuf-1.txt"; - - FILE* fout = fopen(name, "w"); - fwrite(c_lit, 1, size, fout); - fclose(fout); - - FILE* fin = fopen(name, "r"); - __gnu_cxx::stdio_sync_filebuf<wchar_t> wsbuf(fin); - - VERIFY( traits_type::to_char_type(wsbuf.sgetc()) == w_lit[0] ); - VERIFY( traits_type::to_char_type(getwc(fin)) == w_lit[0] ); - VERIFY( traits_type::to_char_type(wsbuf.sgetc()) == w_lit[1] ); - VERIFY( traits_type::to_char_type(wsbuf.sbumpc()) == w_lit[1] ); - VERIFY( ungetwc(L'Z', fin) == L'Z' ); - VERIFY( wsbuf.sbumpc() == L'Z' ); - VERIFY( traits_type::to_char_type(getwc(fin)) == w_lit[2] ); - VERIFY( wsbuf.sputbackc(L'X') == L'X' ); - VERIFY( getwc(fin) == L'X' ); - - wchar_t buf[5]; - wmemset(buf, 0xdeadbeef, 5); - VERIFY( wsbuf.sgetn(buf, 5) == 5 ); - VERIFY( !wmemcmp(buf, w_lit + 3, 5) ); - VERIFY( traits_type::to_char_type(getwc(fin)) == w_lit[8] ); - - fclose(fin); -} - -// libstdc++/12048 -void test02() -{ - bool test __attribute__((unused)) = true; - const char* name = "cin_unget-1.txt"; - - std::FILE* file = std::fopen(name, "r"); - __gnu_cxx::stdio_sync_filebuf<wchar_t> sbuf(file); - std::wint_t c1 = sbuf.sbumpc(); - VERIFY( c1 != WEOF ); - std::wint_t c2 = sbuf.sungetc(); - VERIFY( c2 != WEOF ); - std::wint_t c3 = sbuf.sbumpc(); - VERIFY( c3 == c1 ); - - std::fclose(file); -} - -// libstdc++/12048 -void test03() -{ - bool test __attribute__((unused)) = true; - const char* name = "cin_unget-1.txt"; - - std::FILE* file = std::fopen(name, "r"); - __gnu_cxx::stdio_sync_filebuf<wchar_t> sbuf(file); - std::wint_t c1 = sbuf.sbumpc(); - VERIFY( c1 != WEOF ); - std::wint_t c2 = sbuf.sungetc(); - VERIFY( c2 != WEOF ); - std::wint_t c3 = std::fgetwc(file); - VERIFY( c3 == c1 ); - - std::fclose(file); -} - -// libstdc++/12048 -void test04() -{ - bool test __attribute__((unused)) = true; - const char* name = "cin_unget-1.txt"; - - std::FILE* file = std::fopen(name, "r"); - __gnu_cxx::stdio_sync_filebuf<wchar_t> sbuf(file); - wchar_t buf[2]; - VERIFY( sbuf.sgetn(buf, 2) == 2 ); - std::wint_t c2 = sbuf.sungetc(); - VERIFY( c2 != WEOF ); - std::wint_t c3 = sbuf.sbumpc(); - VERIFY( c3 == std::char_traits<wchar_t>::to_int_type(buf[1]) ); - - std::fclose(file); -} - -// libstdc++/12048 -void test05() -{ - bool test __attribute__((unused)) = true; - const char* name = "cin_unget-1.txt"; - - std::FILE* file = std::fopen(name, "r"); - __gnu_cxx::stdio_sync_filebuf<wchar_t> sbuf(file); - wchar_t buf[2]; - VERIFY( sbuf.sgetn(buf, 2) == 2 ); - std::wint_t c2 = sbuf.sungetc(); - VERIFY( c2 != WEOF ); - std::wint_t c3 = std::fgetwc(file); - VERIFY( c3 == std::char_traits<wchar_t>::to_int_type(buf[1]) ); - - std::fclose(file); -} - -int main () -{ - test01(); - test02(); - test03(); - test04(); - test05(); - - return 0; -} |