From reid at x10sys.com Mon Dec 27 00:14:59 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:14:59 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/m4/need_dev_zero_for_mmap.m4 Message-ID: <200412270614.AAA01929@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: need_dev_zero_for_mmap.m4 added (r1.1) --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Provide a check to determine if /dev/zero is needed for AllocateRWX function. --- Diffs of the changes: (+17 -0) Index: llvm/autoconf/m4/need_dev_zero_for_mmap.m4 diff -c /dev/null llvm/autoconf/m4/need_dev_zero_for_mmap.m4:1.1 *** /dev/null Mon Dec 27 00:14:58 2004 --- llvm/autoconf/m4/need_dev_zero_for_mmap.m4 Mon Dec 27 00:14:48 2004 *************** *** 0 **** --- 1,17 ---- + # + # When allocating RWX memory, check whether we need to use /dev/zero + # as the file descriptor or not. + # + AC_DEFUN([AC_NEED_DEV_ZERO_FOR_MMAP], + [AC_CACHE_CHECK([if /dev/zero is needed for mmap], + ac_cv_need_dev_zero_for_mmap, + [if test "$llvm_cv_os_type" == "Interix" ; then + ac_cv_need_dev_zero_for_mmap=yes + else + ac_cv_need_dev_zero_for_mmap=no + fi + ]) + if test "$ac_cv_need_dev_zero_for_mmap" = yes; then + AC_DEFINE([NEED_DEV_ZERO_FOR_MMAP],[1], + [Define if /dev/zero should be used when mapping RWX memory, or undefine if its not necessary]) + fi]) From reid at x10sys.com Mon Dec 27 00:15:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:15:13 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200412270615.AAA01960@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.154 -> 1.155 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Add checks for sterror and strerror_r functions * Add check to determine if /dev/zero is needed for allocating RWX memory. --- Diffs of the changes: (+5 -2) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.154 llvm/autoconf/configure.ac:1.155 --- llvm/autoconf/configure.ac:1.154 Sun Dec 26 21:15:28 2004 +++ llvm/autoconf/configure.ac Mon Dec 27 00:15:02 2004 @@ -443,7 +443,8 @@ AC_CHECK_FUNCS([backtrace getcwd getpagesize getrusage gettimeofday isatty ]) AC_CHECK_FUNCS([mkdtemp mkstemp mktemp ]) -AC_CHECK_FUNCS([realpath setrlimit strdup strtoq strtoll sysconf ]) +AC_CHECK_FUNCS([realpath setrlimit strdup strerror strerror_r strtoll strtoq ]) +AC_CHECK_FUNCS([sysconf]) AC_C_PRINTF_A AC_FUNC_ALLOCA AC_FUNC_RAND48 @@ -459,9 +460,11 @@ AC_FUNC_ISINF dnl Check for mmap and mprotect support. We need both to do the JIT and for -dnl bytecode loading, etc. +dnl bytecode loading, etc. We also need to know if /dev/zero is required to +dnl be opened for allocating RWX memory. AC_FUNC_MMAP AC_FUNC_MMAP_FILE +AC_NEED_DEV_ZERO_FOR_MMAP AC_CHECK_FUNC(mprotect,, AC_MSG_ERROR([Function mprotect() required but not found])) From reid at x10sys.com Mon Dec 27 00:15:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:15:13 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200412270615.AAA01963@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.43 -> 1.44 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Add checks for sterror and strerror_r functions * Add check to determine if /dev/zero is needed for allocating RWX memory. --- Diffs of the changes: (+10 -0) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.43 llvm/include/llvm/Config/config.h.in:1.44 --- llvm/include/llvm/Config/config.h.in:1.43 Sat Dec 25 01:31:29 2004 +++ llvm/include/llvm/Config/config.h.in Mon Dec 27 00:15:02 2004 @@ -270,6 +270,12 @@ /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the `strerror_r' function. */ +#undef HAVE_STRERROR_R + /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H @@ -385,6 +391,10 @@ /* Define to the system default library search path. */ #undef LTDL_SYSSEARCHPATH +/* Define if /dev/zero should be used when mapping RWX memory, or undefine if + its not necessary */ +#undef NEED_DEV_ZERO_FOR_MMAP + /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/SysConfig.h Message-ID: <200412270615.AAA02007@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: SysConfig.h (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/SysConfig.cpp Message-ID: <200412270615.AAA02008@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: SysConfig.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Cygwin/SysConfig.cpp Message-ID: <200412270615.AAA02009@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Cygwin: SysConfig.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:55 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/MappedFile.cpp Message-ID: <200412270615.AAA02125@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: MappedFile.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/MappedFile.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:56 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Darwin/MappedFile.cpp Message-ID: <200412270615.AAA02135@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Darwin: MappedFile.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/MappedFile.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:55 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Interix/MappedFile.cpp Message-ID: <200412270615.AAA02126@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Interix: MappedFile.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/MappedFile.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:55 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/SunOS/MappedFile.cpp Message-ID: <200412270615.AAA02127@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/SunOS: MappedFile.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/MappedFile.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:56 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/MappedFile.cpp Message-ID: <200412270615.AAA02136@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: MappedFile.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/MappedFile.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:56 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/AIX/MappedFile.cpp Message-ID: <200412270615.AAA02134@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/AIX: MappedFile.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/MappedFile.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:56 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Cygwin/MappedFile.cpp Message-ID: <200412270615.AAA02143@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Cygwin: MappedFile.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/MappedFile.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:51 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/TimeValue.cpp Message-ID: <200412270616.AAA02345@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: TimeValue.cpp (r1.7) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/TimeValue.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:10 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Interix/Memory.cpp Message-ID: <200412270616.AAA02195@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Interix: Memory.cpp (r1.4) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Memory.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:09 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/AIX/Memory.cpp Message-ID: <200412270616.AAA02180@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/AIX: Memory.cpp (r1.3) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Memory.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:23 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/AIX/Signals.cpp Message-ID: <200412270616.AAA02237@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/AIX: Signals.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Signals.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:17:03 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:17:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/MappedFile.cpp Program.cpp Signals.cpp Message-ID: <200412270617.AAA02380@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: MappedFile.cpp updated: 1.8 -> 1.9 Program.cpp updated: 1.9 -> 1.10 Signals.cpp updated: 1.4 -> 1.5 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Ensure #includes are wrapped with appropriate HAVE_ guards --- Diffs of the changes: (+20 -6) Index: llvm/lib/System/Unix/MappedFile.cpp diff -u llvm/lib/System/Unix/MappedFile.cpp:1.8 llvm/lib/System/Unix/MappedFile.cpp:1.9 --- llvm/lib/System/Unix/MappedFile.cpp:1.8 Sun Dec 12 20:58:51 2004 +++ llvm/lib/System/Unix/MappedFile.cpp Mon Dec 27 00:16:52 2004 @@ -16,10 +16,20 @@ //=== is guaranteed to work on *all* UNIX variants. //===----------------------------------------------------------------------===// -#include "llvm/System/Process.h" #include "Unix.h" +#include "llvm/System/Process.h" + +#ifdef HAVE_FCNTL_H #include +#endif + +#ifdef HAVE_SYS_MMAN_H #include +#endif + +#ifdef HAVE_SYS_STAT_H +#include +#endif namespace llvm { using namespace sys; Index: llvm/lib/System/Unix/Program.cpp diff -u llvm/lib/System/Unix/Program.cpp:1.9 llvm/lib/System/Unix/Program.cpp:1.10 --- llvm/lib/System/Unix/Program.cpp:1.9 Sun Dec 19 12:58:11 2004 +++ llvm/lib/System/Unix/Program.cpp Mon Dec 27 00:16:52 2004 @@ -18,13 +18,16 @@ #include #include "Unix.h" +#include +#if HAVE_SYS_STAT_H #include +#endif +#if HAVE_SIGNAL_H #include +#endif +#if HAVE_FCNTL_H #include -#ifdef HAVE_SYS_WAIT_H -#include #endif -#include extern char** environ; Index: llvm/lib/System/Unix/Signals.cpp diff -u llvm/lib/System/Unix/Signals.cpp:1.4 llvm/lib/System/Unix/Signals.cpp:1.5 --- llvm/lib/System/Unix/Signals.cpp:1.4 Fri Dec 10 18:14:15 2004 +++ llvm/lib/System/Unix/Signals.cpp Mon Dec 27 00:16:52 2004 @@ -15,11 +15,12 @@ #include "Unix.h" #include #include -#ifdef HAVE_EXECINFO_H +#if HAVE_EXECINFO_H # include // For backtrace(). #endif -#include +#if HAVE_SIGNAL_H #include +#endif namespace { From llvm at cs.uiuc.edu Mon Dec 27 00:15:42 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Darwin/Process.cpp Message-ID: <200412270615.AAA02081@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Darwin: Process.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Process.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:15:56 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:15:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/MappedFile.cpp Message-ID: <200412270615.AAA02146@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: MappedFile.cpp updated: 1.1 -> 1.2 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/MappedFile.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+7 -1) Index: llvm/lib/System/MappedFile.cpp diff -u llvm/lib/System/MappedFile.cpp:1.1 llvm/lib/System/MappedFile.cpp:1.2 --- llvm/lib/System/MappedFile.cpp:1.1 Mon Oct 4 06:08:32 2004 +++ llvm/lib/System/MappedFile.cpp Mon Dec 27 00:15:43 2004 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/System/MappedFile.h" +#include "llvm/Config/config.h" namespace llvm { using namespace sys; @@ -24,6 +25,11 @@ } // Include the platform-specific parts of this class. -#include "platform/MappedFile.cpp" +#ifdef LLVM_ON_UNIX +#include "Unix/MappedFile.cpp" +#endif +#ifdef LLVM_ON_WIN32 +#include "Win32/MappedFile.cpp" +#endif // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From llvm at cs.uiuc.edu Mon Dec 27 00:16:51 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Interix/TimeValue.cpp Message-ID: <200412270616.AAA02342@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Interix: TimeValue.cpp (r1.3) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/TimeValue.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/SysConfig.cpp Message-ID: <200412270615.AAA02014@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: SysConfig.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:23 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/Signals.cpp Message-ID: <200412270616.AAA02236@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: Signals.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Signals.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:17:26 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:17:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200412270617.AAA02405@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.28 -> 1.29 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Ensure #includes are wrapped with appropriate HAVE_ guards * Ensure variations in "dirent" structure are accounted for. --- Diffs of the changes: (+25 -1) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.28 llvm/lib/System/Unix/Path.cpp:1.29 --- llvm/lib/System/Unix/Path.cpp:1.28 Fri Dec 24 00:29:42 2004 +++ llvm/lib/System/Unix/Path.cpp Mon Dec 27 00:17:15 2004 @@ -18,11 +18,35 @@ #include "llvm/Config/alloca.h" #include "Unix.h" +#if HAVE_SYS_STAT_H #include +#endif +#if HAVE_FCNTL_H #include +#endif +#if HAVE_UTIME_H #include -#include +#endif +#if HAVE_TIME_H #include +#endif +#if HAVE_DIRENT_H +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + namespace llvm { using namespace sys; From reid at x10sys.com Mon Dec 27 00:16:37 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:16:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Program.cpp Message-ID: <200412270616.AAA02286@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Program.cpp updated: 1.1 -> 1.2 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Program.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+7 -1) Index: llvm/lib/System/Program.cpp diff -u llvm/lib/System/Program.cpp:1.1 llvm/lib/System/Program.cpp:1.2 --- llvm/lib/System/Program.cpp:1.1 Sun Aug 29 14:20:41 2004 +++ llvm/lib/System/Program.cpp Mon Dec 27 00:16:24 2004 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/System/Program.h" +#include "llvm/Config/config.h" namespace llvm { using namespace sys; @@ -24,6 +25,11 @@ } // Include the platform-specific parts of this class. -#include "platform/Program.cpp" +#ifdef LLVM_ON_UNIX +#include "Unix/Program.cpp" +#endif +#ifdef LLVM_ON_WIN32 +#include "Win32/Program.cpp" +#endif // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From llvm at cs.uiuc.edu Mon Dec 27 00:16:51 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Darwin/TimeValue.cpp Message-ID: <200412270616.AAA02343@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Darwin: TimeValue.cpp (r1.3) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/TimeValue.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Interix/SysConfig.cpp Message-ID: <200412270615.AAA02028@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Interix: SysConfig.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:23 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/SunOS/Signals.cpp Message-ID: <200412270616.AAA02238@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/SunOS: Signals.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Signals.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:41 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/Process.cpp Message-ID: <200412270615.AAA02069@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: Process.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Process.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:18:12 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:18:12 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/bugpoint.cpp Message-ID: <200412270618.AAA02470@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: bugpoint.cpp updated: 1.21 -> 1.22 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * sys::PreventCoreFiles -> sys::Process::PreventCoreFiles --- Diffs of the changes: (+2 -2) Index: llvm/tools/bugpoint/bugpoint.cpp diff -u llvm/tools/bugpoint/bugpoint.cpp:1.21 llvm/tools/bugpoint/bugpoint.cpp:1.22 --- llvm/tools/bugpoint/bugpoint.cpp:1.21 Sun Dec 19 23:36:57 2004 +++ llvm/tools/bugpoint/bugpoint.cpp Mon Dec 27 00:18:02 2004 @@ -16,9 +16,9 @@ #include "BugDriver.h" #include "llvm/Support/PassNameParser.h" #include "llvm/Support/ToolRunner.h" -#include "llvm/System/SysConfig.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/PluginLoader.h" +#include "llvm/System/Process.h" #include "llvm/System/Signals.h" using namespace llvm; @@ -45,7 +45,7 @@ // Bugpoint has the ability of generating a plethora of core files, so to // avoid filling up the disk, we prevent it - sys::PreventCoreFiles(); + sys::Process::PreventCoreFiles(); try { return D.run(); From llvm at cs.uiuc.edu Mon Dec 27 00:16:51 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Cygwin/TimeValue.cpp Message-ID: <200412270616.AAA02344@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Cygwin: TimeValue.cpp (r1.4) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/TimeValue.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:17:38 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:17:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Process.cpp Message-ID: <200412270617.AAA02428@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Process.cpp updated: 1.5 -> 1.6 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Move implementation of sys::PreventCoreFiles function to this file from the now defunct SysConfig abstraction. --- Diffs of the changes: (+12 -0) Index: llvm/lib/System/Unix/Process.cpp diff -u llvm/lib/System/Unix/Process.cpp:1.5 llvm/lib/System/Unix/Process.cpp:1.6 --- llvm/lib/System/Unix/Process.cpp:1.5 Mon Dec 20 15:43:33 2004 +++ llvm/lib/System/Unix/Process.cpp Mon Dec 27 00:17:26 2004 @@ -109,6 +109,18 @@ #endif } +// Some LLVM programs such as bugpoint produce core files as a normal part of +// their operation. To prevent the disk from filling up, this function +// does what's necessary to prevent their generation. +void Process::PreventCoreFiles() { +#if HAVE_SETRLIMIT + struct rlimit rlim; + rlim.rlim_cur = rlim.rlim_max = 0; + int res = setrlimit(RLIMIT_CORE, &rlim); + if (res != 0) + ThrowErrno("Can't prevent core file generation"); +#endif +} } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Mon Dec 27 00:18:01 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:18:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Unix.h Message-ID: <200412270618.AAA02457@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Unix.h updated: 1.9 -> 1.10 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Ensure #includes are wrapped with appropriate HAVE_ guards * Account for variations in time.h and sys/time.h inclusion. * Add macros for getting wait(2) exit status correctly (per autoconf sugg.) * Implement ThrowErrno in terms of strerror_r, strerror or none based on what is available on the platform. --- Diffs of the changes: (+58 -4) Index: llvm/lib/System/Unix/Unix.h diff -u llvm/lib/System/Unix/Unix.h:1.9 llvm/lib/System/Unix/Unix.h:1.10 --- llvm/lib/System/Unix/Unix.h:1.9 Wed Dec 8 10:10:52 2004 +++ llvm/lib/System/Unix/Unix.h Mon Dec 27 00:17:50 2004 @@ -11,24 +11,78 @@ // //===----------------------------------------------------------------------===// +#ifndef LLVM_SYSTEM_UNIX_UNIX_H +#define LLVM_SYSTEM_UNIX_UNIX_H + //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only generic UNIX code that //=== is guaranteed to work on all UNIX variants. //===----------------------------------------------------------------------===// #include "llvm/Config/config.h" // Get autoconf configuration settings -#include #include #include #include #include +#include +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef HAVE_SYS_TYPES_H #include +#endif + +#ifdef HAVE_SYS_PARAM_H #include +#endif + +#ifdef HAVE_ASSERT_H #include -#include -#include +#endif + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#ifdef HAVE_SYS_WAIT_H +# include +#endif + +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif + +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif inline void ThrowErrno(const std::string& prefix) { char buffer[MAXPATHLEN]; - throw prefix + ": " + strerror(errno); +#ifdef HAVE_STRERROR_R + // strerror_r is thread-safe. + strerror_r(errno,buffer,MAXPATHLEN-1); +#elif HAVE_STRERROR + // Copy the thread un-safe result of strerror into + // the buffer as fast as possible to minimize impact + // of collision of strerror in multiple threads. + strncpy(buffer,strerror(errno),MAXPATHLEN-1); + buffer[MAXPATHLEN-1] = 0; +#else + // Strange that this system doesn't even have strerror + // but, oh well, just use a generic message + sprintf(buffer, "Error #%d", errno); +#endif + throw prefix + ": " + buffer; } + +#endif From llvm at cs.uiuc.edu Mon Dec 27 00:16:23 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Interix/Signals.cpp Message-ID: <200412270616.AAA02239@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Interix: Signals.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Signals.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:37 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Interix/Program.cpp Message-ID: <200412270616.AAA02298@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Interix: Program.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Program.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:37 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/Program.cpp Message-ID: <200412270616.AAA02290@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: Program.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Program.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:16:51 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:16:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/TimeValue.cpp Message-ID: <200412270616.AAA02354@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: TimeValue.cpp updated: 1.2 -> 1.3 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/TimeValue.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+8 -2) Index: llvm/lib/System/TimeValue.cpp diff -u llvm/lib/System/TimeValue.cpp:1.2 llvm/lib/System/TimeValue.cpp:1.3 --- llvm/lib/System/TimeValue.cpp:1.2 Sun Nov 14 16:06:18 2004 +++ llvm/lib/System/TimeValue.cpp Mon Dec 27 00:16:38 2004 @@ -11,7 +11,8 @@ // //===----------------------------------------------------------------------===// -#include +#include "llvm/System/TimeValue.h" +#include "llvm/Config/config.h" namespace llvm { using namespace sys; @@ -48,6 +49,11 @@ } /// Include the platform specific portion of TimeValue class -#include "platform/TimeValue.cpp" +#ifdef LLVM_ON_UNIX +#include "Unix/TimeValue.cpp" +#endif +#ifdef LLVM_ON_WIN32 +#include "Win32/TimeValue.cpp" +#endif // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From llvm at cs.uiuc.edu Mon Dec 27 00:16:51 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/SunOS/TimeValue.cpp Message-ID: <200412270616.AAA02363@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/SunOS: TimeValue.cpp (r1.5) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/TimeValue.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:15:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:15:13 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200412270615.AAA01966@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.161 -> 1.162 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Add checks for sterror and strerror_r functions * Add check to determine if /dev/zero is needed for allocating RWX memory. --- Diffs of the changes: (+127 -3) Index: llvm/configure diff -u llvm/configure:1.161 llvm/configure:1.162 --- llvm/configure:1.161 Sat Dec 25 01:31:28 2004 +++ llvm/configure Mon Dec 27 00:15:02 2004 @@ -24601,7 +24601,7 @@ ETAGSFLAGS=$ETAGSFLAGS -if test "$WITH_LLVMGCCDIR" != "default" ; then +if test "$WITH_LLVMGCCDIR" = "default" ; then # Extract the first word of "llvm-gcc", so it can be a program name with args. set dummy llvm-gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -25750,7 +25750,7 @@ if test "$ac_cv_header_mmap_anon" = yes; then cat >>confdefs.h <<\_ACEOF -#define HAVE_MMAP_ANONYMOUS +#define HAVE_MMAP_ANONYMOUS 1 _ACEOF fi @@ -27269,7 +27269,110 @@ -for ac_func in realpath setrlimit strdup strtoq strtoll sysconf + +for ac_func in realpath setrlimit strdup strerror strerror_r strtoll strtoq +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in sysconf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -29747,6 +29850,27 @@ fi +echo "$as_me:$LINENO: checking if /dev/zero is needed for mmap" >&5 +echo $ECHO_N "checking if /dev/zero is needed for mmap... $ECHO_C" >&6 +if test "${ac_cv_need_dev_zero_for_mmap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$llvm_cv_os_type" == "Interix" ; then + ac_cv_need_dev_zero_for_mmap=yes + else + ac_cv_need_dev_zero_for_mmap=no + fi + +fi +echo "$as_me:$LINENO: result: $ac_cv_need_dev_zero_for_mmap" >&5 +echo "${ECHO_T}$ac_cv_need_dev_zero_for_mmap" >&6 +if test "$ac_cv_need_dev_zero_for_mmap" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define NEED_DEV_ZERO_FOR_MMAP 1 +_ACEOF + +fi echo "$as_me:$LINENO: checking for mprotect" >&5 echo $ECHO_N "checking for mprotect... $ECHO_C" >&6 if test "${ac_cv_func_mprotect+set}" = set; then From llvm at cs.uiuc.edu Mon Dec 27 00:16:51 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/AIX/TimeValue.cpp Message-ID: <200412270616.AAA02360@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/AIX: TimeValue.cpp (r1.3) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/TimeValue.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:09 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/Memory.cpp Message-ID: <200412270616.AAA02189@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: Memory.cpp (r1.4) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Memory.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/AIX/SysConfig.cpp Message-ID: <200412270615.AAA02025@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/AIX: SysConfig.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/SunOS/SysConfig.cpp Message-ID: <200412270615.AAA02011@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/SunOS: SysConfig.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:23 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Darwin/Signals.cpp Message-ID: <200412270616.AAA02247@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Darwin: Signals.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Signals.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:16:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:16:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Signals.cpp Message-ID: <200412270616.AAA02251@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Signals.cpp updated: 1.1 -> 1.2 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Signals.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+7 -1) Index: llvm/lib/System/Signals.cpp diff -u llvm/lib/System/Signals.cpp:1.1 llvm/lib/System/Signals.cpp:1.2 --- llvm/lib/System/Signals.cpp:1.1 Sun Aug 29 14:22:48 2004 +++ llvm/lib/System/Signals.cpp Mon Dec 27 00:16:10 2004 @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "llvm/System/Signals.h" +#include "llvm/Config/config.h" namespace llvm { using namespace sys; @@ -25,6 +26,11 @@ } // Include the platform-specific parts of this class. -#include "platform/Signals.cpp" +#ifdef LLVM_ON_UNIX +#include "Unix/Signals.cpp" +#endif +#ifdef LLVM_ON_WIN32 +#include "Win32/Signals.cpp" +#endif // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From llvm at cs.uiuc.edu Mon Dec 27 00:16:24 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Cygwin/Signals.cpp Message-ID: <200412270616.AAA02254@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Cygwin: Signals.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Signals.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/SysConfig.cpp Message-ID: <200412270615.AAA02010@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: SysConfig.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/SysConfig.cpp Message-ID: <200412270615.AAA02037@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: SysConfig.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/SysConfig.cpp Message-ID: <200412270615.AAA02029@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: SysConfig.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:28 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:28 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Darwin/SysConfig.cpp Message-ID: <200412270615.AAA02030@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Darwin: SysConfig.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:09 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Darwin/Memory.cpp Message-ID: <200412270616.AAA02183@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Darwin: Memory.cpp (r1.3) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Memory.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:51 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:51 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/TimeValue.cpp Message-ID: <200412270616.AAA02357@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: TimeValue.cpp (r1.4) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/TimeValue.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:16:10 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:16:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Memory.cpp Message-ID: <200412270616.AAA02192@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Memory.cpp updated: 1.1 -> 1.2 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Memory.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+7 -1) Index: llvm/lib/System/Memory.cpp diff -u llvm/lib/System/Memory.cpp:1.1 llvm/lib/System/Memory.cpp:1.2 --- llvm/lib/System/Memory.cpp:1.1 Fri Sep 10 23:59:30 2004 +++ llvm/lib/System/Memory.cpp Mon Dec 27 00:15:57 2004 @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "llvm/System/Memory.h" +#include "llvm/Config/config.h" namespace llvm { using namespace sys; @@ -25,6 +26,11 @@ } // Include the platform-specific parts of this class. -#include "platform/Memory.cpp" +#ifdef LLVM_ON_UNIX +#include "Unix/Memory.cpp" +#endif +#ifdef LLVM_ON_WIN32 +#include "Win32/Memory.cpp" +#endif // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From llvm at cs.uiuc.edu Mon Dec 27 00:16:09 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/Memory.cpp Message-ID: <200412270616.AAA02184@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: Memory.cpp (r1.3) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Memory.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:17:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:17:14 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Memory.cpp Message-ID: <200412270617.AAA02392@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Memory.cpp updated: 1.1 -> 1.2 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Ensure #includes are wrapped with appropriate HAVE_ guards * Consolidate implementation from operating system specific directory. --- Diffs of the changes: (+50 -0) Index: llvm/lib/System/Unix/Memory.cpp diff -u llvm/lib/System/Unix/Memory.cpp:1.1 llvm/lib/System/Unix/Memory.cpp:1.2 --- llvm/lib/System/Unix/Memory.cpp:1.1 Fri Sep 10 23:57:25 2004 +++ llvm/lib/System/Unix/Memory.cpp Mon Dec 27 00:17:03 2004 @@ -12,9 +12,59 @@ //===----------------------------------------------------------------------===// #include "Unix.h" +#include "llvm/System/Process.h" + +#ifdef HAVE_SYS_MMAN_H +#include +#endif namespace llvm { +/// AllocateRWXMemory - Allocate a slab of memory with read/write/execute +/// permissions. This is typically used for JIT applications where we want +/// to emit code to the memory then jump to it. Getting this type of memory +/// is very OS specific. +/// +MemoryBlock Memory::AllocateRWX(unsigned NumBytes) { + if (NumBytes == 0) return MemoryBlock(); + + long pageSize = Process::GetPageSize(); + unsigned NumPages = (NumBytes+pageSize-1)/pageSize; + + int fd = -1; +#ifdef NEED_DEV_ZERO_FOR_MMAP + static int zero_fd = open("/dev/zero", O_RDWR); + if (zero_fd == -1) { + ThrowErrno("Can't open /dev/zero device"); + } + fd = zero_fd; +#endif + + int flags = MAP_PRIVATE | +#ifdef HAVE_MMAP_ANONYMOUS + MAP_ANONYMOUS +#else + MAP_ANON +#endif + ; + void *pa = ::mmap(0, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC, + flags, fd, 0); + if (pa == MAP_FAILED) { + ThrowErrno("Can't allocate RWX Memory"); + } + MemoryBlock result; + result.Address = pa; + result.Size = NumPages*pageSize; + return result; +} + +void Memory::ReleaseRWX(MemoryBlock& M) { + if (M.Address == 0 || M.Size == 0) return; + if (0 != ::munmap(M.Address, M.Size)) { + ThrowErrno("Can't release RWX Memory"); + } +} + } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From llvm at cs.uiuc.edu Mon Dec 27 00:16:10 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Cygwin/Memory.cpp Message-ID: <200412270616.AAA02201@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Cygwin: Memory.cpp (r1.5) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Memory.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:10 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:10 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/SunOS/Memory.cpp Message-ID: <200412270616.AAA02198@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/SunOS: Memory.cpp (r1.4) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Memory.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:17:38 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:17:38 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Process.h Message-ID: <200412270617.AAA02434@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Process.h updated: 1.2 -> 1.3 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Move implementation of sys::PreventCoreFiles function to this file from the now defunct SysConfig abstraction. --- Diffs of the changes: (+6 -0) Index: llvm/include/llvm/System/Process.h diff -u llvm/include/llvm/System/Process.h:1.2 llvm/include/llvm/System/Process.h:1.3 --- llvm/include/llvm/System/Process.h:1.2 Sun Dec 19 18:58:53 2004 +++ llvm/include/llvm/System/Process.h Mon Dec 27 00:17:27 2004 @@ -63,6 +63,12 @@ ///< Returns the current amount of system time for the process ); + /// This function makes the necessary calls to the operating system to + /// prevent core files or any other kind of large memory dumps that can + /// occur when a program fails. + /// @brief Prevent core file generation. + static void PreventCoreFiles(); + /// @} }; } From reid at x10sys.com Mon Dec 27 00:17:38 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:17:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Process.cpp Message-ID: <200412270617.AAA02431@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Process.cpp updated: 1.5 -> 1.6 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Move implementation of sys::PreventCoreFiles function to this file from the now defunct SysConfig abstraction. --- Diffs of the changes: (+9 -0) Index: llvm/lib/System/Win32/Process.cpp diff -u llvm/lib/System/Win32/Process.cpp:1.5 llvm/lib/System/Win32/Process.cpp:1.6 --- llvm/lib/System/Win32/Process.cpp:1.5 Wed Dec 22 21:44:40 2004 +++ llvm/lib/System/Win32/Process.cpp Mon Dec 27 00:17:26 2004 @@ -90,5 +90,14 @@ sys_time.nanoseconds( unsigned(KernelTime % 10000000) * 100 ); } +// Some LLVM programs such as bugpoint produce core files as a normal part of +// their operation. To prevent the disk from filling up, this configuration item +// does what's necessary to prevent their generation. +void Process::PreventCoreFiles() { + // Windows doesn't do core files, so nothing to do. + // Although... it might be nice to prevent the do-you-want-to-debug + // dialog box from coming up. Or maybe not... +} + } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Mon Dec 27 00:17:49 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:17:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/TimeValue.cpp Message-ID: <200412270617.AAA02445@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: TimeValue.cpp updated: 1.5 -> 1.6 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Remove redundant #includes that are now in Unix.h --- Diffs of the changes: (+0 -4) Index: llvm/lib/System/Unix/TimeValue.cpp diff -u llvm/lib/System/Unix/TimeValue.cpp:1.5 llvm/lib/System/Unix/TimeValue.cpp:1.6 --- llvm/lib/System/Unix/TimeValue.cpp:1.5 Tue Nov 16 00:22:17 2004 +++ llvm/lib/System/Unix/TimeValue.cpp Mon Dec 27 00:17:39 2004 @@ -18,13 +18,9 @@ #include "Unix.h" -#include -#include - namespace llvm { using namespace sys; - std::string TimeValue::toString() const { char buffer[32]; From llvm at cs.uiuc.edu Mon Dec 27 00:16:37 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/Program.cpp Message-ID: <200412270616.AAA02289@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: Program.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Program.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:37 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Darwin/Program.cpp Message-ID: <200412270616.AAA02295@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Darwin: Program.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Program.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:42 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Interix/Process.cpp Message-ID: <200412270615.AAA02078@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Interix: Process.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Process.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:41 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Cygwin/Process.cpp Message-ID: <200412270615.AAA02073@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Cygwin: Process.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Process.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:37 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/SunOS/Program.cpp Message-ID: <200412270616.AAA02301@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/SunOS: Program.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Program.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:41 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/Process.cpp Message-ID: <200412270615.AAA02072@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: Process.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Process.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:42 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/SunOS/Process.cpp Message-ID: <200412270615.AAA02082@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/SunOS: Process.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Process.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:37 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Cygwin/Program.cpp Message-ID: <200412270616.AAA02304@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Cygwin: Program.cpp (r1.2) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Program.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:37 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/AIX/Program.cpp Message-ID: <200412270616.AAA02305@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/AIX: Program.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Program.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:16:23 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:16:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/Signals.cpp Message-ID: <200412270616.AAA02233@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: Signals.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Signals.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Mon Dec 27 00:15:42 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 27 Dec 2004 00:15:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/AIX/Process.cpp Message-ID: <200412270615.AAA02090@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/AIX: Process.cpp (r1.1) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Process.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 27 00:15:42 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 00:15:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Process.cpp Message-ID: <200412270615.AAA02087@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Process.cpp updated: 1.1 -> 1.2 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Consolidate implementation for Unix systems into Unix/Process.cpp * Avoid use of symbolic link to #include platform-specific implementation. --- Diffs of the changes: (+7 -1) Index: llvm/lib/System/Process.cpp diff -u llvm/lib/System/Process.cpp:1.1 llvm/lib/System/Process.cpp:1.2 --- llvm/lib/System/Process.cpp:1.1 Fri Sep 10 23:59:30 2004 +++ llvm/lib/System/Process.cpp Mon Dec 27 00:15:29 2004 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/System/Process.h" +#include "llvm/Config/config.h" namespace llvm { using namespace sys; @@ -24,6 +25,11 @@ } // Include the platform-specific parts of this class. -#include "platform/Process.cpp" +#ifdef LLVM_ON_UNIX +#include "Unix/Process.cpp" +#endif +#ifdef LLVM_ON_WIN32 +#include "Win32/Process.cpp" +#endif // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Mon Dec 27 02:03:16 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 02:03:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200412270803.CAA04187@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.38 -> 1.39 --- Log message: Fix a bug that made the nightly tester *really* slow. During changes for portability, the --track-space option was inadvertently ignored. This patch fixes that so that sys::Process::GetMallocUsage() is only invoked if the --track-spaces option is given. Apparently the mallinfo() call that GetMallocUsage() uses is *very* slow, especially when processing very large modules like projects/llvm-test/MultiSource/Applications/kimwitu++. --- Diffs of the changes: (+9 -3) Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.38 llvm/lib/Support/Timer.cpp:1.39 --- llvm/lib/Support/Timer.cpp:1.38 Mon Dec 20 15:44:27 2004 +++ llvm/lib/Support/Timer.cpp Mon Dec 27 02:03:04 2004 @@ -93,6 +93,12 @@ } } +static inline long getMemUsage() { + if (TrackSpace) + return sys::Process::GetMallocUsage(); + return 0; +} + struct TimeRecord { double Elapsed, UserTime, SystemTime; long MemUsed; @@ -108,9 +114,9 @@ long MemUsed = 0; if (Start) { sys::Process::GetTimeUsage(now,user,sys); - MemUsed = sys::Process::GetMallocUsage(); + MemUsed = getMemUsage(); } else { - MemUsed = sys::Process::GetMallocUsage(); + MemUsed = getMemUsage(); sys::Process::GetTimeUsage(now,user,sys); } @@ -165,7 +171,7 @@ /// currently active timers, which will be printed when the timer group prints /// void Timer::addPeakMemoryMeasurement() { - long MemUsed = sys::Process::GetMallocUsage(); + long MemUsed = getMemUsage(); for (std::vector::iterator I = ActiveTimers.begin(), E = ActiveTimers.end(); I != E; ++I) From reid at x10sys.com Mon Dec 27 02:50:38 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 02:50:38 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412270850.CAA04779@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.279 -> 1.280 --- Log message: Make it possible to reconfigure a project as well as just LLVM main dir. --- Diffs of the changes: (+5 -4) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.279 llvm/Makefile.rules:1.280 --- llvm/Makefile.rules:1.279 Fri Dec 24 08:47:34 2004 +++ llvm/Makefile.rules Mon Dec 27 02:50:27 2004 @@ -63,8 +63,9 @@ SrcMakefiles := $(filter %Makefile %Makefile.tests,\ $(wildcard $(BUILD_SRC_DIR)/Makefile*)) ObjMakefiles := $(subst $(BUILD_SRC_DIR),$(BUILD_OBJ_DIR),$(SrcMakefiles)) -ConfigureScript := $(LLVM_SRC_ROOT)/configure -ConfigStatusScript := $(LLVM_OBJ_ROOT)/config.status +ConfigureScript := $(BUILD_SRC_ROOT)/configure +ConfigStatusScript := $(BUILD_OBJ_ROOT)/config.status +LConfigStatusScript:= $(LLVM_OBJ_ROOT)/config.status MakefileConfigIn := $(LLVM_SRC_ROOT)/Makefile.config.in MakefileConfig := $(LLVM_OBJ_ROOT)/Makefile.config PreConditions := $(ConfigStatusScript) $(MakefileConfig) $(ObjMakefiles) @@ -129,9 +130,9 @@ #------------------------------------------------------------------------ # Make sure the configuration makefile is up to date #------------------------------------------------------------------------ -$(MakefileConfig): $(MakefileConfigIn) $(ConfigStatusScript) +$(MakefileConfig): $(MakefileConfigIn) $(LConfigStatusScript) $(Echo) Regenerating $@ - $(Verb) cd $(LLVM_OBJ_ROOT) ; $(ConfigStatusScript) Makefile.config + $(Verb) cd $(LLVM_OBJ_ROOT) ; $(LConfigStatusScript) Makefile.config #------------------------------------------------------------------------ # If the Makefile in the source tree has been updated, copy it over into the From reid at x10sys.com Mon Dec 27 02:52:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 02:52:05 -0600 Subject: [llvm-commits] CVS: llvm/projects/Stacker/autoconf/configure.ac Message-ID: <200412270852.CAA04807@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/autoconf: configure.ac updated: 1.3 -> 1.4 --- Log message: Clean up some autoconf cruft * Make the source detection use a file unique to Stacker * Configure Makefile.common.in with AC_CONFIG_FILES not AC_CONFIG_MAKEFILE * Use new autoconf format for invoking AC_OUTPUT --- Diffs of the changes: (+5 -3) Index: llvm/projects/Stacker/autoconf/configure.ac diff -u llvm/projects/Stacker/autoconf/configure.ac:1.3 llvm/projects/Stacker/autoconf/configure.ac:1.4 --- llvm/projects/Stacker/autoconf/configure.ac:1.3 Wed Sep 15 01:19:53 2004 +++ llvm/projects/Stacker/autoconf/configure.ac Mon Dec 27 02:51:55 2004 @@ -7,10 +7,12 @@ AC_CONFIG_AUX_DIR([autoconf]) dnl Verify that the source directory is valid -AC_CONFIG_SRCDIR([Makefile.common.in]) +AC_CONFIG_SRCDIR([lib/compiler/StackerParser.y]) + +AC_CONFIG_FILES([Makefile.common]) dnl Configure Makefiles -dnl List every Makefile that ecists within your source tree +dnl List every Makefile that exists within your source tree AC_CONFIG_MAKEFILE(Makefile) AC_CONFIG_MAKEFILE(lib/Makefile) @@ -74,4 +76,4 @@ dnl ************************************************************************** dnl * Create the output files dnl ************************************************************************** -AC_OUTPUT(Makefile.common) +AC_OUTPUT From reid at x10sys.com Mon Dec 27 02:52:06 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 02:52:06 -0600 Subject: [llvm-commits] CVS: llvm/projects/Stacker/configure Message-ID: <200412270852.CAA04810@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker: configure updated: 1.3 -> 1.4 --- Log message: Clean up some autoconf cruft * Make the source detection use a file unique to Stacker * Configure Makefile.common.in with AC_CONFIG_FILES not AC_CONFIG_MAKEFILE * Use new autoconf format for invoking AC_OUTPUT --- Diffs of the changes: (+32 -30) Index: llvm/projects/Stacker/configure diff -u llvm/projects/Stacker/configure:1.3 llvm/projects/Stacker/configure:1.4 --- llvm/projects/Stacker/configure:1.3 Wed Sep 15 01:19:53 2004 +++ llvm/projects/Stacker/configure Mon Dec 27 02:51:55 2004 @@ -427,7 +427,7 @@ PACKAGE_STRING='[Stacker] [1.0]' PACKAGE_BUGREPORT='rspencer at x10sys.com' -ac_unique_file="Makefile.common.in" +ac_unique_file="lib/compiler/StackerParser.y" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -1533,6 +1533,9 @@ + ac_config_files="$ac_config_files Makefile.common" + + ac_config_commands="$ac_config_commands Makefile" @@ -3112,7 +3115,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3115 "configure"' > conftest.$ac_ext + echo '#line 3118 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4575,7 +4578,7 @@ # Provide some information about the compiler. -echo "$as_me:4578:" \ +echo "$as_me:4581:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -5606,11 +5609,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5609: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5612: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5613: \$? = $ac_status" >&5 + echo "$as_me:5616: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -5838,11 +5841,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5841: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5844: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5845: \$? = $ac_status" >&5 + echo "$as_me:5848: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -5905,11 +5908,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5908: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5911: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:5912: \$? = $ac_status" >&5 + echo "$as_me:5915: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8023,7 +8026,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10283: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10284: \$? = $ac_status" >&5 + echo "$as_me:10287: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10344,11 +10347,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10347: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10350: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10351: \$? = $ac_status" >&5 + echo "$as_me:10354: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11673,7 +11676,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12599: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12600: \$? = $ac_status" >&5 + echo "$as_me:12603: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12660,11 +12663,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12663: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12666: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12667: \$? = $ac_status" >&5 + echo "$as_me:12670: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14626,11 +14629,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14629: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14632: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14633: \$? = $ac_status" >&5 + echo "$as_me:14636: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -14858,11 +14861,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14861: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14864: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14865: \$? = $ac_status" >&5 + echo "$as_me:14868: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -14925,11 +14928,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14928: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14931: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14932: \$? = $ac_status" >&5 + echo "$as_me:14935: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17043,7 +17046,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure From reid at x10sys.com Mon Dec 27 03:33:57 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 03:33:57 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200412270933.DAA24402@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.162 -> 1.163 --- Log message: Don't create symbolic links for lib/System any more. It doesn't need them. --- Diffs of the changes: (+29 -175) Index: llvm/configure diff -u llvm/configure:1.162 llvm/configure:1.163 --- llvm/configure:1.162 Mon Dec 27 00:15:02 2004 +++ llvm/configure Mon Dec 27 03:33:46 2004 @@ -1766,9 +1766,6 @@ ;; esac - ac_config_links="$ac_config_links lib/System/platform:lib/System/$llvm_cv_os_type" - - case $target in sparc*-*-solaris*) target=sparcv9-sun-solaris2.8 @@ -8220,7 +8217,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext + echo '#line 10211 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10696,7 +10693,7 @@ # Provide some information about the compiler. -echo "$as_me:10699:" \ +echo "$as_me:10696:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -11753,11 +11750,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11756: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11753: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11760: \$? = $ac_status" >&5 + echo "$as_me:11757: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -11996,11 +11993,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11999: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11996: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12003: \$? = $ac_status" >&5 + echo "$as_me:12000: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12056,11 +12053,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12059: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12056: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12063: \$? = $ac_status" >&5 + echo "$as_me:12060: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14241,7 +14238,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:16532: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16539: \$? = $ac_status" >&5 + echo "$as_me:16536: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16592,11 +16589,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16595: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16592: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16599: \$? = $ac_status" >&5 + echo "$as_me:16596: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17953,7 +17950,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:18888: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18895: \$? = $ac_status" >&5 + echo "$as_me:18892: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -18948,11 +18945,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18951: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18948: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18955: \$? = $ac_status" >&5 + echo "$as_me:18952: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -20987,11 +20984,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:20990: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20987: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:20994: \$? = $ac_status" >&5 + echo "$as_me:20991: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -21230,11 +21227,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21233: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21230: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21237: \$? = $ac_status" >&5 + echo "$as_me:21234: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -21290,11 +21287,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21293: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21290: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:21297: \$? = $ac_status" >&5 + echo "$as_me:21294: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -23475,7 +23472,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <>$CONFIG_STATUS <<\_ACEOF # -# CONFIG_LINKS section. -# - -for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - - { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5 -echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;} - - if test ! -r $srcdir/$ac_source; then - { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 -echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} - { (exit 1); exit 1; }; } - fi - rm -f $ac_dest - - # Make relative symlinks. - ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dest_dir" - else - as_dir="$ac_dest_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dest_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dest_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dest_dir" != .; then - ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dest_dir";; -*) - case "$ac_dest_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dest_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dest_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - case $srcdir in - [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; - *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;; - esac - - # Try a symlink, then a hard link, then a copy. - ln -s $ac_rel_source $ac_dest 2>/dev/null || - ln $srcdir/$ac_source $ac_dest 2>/dev/null || - cp -p $srcdir/$ac_source $ac_dest || - { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&5 -echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&2;} - { (exit 1); exit 1; }; } -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF - -# # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue From reid at x10sys.com Mon Dec 27 03:33:57 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 27 Dec 2004 03:33:57 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200412270933.DAA24405@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.155 -> 1.156 --- Log message: Don't create symbolic links for lib/System any more. It doesn't need them. --- Diffs of the changes: (+0 -5) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.155 llvm/autoconf/configure.ac:1.156 --- llvm/autoconf/configure.ac:1.155 Mon Dec 27 00:15:02 2004 +++ llvm/autoconf/configure.ac Mon Dec 27 03:33:46 2004 @@ -153,11 +153,6 @@ ;; esac -dnl Make a link from lib/System/platform to lib/System/$llvm_cv_os_type -dnl This helps the #inclusion of the system specific include files -dnl for the operating system abstraction library, lib/System. -AC_CONFIG_LINKS(lib/System/platform:lib/System/$llvm_cv_os_type) - dnl If we are targetting a Sparc machine running Solaris, pretend that it is dnl V9, since that is all that we support at the moment, and autoconf will only dnl tell us we're a sparc. From jeffc at jolt-lang.org Mon Dec 27 10:49:44 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 27 Dec 2004 10:49:44 -0600 Subject: [llvm-commits] CVS: llvm/win32/System/System.vcproj Message-ID: <200412271649.KAA29255@zion.cs.uiuc.edu> Changes in directory llvm/win32/System: System.vcproj updated: 1.11 -> 1.12 --- Log message: Bring VS projects up to date with respect to recent changes --- Diffs of the changes: (+2 -41) Index: llvm/win32/System/System.vcproj diff -u llvm/win32/System/System.vcproj:1.11 llvm/win32/System/System.vcproj:1.12 --- llvm/win32/System/System.vcproj:1.11 Fri Dec 24 10:26:47 2004 +++ llvm/win32/System/System.vcproj Mon Dec 27 10:49:34 2004 @@ -43,15 +43,7 @@ + Name="VCPreBuildEventTool"/> + Name="VCPreBuildEventTool"/> - - @@ -177,9 +158,6 @@ RelativePath="..\..\include\llvm\System\Signals.h"> - - @@ -306,23 +284,6 @@ - - - - - - - - Changes in directory llvm/docs: WritingAnLLVMBackend.html updated: 1.3 -> 1.4 --- Log message: Add a note about registering the backend so it's available in LLC and LLI --- Diffs of the changes: (+13 -1) Index: llvm/docs/WritingAnLLVMBackend.html diff -u llvm/docs/WritingAnLLVMBackend.html:1.3 llvm/docs/WritingAnLLVMBackend.html:1.4 --- llvm/docs/WritingAnLLVMBackend.html:1.3 Wed Dec 1 13:12:27 2004 +++ llvm/docs/WritingAnLLVMBackend.html Mon Dec 27 13:05:16 2004 @@ -91,6 +91,18 @@ href="CodeGenerator.html#targetmachine">TargetMachine, which configures TargetData correctly +
  • Register your new target using the RegisterTarget + template:

    +
    +RegisterTarget<MyTargetMachine> M("short_name", "  Target name");
    +
    +
    Here, MyTargetMachine is the name of your implemented + subclass of TargetMachine, + short_name is the option that will be active following + -march= to select a target in llc and lli, and the last string + is the description of your target to appear in -help + listing.
  • Implement the assembly printer for the architecture. Usually, if you have described the instruction set with the assembly printer generator in mind, that @@ -237,7 +249,7 @@ Misha Brukman
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/01 19:12:27 $ + Last modified: $Date: 2004/12/27 19:05:16 $ From reid at x10sys.com Tue Dec 28 00:34:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Dec 2004 00:34:22 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200412280634.AAA10685@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.163 -> 1.164 --- Log message: Make the 64-bit x86 target named "x86_64" instead of "AMD64". --- Diffs of the changes: (+2 -2) Index: llvm/configure diff -u llvm/configure:1.163 llvm/configure:1.164 --- llvm/configure:1.163 Mon Dec 27 03:33:46 2004 +++ llvm/configure Tue Dec 28 00:34:10 2004 @@ -1779,7 +1779,7 @@ else case $target in i?86-*) llvm_cv_target_arch="x86" ;; - amd64-* | x86_64-*) llvm_cv_target_arch="AMD64" ;; + amd64-* | x86_64-*) llvm_cv_target_arch="X86_64" ;; sparc*-*) llvm_cv_target_arch="Sparc" ;; powerpc*-*) llvm_cv_target_arch="PowerPC" ;; *) llvm_cv_target_arch="Unknown" ;; @@ -2991,7 +2991,7 @@ ;; PowerPC) JIT=TARGET_HAS_JIT=1 ;; - AMD64) JIT= + x86_64) JIT= ;; *) JIT= ;; From reid at x10sys.com Tue Dec 28 00:34:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Dec 2004 00:34:22 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200412280634.AAA10682@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.156 -> 1.157 --- Log message: Make the 64-bit x86 target named "x86_64" instead of "AMD64". --- Diffs of the changes: (+2 -2) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.156 llvm/autoconf/configure.ac:1.157 --- llvm/autoconf/configure.ac:1.156 Mon Dec 27 03:33:46 2004 +++ llvm/autoconf/configure.ac Tue Dec 28 00:34:11 2004 @@ -167,7 +167,7 @@ AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch], [case $target in i?86-*) llvm_cv_target_arch="x86" ;; - amd64-* | x86_64-*) llvm_cv_target_arch="AMD64" ;; + amd64-* | x86_64-*) llvm_cv_target_arch="X86_64" ;; sparc*-*) llvm_cv_target_arch="Sparc" ;; powerpc*-*) llvm_cv_target_arch="PowerPC" ;; *) llvm_cv_target_arch="Unknown" ;; @@ -211,7 +211,7 @@ x86) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;; Sparc) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;; PowerPC) AC_SUBST(JIT,[[TARGET_HAS_JIT=1]]) ;; - AMD64) AC_SUBST(JIT,[[]]) ;; + x86_64) AC_SUBST(JIT,[[]]) ;; *) AC_SUBST(JIT,[[]]) ;; esac fi From reid at x10sys.com Tue Dec 28 01:56:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Dec 2004 01:56:25 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200412280756.BAA11322@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.157 -> 1.158 --- Log message: Make the x86_64 target names match between def and use. Thanks Misha. --- Diffs of the changes: (+1 -1) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.157 llvm/autoconf/configure.ac:1.158 --- llvm/autoconf/configure.ac:1.157 Tue Dec 28 00:34:11 2004 +++ llvm/autoconf/configure.ac Tue Dec 28 01:56:14 2004 @@ -167,7 +167,7 @@ AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch], [case $target in i?86-*) llvm_cv_target_arch="x86" ;; - amd64-* | x86_64-*) llvm_cv_target_arch="X86_64" ;; + amd64-* | x86_64-*) llvm_cv_target_arch="x86_64" ;; sparc*-*) llvm_cv_target_arch="Sparc" ;; powerpc*-*) llvm_cv_target_arch="PowerPC" ;; *) llvm_cv_target_arch="Unknown" ;; From reid at x10sys.com Tue Dec 28 01:56:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Dec 2004 01:56:25 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200412280756.BAA11325@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.164 -> 1.165 --- Log message: Make the x86_64 target names match between def and use. Thanks Misha. --- Diffs of the changes: (+1 -1) Index: llvm/configure diff -u llvm/configure:1.164 llvm/configure:1.165 --- llvm/configure:1.164 Tue Dec 28 00:34:10 2004 +++ llvm/configure Tue Dec 28 01:56:14 2004 @@ -1779,7 +1779,7 @@ else case $target in i?86-*) llvm_cv_target_arch="x86" ;; - amd64-* | x86_64-*) llvm_cv_target_arch="X86_64" ;; + amd64-* | x86_64-*) llvm_cv_target_arch="x86_64" ;; sparc*-*) llvm_cv_target_arch="Sparc" ;; powerpc*-*) llvm_cv_target_arch="PowerPC" ;; *) llvm_cv_target_arch="Unknown" ;; From reid at x10sys.com Tue Dec 28 01:59:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Dec 2004 01:59:33 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412280759.BAA11341@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.280 -> 1.281 --- Log message: Correct the name of the variable for the LLVM examples directory so that parallel builds don't attempt to create it twice. --- Diffs of the changes: (+1 -1) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.280 llvm/Makefile.rules:1.281 --- llvm/Makefile.rules:1.280 Mon Dec 27 02:50:27 2004 +++ llvm/Makefile.rules Tue Dec 28 01:59:22 2004 @@ -217,7 +217,7 @@ ExmplDir := $(BUILD_OBJ_ROOT)/$(BuildMode)/examples LLVMLibDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/lib LLVMToolDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/bin -LExmplDir := $(LLVM_OBJ_ROOT)/$(BuildMode)/examples +LLVMExmplDir:= $(LLVM_OBJ_ROOT)/$(BuildMode)/examples CFERuntimeLibDir := $(LLVMGCCDIR)/lib #-------------------------------------------------------------------- From reid at x10sys.com Tue Dec 28 19:20:35 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Dec 2004 19:20:35 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveReader.cpp Message-ID: <200412290120.TAA12283@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveReader.cpp updated: 1.37 -> 1.38 --- Log message: Remove potential platform portability issue with size of "int". --- Diffs of the changes: (+3 -1) Index: llvm/lib/Bytecode/Archive/ArchiveReader.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.37 llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.38 --- llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.37 Sun Dec 19 21:23:46 2004 +++ llvm/lib/Bytecode/Archive/ArchiveReader.cpp Tue Dec 28 19:20:24 2004 @@ -190,7 +190,9 @@ member->path.setFile(pathname); member->info.fileSize = MemberSize; member->info.modTime.fromEpochTime(atoi(Hdr->date)); - sscanf(Hdr->mode, "%o", &(member->info.mode)); + unsigned int mode; + sscanf(Hdr->mode, "%o", &mode); + member->info.mode = mode; member->info.user = atoi(Hdr->uid); member->info.group = atoi(Hdr->gid); member->flags = flags; From reid at x10sys.com Tue Dec 28 21:16:51 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Dec 2004 21:16:51 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c Message-ID: <200412290316.VAA14530@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2003-01-30-UnionInit.c updated: 1.4 -> 1.5 --- Log message: XFAIL this everywhere, the CFE doesn't support bitfield initialization. --- Diffs of the changes: (+1 -1) Index: llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c diff -u llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c:1.4 llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c:1.5 --- llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c:1.4 Mon Nov 22 13:11:39 2004 +++ llvm/test/Regression/CFrontend/2003-01-30-UnionInit.c Tue Dec 28 21:16:40 2004 @@ -1,6 +1,6 @@ // RUN: %llvmgcc -S %s -o /dev/null -// XFAIL: linux,sun,darwin +// XFAIL: * union foo { struct { char A, B; } X; From reid at x10sys.com Tue Dec 28 21:17:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Dec 2004 21:17:40 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c Message-ID: <200412290317.VAA14553@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2003-08-30-AggregateInitializer.c updated: 1.4 -> 1.5 --- Log message: XFAIL this test everywhere. --- Diffs of the changes: (+2 -1) Index: llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c diff -u llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c:1.4 llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c:1.5 --- llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c:1.4 Mon Nov 22 13:11:40 2004 +++ llvm/test/Regression/CFrontend/2003-08-30-AggregateInitializer.c Tue Dec 28 21:17:30 2004 @@ -1,6 +1,7 @@ // RUN: %llvmgcc -S %s -o /dev/null -// XFAIL: linux,sun,darwin +// XFAIL: * + struct istruct { unsigned char C; }; From lattner at cs.uiuc.edu Tue Dec 28 21:57:40 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 28 Dec 2004 21:57:40 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll Message-ID: <200412290357.iBT3veIv020455@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/CBackend: 2004-12-28-LogicalConstantExprs.ll added (r1.1) --- Log message: new testcase for PR490: http://llvm.cs.uiuc.edu/PR490 --- Diffs of the changes: (+5 -0) Index: llvm/test/Regression/CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll diff -c /dev/null llvm/test/Regression/CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll:1.1 *** /dev/null Tue Dec 28 21:57:36 2004 --- llvm/test/Regression/CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll Tue Dec 28 21:57:25 2004 *************** *** 0 **** --- 1,5 ---- + ; RUN: llvm-as < %s | llc -march=c + + int %foo() { + ret int and (int 123456, int cast (int()* %foo to int)) + } From lattner at cs.uiuc.edu Tue Dec 28 22:00:21 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 28 Dec 2004 22:00:21 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200412290400.iBT40LOk020475@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.216 -> 1.217 --- Log message: Fix PR490: http://llvm.cs.uiuc.edu/PR490 Fix testcase CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll --- Diffs of the changes: (+6 -0) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.216 llvm/lib/Target/CBackend/Writer.cpp:1.217 --- llvm/lib/Target/CBackend/Writer.cpp:1.216 Wed Dec 15 17:13:15 2004 +++ llvm/lib/Target/CBackend/Writer.cpp Tue Dec 28 22:00:09 2004 @@ -493,6 +493,9 @@ case Instruction::Mul: case Instruction::Div: case Instruction::Rem: + case Instruction::And: + case Instruction::Or: + case Instruction::Xor: case Instruction::SetEQ: case Instruction::SetNE: case Instruction::SetLT: @@ -509,6 +512,9 @@ case Instruction::Mul: Out << " * "; break; case Instruction::Div: Out << " / "; break; case Instruction::Rem: Out << " % "; break; + case Instruction::And: Out << " & "; break; + case Instruction::Or: Out << " | "; break; + case Instruction::Xor: Out << " ^ "; break; case Instruction::SetEQ: Out << " == "; break; case Instruction::SetNE: Out << " != "; break; case Instruction::SetLT: Out << " < "; break; From lattner at cs.uiuc.edu Tue Dec 28 22:03:35 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 28 Dec 2004 22:03:35 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200412290403.iBT43Zgo020501@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.284 -> 1.285 --- Log message: Bug fixed --- Diffs of the changes: (+3 -2) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.284 llvm/docs/ReleaseNotes.html:1.285 --- llvm/docs/ReleaseNotes.html:1.284 Sun Dec 12 11:20:23 2004 +++ llvm/docs/ReleaseNotes.html Tue Dec 28 22:03:23 2004 @@ -132,7 +132,8 @@

    Bugs fixed in the LLVM Core:

      -
    1. +
    2. [cbackend] Logical constant + expressions (and/or/xor) not implemented

    Bugs in the C/C++ front-end:

    @@ -560,7 +561,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/12 17:20:23 $ + Last modified: $Date: 2004/12/29 04:03:23 $ From lattner at cs.uiuc.edu Tue Dec 28 22:05:17 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 28 Dec 2004 22:05:17 -0600 Subject: [llvm-commits] CVS: llvm-www/releases/1.4/docs/ReleaseNotes.html Message-ID: <200412290405.iBT45HYU020523@apoc.cs.uiuc.edu> Changes in directory llvm-www/releases/1.4/docs: ReleaseNotes.html updated: 1.4 -> 1.5 --- Log message: Bug fixed --- Diffs of the changes: (+6 -1) Index: llvm-www/releases/1.4/docs/ReleaseNotes.html diff -u llvm-www/releases/1.4/docs/ReleaseNotes.html:1.4 llvm-www/releases/1.4/docs/ReleaseNotes.html:1.5 --- llvm-www/releases/1.4/docs/ReleaseNotes.html:1.4 Sun Dec 12 11:21:10 2004 +++ llvm-www/releases/1.4/docs/ReleaseNotes.html Tue Dec 28 22:05:05 2004 @@ -685,6 +685,11 @@ supported. This should not affect LLVM produced by the C or C++ frontends.
  • +
      +

      Fixed in LLVM 1.5

      + @@ -720,7 +725,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/12/12 17:21:10 $ + Last modified: $Date: 2004/12/29 04:05:05 $ From brukman at cs.uiuc.edu Tue Dec 28 22:08:52 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Tue, 28 Dec 2004 22:08:52 -0600 Subject: [llvm-commits] CVS: llvm-www/releases/1.4/docs/ReleaseNotes.html Message-ID: <200412290408.WAA15401@zion.cs.uiuc.edu> Changes in directory llvm-www/releases/1.4/docs: ReleaseNotes.html updated: 1.5 -> 1.6 --- Log message: Properly terminate a list. --- Diffs of the changes: (+3 -1) Index: llvm-www/releases/1.4/docs/ReleaseNotes.html diff -u llvm-www/releases/1.4/docs/ReleaseNotes.html:1.5 llvm-www/releases/1.4/docs/ReleaseNotes.html:1.6 --- llvm-www/releases/1.4/docs/ReleaseNotes.html:1.5 Tue Dec 28 22:05:05 2004 +++ llvm-www/releases/1.4/docs/ReleaseNotes.html Tue Dec 28 22:08:42 2004 @@ -685,6 +685,8 @@ supported. This should not affect LLVM produced by the C or C++ frontends. +
    +

      Fixed in LLVM 1.5

        @@ -725,7 +727,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
        - Last modified: $Date: 2004/12/29 04:05:05 $ + Last modified: $Date: 2004/12/29 04:08:42 $ From lattner at cs.uiuc.edu Tue Dec 28 22:10:14 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 28 Dec 2004 22:10:14 -0600 Subject: [llvm-commits] CVS: llvm-www/releases/1.4/docs/ReleaseNotes.html Message-ID: <200412290410.iBT4AEKL020556@apoc.cs.uiuc.edu> Changes in directory llvm-www/releases/1.4/docs: ReleaseNotes.html updated: 1.6 -> 1.7 --- Log message: Properly terminate a list :) --- Diffs of the changes: (+1 -2) Index: llvm-www/releases/1.4/docs/ReleaseNotes.html diff -u llvm-www/releases/1.4/docs/ReleaseNotes.html:1.6 llvm-www/releases/1.4/docs/ReleaseNotes.html:1.7 --- llvm-www/releases/1.4/docs/ReleaseNotes.html:1.6 Tue Dec 28 22:08:42 2004 +++ llvm-www/releases/1.4/docs/ReleaseNotes.html Tue Dec 28 22:10:04 2004 @@ -687,7 +687,6 @@
      -

        Fixed in LLVM 1.5

        • [cbackend] Logical constant @@ -727,7 +726,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
          - Last modified: $Date: 2004/12/29 04:08:42 $ + Last modified: $Date: 2004/12/29 04:10:04 $ From lattner at cs.uiuc.edu Tue Dec 28 22:27:41 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 28 Dec 2004 22:27:41 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll Message-ID: <200412290427.iBT4Rf2Y020648@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DeadStoreElimination: 2004-12-28-PartialStore.ll added (r1.1) --- Log message: New testcase for PR491: http://llvm.cs.uiuc.edu/PR491 --- Diffs of the changes: (+10 -0) Index: llvm/test/Regression/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll diff -c /dev/null llvm/test/Regression/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll:1.1 *** /dev/null Tue Dec 28 22:27:36 2004 --- llvm/test/Regression/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll Tue Dec 28 22:27:26 2004 *************** *** 0 **** --- 1,10 ---- + ; RUN: llvm-as < %s | opt -dse | llvm-dis | grep 'store int 1234567' + + int %test() { + %V = alloca int + store int 1234567, int* %V + %V2 = cast int* %V to sbyte* + store sbyte 0, sbyte* %V2 + %X = load int* %V + ret int %X + } From lattner at cs.uiuc.edu Tue Dec 28 22:35:44 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 28 Dec 2004 22:35:44 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/DeadStoreElimination/PartialStore.ll 2004-12-28-PartialStore.ll Message-ID: <200412290435.iBT4ZiVQ021338@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/DeadStoreElimination: PartialStore.ll added (r1.1) 2004-12-28-PartialStore.ll updated: 1.1 -> 1.2 --- Log message: Add a comment, add a new testcase --- Diffs of the changes: (+13 -0) Index: llvm/test/Regression/Transforms/DeadStoreElimination/PartialStore.ll diff -c /dev/null llvm/test/Regression/Transforms/DeadStoreElimination/PartialStore.ll:1.1 *** /dev/null Tue Dec 28 22:35:40 2004 --- llvm/test/Regression/Transforms/DeadStoreElimination/PartialStore.ll Tue Dec 28 22:35:30 2004 *************** *** 0 **** --- 1,11 ---- + ; RUN: llvm-as < %s | opt -dse | llvm-dis | not grep 'store sbyte' + ; Ensure that the dead store is deleted in this case. It is wholely + ; overwritten by the second store. + int %test() { + %V = alloca int + %V2 = cast int* %V to sbyte* + store sbyte 0, sbyte* %V2 + store int 1234567, int* %V + %X = load int* %V + ret int %X + } Index: llvm/test/Regression/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll diff -u llvm/test/Regression/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll:1.1 llvm/test/Regression/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll:1.2 --- llvm/test/Regression/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll:1.1 Tue Dec 28 22:27:26 2004 +++ llvm/test/Regression/Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll Tue Dec 28 22:35:30 2004 @@ -1,5 +1,7 @@ ; RUN: llvm-as < %s | opt -dse | llvm-dis | grep 'store int 1234567' +; Do not delete stores that are only partially killed. + int %test() { %V = alloca int store int 1234567, int* %V From lattner at cs.uiuc.edu Tue Dec 28 22:36:14 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 28 Dec 2004 22:36:14 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Message-ID: <200412290436.iBT4aEEO021349@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: DeadStoreElimination.cpp updated: 1.8 -> 1.9 --- Log message: Fix PR491: http://llvm.cs.uiuc.edu/PR491 and testcase Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll --- Diffs of the changes: (+2 -1) Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.8 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.9 --- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.8 Sun Nov 28 14:44:37 2004 +++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp Tue Dec 28 22:36:02 2004 @@ -111,7 +111,8 @@ if (AliasSet *AS = KillLocs.getAliasSetForPointerIfExists(Ptr, ValSize)) for (AliasSet::iterator ASI = AS->begin(), E = AS->end(); ASI != E; ++ASI) - if (AA.alias(ASI.getPointer(), ASI.getSize(), Ptr, ValSize) + if (ASI.getSize() >= ValSize && // Overwriting all of this store. + AA.alias(ASI.getPointer(), ASI.getSize(), Ptr, ValSize) == AliasAnalysis::MustAlias) { // If we found a must alias in the killed set, then this store really // is dead. Remember that the various operands of the store now have From lattner at cs.uiuc.edu Tue Dec 28 22:40:05 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 28 Dec 2004 22:40:05 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200412290440.iBT4e5Sh021569@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.285 -> 1.286 --- Log message: Bug fixed --- Diffs of the changes: (+3 -1) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.285 llvm/docs/ReleaseNotes.html:1.286 --- llvm/docs/ReleaseNotes.html:1.285 Tue Dec 28 22:03:23 2004 +++ llvm/docs/ReleaseNotes.html Tue Dec 28 22:39:50 2004 @@ -134,6 +134,8 @@
          1. [cbackend] Logical constant expressions (and/or/xor) not implemented
          2. +
          3. [dse] DSE deletes stores that + are partially overwritten by smaller stores

          Bugs in the C/C++ front-end:

          @@ -561,7 +563,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
          - Last modified: $Date: 2004/12/29 04:03:23 $ + Last modified: $Date: 2004/12/29 04:39:50 $ From lattner at cs.uiuc.edu Tue Dec 28 22:40:57 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 28 Dec 2004 22:40:57 -0600 Subject: [llvm-commits] CVS: llvm-www/releases/1.4/docs/ReleaseNotes.html Message-ID: <200412290440.iBT4evIE021590@apoc.cs.uiuc.edu> Changes in directory llvm-www/releases/1.4/docs: ReleaseNotes.html updated: 1.7 -> 1.8 --- Log message: Bug found --- Diffs of the changes: (+8 -1) Index: llvm-www/releases/1.4/docs/ReleaseNotes.html diff -u llvm-www/releases/1.4/docs/ReleaseNotes.html:1.7 llvm-www/releases/1.4/docs/ReleaseNotes.html:1.8 --- llvm-www/releases/1.4/docs/ReleaseNotes.html:1.7 Tue Dec 28 22:10:04 2004 +++ llvm-www/releases/1.4/docs/ReleaseNotes.html Tue Dec 28 22:40:47 2004 @@ -390,6 +390,13 @@ only affects targets whose setjmp/longjmp libraries do not save and restore the entire register file.
        + +

        Fixed in LLVM 1.5

        + + @@ -726,7 +733,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
        - Last modified: $Date: 2004/12/29 04:10:04 $ + Last modified: $Date: 2004/12/29 04:40:47 $ From reid at x10sys.com Tue Dec 28 23:47:15 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 28 Dec 2004 23:47:15 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/m4/path_tclsh.m4 Message-ID: <200412290547.XAA16640@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: path_tclsh.m4 updated: 1.3 -> 1.4 --- Log message: Fix one of the names to not have a . in front of it. --- Diffs of the changes: (+1 -1) Index: llvm/autoconf/m4/path_tclsh.m4 diff -u llvm/autoconf/m4/path_tclsh.m4:1.3 llvm/autoconf/m4/path_tclsh.m4:1.4 --- llvm/autoconf/m4/path_tclsh.m4:1.3 Thu Dec 2 01:29:17 2004 +++ llvm/autoconf/m4/path_tclsh.m4 Tue Dec 28 23:47:04 2004 @@ -24,7 +24,7 @@ dnl see if one is installed if test x"${ac_cv_path_tclsh}" = x ; then AC_MSG_RESULT(none) - AC_PATH_PROGS([TCLSH],[tclsh8.4 tclsh8.4.8 tclsh8.4.7 tclsh8.4.6 tclsh8.4.5 tclsh8.4.4 tclsh8.4.3 tclsh8.4.2 tclsh8.4.1 tclsh8.4.0 tclsh8.3 tclsh8.3.5 tclsh8.3.4 tclsh8.3.3 .tclsh8.3.2 tclsh8.3.1 tclsh8.3.0 tclsh]) + AC_PATH_PROGS([TCLSH],[tclsh8.4 tclsh8.4.8 tclsh8.4.7 tclsh8.4.6 tclsh8.4.5 tclsh8.4.4 tclsh8.4.3 tclsh8.4.2 tclsh8.4.1 tclsh8.4.0 tclsh8.3 tclsh8.3.5 tclsh8.3.4 tclsh8.3.3 tclsh8.3.2 tclsh8.3.1 tclsh8.3.0 tclsh]) if test x"${TCLSH}" = x ; then ac_cv_path_tclsh=''; else From reid at x10sys.com Wed Dec 29 00:59:47 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 00:59:47 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/m4/need_dev_zero_for_mmap.m4 Message-ID: <200412290659.AAA18866@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: need_dev_zero_for_mmap.m4 updated: 1.1 -> 1.2 --- Log message: Fix a Bourne Shell syntax error in a test --- Diffs of the changes: (+1 -1) Index: llvm/autoconf/m4/need_dev_zero_for_mmap.m4 diff -u llvm/autoconf/m4/need_dev_zero_for_mmap.m4:1.1 llvm/autoconf/m4/need_dev_zero_for_mmap.m4:1.2 --- llvm/autoconf/m4/need_dev_zero_for_mmap.m4:1.1 Mon Dec 27 00:14:48 2004 +++ llvm/autoconf/m4/need_dev_zero_for_mmap.m4 Wed Dec 29 00:59:36 2004 @@ -5,7 +5,7 @@ AC_DEFUN([AC_NEED_DEV_ZERO_FOR_MMAP], [AC_CACHE_CHECK([if /dev/zero is needed for mmap], ac_cv_need_dev_zero_for_mmap, -[if test "$llvm_cv_os_type" == "Interix" ; then +[if test "$llvm_cv_os_type" = "Interix" ; then ac_cv_need_dev_zero_for_mmap=yes else ac_cv_need_dev_zero_for_mmap=no From reid at x10sys.com Wed Dec 29 01:08:08 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 01:08:08 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200412290708.BAA19048@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.158 -> 1.159 --- Log message: * Fix a bug in an m4 macro that used an incorrect test operator * Add CAN_DLOPEN_SELF so we can determine if dlopen(0) will open the program or not. * Correct a warning messages to be a little more specific on what it checks --- Diffs of the changes: (+6 -1) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.158 llvm/autoconf/configure.ac:1.159 --- llvm/autoconf/configure.ac:1.158 Tue Dec 28 01:56:14 2004 +++ llvm/autoconf/configure.ac Wed Dec 29 01:07:57 2004 @@ -297,6 +297,11 @@ AC_LIB_LTDL AC_PROG_LIBTOOL +if test "$lt_cv_dlopen_self" = "yes" ; then + AC_DEFINE([CAN_DLOPEN_SELF],[1], + [Define if dlopen(0) will open the symbols of the program]) +fi + dnl Check if we know how to tell etags we are using C++: etags_version=`$ETAGS --version 2>&1` case "$etags_version" in @@ -465,7 +470,7 @@ if test "$ac_cv_func_mmap_fixed_mapped" = "no" then - AC_MSG_WARN([mmap() required but not found]) + AC_MSG_WARN([mmap() of a fixed address required but not supported]) fi if test "$ac_cv_func_mmap_file" = "no" then From reid at x10sys.com Wed Dec 29 01:08:08 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 01:08:08 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200412290708.BAA19045@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.44 -> 1.45 --- Log message: * Fix a bug in an m4 macro that used an incorrect test operator * Add CAN_DLOPEN_SELF so we can determine if dlopen(0) will open the program or not. * Correct a warning messages to be a little more specific on what it checks --- Diffs of the changes: (+3 -0) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.44 llvm/include/llvm/Config/config.h.in:1.45 --- llvm/include/llvm/Config/config.h.in:1.44 Mon Dec 27 00:15:02 2004 +++ llvm/include/llvm/Config/config.h.in Wed Dec 29 01:07:57 2004 @@ -1,5 +1,8 @@ /* include/llvm/Config/config.h.in. Generated from autoconf/configure.ac by autoheader. */ +/* Define if dlopen(0) will open the symbols of the program */ +#undef CAN_DLOPEN_SELF + /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ From reid at x10sys.com Wed Dec 29 01:08:09 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 01:08:09 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200412290708.BAA19051@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.165 -> 1.166 --- Log message: * Fix a bug in an m4 macro that used an incorrect test operator * Add CAN_DLOPEN_SELF so we can determine if dlopen(0) will open the program or not. * Correct a warning messages to be a little more specific on what it checks --- Diffs of the changes: (+12 -4) Index: llvm/configure diff -u llvm/configure:1.165 llvm/configure:1.166 --- llvm/configure:1.165 Tue Dec 28 01:56:14 2004 +++ llvm/configure Wed Dec 29 01:07:57 2004 @@ -5514,7 +5514,7 @@ if test x"${ac_cv_path_tclsh}" = x ; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 - for ac_prog in tclsh8.4 tclsh8.4.8 tclsh8.4.7 tclsh8.4.6 tclsh8.4.5 tclsh8.4.4 tclsh8.4.3 tclsh8.4.2 tclsh8.4.1 tclsh8.4.0 tclsh8.3 tclsh8.3.5 tclsh8.3.4 tclsh8.3.3 .tclsh8.3.2 tclsh8.3.1 tclsh8.3.0 tclsh + for ac_prog in tclsh8.4 tclsh8.4.8 tclsh8.4.7 tclsh8.4.6 tclsh8.4.5 tclsh8.4.4 tclsh8.4.3 tclsh8.4.2 tclsh8.4.1 tclsh8.4.0 tclsh8.3 tclsh8.3.5 tclsh8.3.4 tclsh8.3.3 tclsh8.3.2 tclsh8.3.1 tclsh8.3.0 tclsh do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -24589,6 +24589,14 @@ +if test "$lt_cv_dlopen_self" = "yes" ; then + +cat >>confdefs.h <<\_ACEOF +#define CAN_DLOPEN_SELF 1 +_ACEOF + +fi + etags_version=`$ETAGS --version 2>&1` case "$etags_version" in *Eexuberant*) ETAGSFLAGS="--language-force=c++" ;; @@ -29852,7 +29860,7 @@ if test "${ac_cv_need_dev_zero_for_mmap+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$llvm_cv_os_type" == "Interix" ; then + if test "$llvm_cv_os_type" = "Interix" ; then ac_cv_need_dev_zero_for_mmap=yes else ac_cv_need_dev_zero_for_mmap=no @@ -29969,8 +29977,8 @@ if test "$ac_cv_func_mmap_fixed_mapped" = "no" then - { echo "$as_me:$LINENO: WARNING: mmap() required but not found" >&5 -echo "$as_me: WARNING: mmap() required but not found" >&2;} + { echo "$as_me:$LINENO: WARNING: mmap() of a fixed address required but not supported" >&5 +echo "$as_me: WARNING: mmap() of a fixed address required but not supported" >&2;} fi if test "$ac_cv_func_mmap_file" = "no" then From reid at x10sys.com Wed Dec 29 01:28:32 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 01:28:32 -0600 Subject: [llvm-commits] CVS: llvm-test/configure Message-ID: <200412290728.BAA19276@zion.cs.uiuc.edu> Changes in directory llvm-test: configure updated: 1.14 -> 1.15 --- Log message: * Remove useless Python version checks. * Update to autoconf 2.59 style usage. --- Diffs of the changes: (+66 -82) Index: llvm-test/configure diff -u llvm-test/configure:1.14 llvm-test/configure:1.15 --- llvm-test/configure:1.14 Thu Nov 4 10:54:14 2004 +++ llvm-test/configure Wed Dec 29 01:28:21 2004 @@ -2973,33 +2973,33 @@ - echo "$as_me:$LINENO: checking for GNU make" >&5 +echo "$as_me:$LINENO: checking for GNU make" >&5 echo $ECHO_N "checking for GNU make... $ECHO_C" >&6 -if test "${_cv_gnu_make_command+set}" = set; then +if test "${llvm_cv_gnu_make_command+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - _cv_gnu_make_command='' ; - for a in "$MAKE" make gmake gnumake ; do - if test -z "$a" ; then continue ; fi ; - if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then - _cv_gnu_make_command=$a ; - break; - fi - done ; - -fi -echo "$as_me:$LINENO: result: $_cv_gnu_make_command" >&5 -echo "${ECHO_T}$_cv_gnu_make_command" >&6 ; - if test "x$_cv_gnu_make_command" != "x" ; then - ifGNUmake='' ; - else - ifGNUmake='#' ; - echo "$as_me:$LINENO: result: \"Not found\"" >&5 + llvm_cv_gnu_make_command='' + for a in "$MAKE" make gmake gnumake ; do + if test -z "$a" ; then continue ; fi ; + if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) + then + llvm_cv_gnu_make_command=$a ; + break; + fi + done +fi +echo "$as_me:$LINENO: result: $llvm_cv_gnu_make_command" >&5 +echo "${ECHO_T}$llvm_cv_gnu_make_command" >&6 + if test "x$llvm_cv_gnu_make_command" != "x" ; then + ifGNUmake='' ; + else + ifGNUmake='#' ; + echo "$as_me:$LINENO: result: \"Not found\"" >&5 echo "${ECHO_T}\"Not found\"" >&6; - fi + fi -if test -z "$_cv_gnu_make_command" +if test -z "$llvm_cv_gnu_make_command" then { { echo "$as_me:$LINENO: error: GNU Make required but not found" >&5 echo "$as_me: error: GNU Make required but not found" >&2;} @@ -3301,7 +3301,7 @@ echo "$as_me:$LINENO: checking " >&5 echo $ECHO_N "checking ... $ECHO_C" >&6 -if test "${ac_cv_has_bison+set}" = set; then +if test "${llvm_cv_has_bison+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_prog in 'bison -y' byacc @@ -3345,10 +3345,9 @@ done test -n "$YACC" || YACC="yacc" - fi -echo "$as_me:$LINENO: result: $ac_cv_has_bison" >&5 -echo "${ECHO_T}$ac_cv_has_bison" >&6 +echo "$as_me:$LINENO: result: $llvm_cv_has_bison" >&5 +echo "${ECHO_T}$llvm_cv_has_bison" >&6 if test "$YACC" != "bison -y"; then { { echo "$as_me:$LINENO: error: bison not found but required" >&5 echo "$as_me: error: bison not found but required" >&2;} @@ -3357,7 +3356,6 @@ BISON=bison fi - # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -3963,7 +3961,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3966 "configure"' > conftest.$ac_ext + echo '#line 3964 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4837,7 +4835,7 @@ # Provide some information about the compiler. -echo "$as_me:4840:" \ +echo "$as_me:4838:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -5894,11 +5892,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5897: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5895: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5901: \$? = $ac_status" >&5 + echo "$as_me:5899: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6137,11 +6135,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6140: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6138: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6144: \$? = $ac_status" >&5 + echo "$as_me:6142: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6197,11 +6195,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6200: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6198: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6204: \$? = $ac_status" >&5 + echo "$as_me:6202: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8382,7 +8380,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10674: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10680: \$? = $ac_status" >&5 + echo "$as_me:10678: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10733,11 +10731,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10736: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10734: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10740: \$? = $ac_status" >&5 + echo "$as_me:10738: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12094,7 +12092,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13030: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13036: \$? = $ac_status" >&5 + echo "$as_me:13034: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13089,11 +13087,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13092: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13090: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13096: \$? = $ac_status" >&5 + echo "$as_me:13094: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15128,11 +15126,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15131: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15129: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15135: \$? = $ac_status" >&5 + echo "$as_me:15133: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15371,11 +15369,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15374: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15372: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15378: \$? = $ac_status" >&5 + echo "$as_me:15376: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15431,11 +15429,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15434: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15432: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15438: \$? = $ac_status" >&5 + echo "$as_me:15436: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17616,7 +17614,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 + { echo "$as_me:$LINENO: WARNING: Python is required for the test suite, but it was not found" >&5 echo "$as_me: WARNING: Python is required for the test suite, but it was not found" >&2;} fi -pyversion=`$PYTHON -V 2>&1 | cut -d\ -f2` -pymajor=`echo $pyversion | cut -d. -f1` -pyminor=`echo $pyversion | cut -d. -f2` - -if test "$pymajor" -ge "2" -then - if test "$pymajor" -eq "2" - then - if test "$pyminor" -lt "2" - then - { echo "$as_me:$LINENO: WARNING: QMTest requires Python 2.2 or later" >&5 -echo "$as_me: WARNING: QMTest requires Python 2.2 or later" >&2;} - fi - fi -else - { echo "$as_me:$LINENO: WARNING: QMTest requires Python 2.2 or later" >&5 -echo "$as_me: WARNING: QMTest requires Python 2.2 or later" >&2;} -fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 @@ -19035,10 +19015,12 @@ fi - - echo "$as_me:$LINENO: checking for compiler -Wl,-R option" >&5 +echo "$as_me:$LINENO: checking for compiler -Wl,-R option" >&5 echo $ECHO_N "checking for compiler -Wl,-R option... $ECHO_C" >&6 - ac_ext=c +if test "${llvm_cv_link_use_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -19083,12 +19065,12 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_link_use_r=yes + llvm_cv_link_use_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_link_use_r=no +llvm_cv_link_use_r=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -19099,10 +19081,11 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - echo "$as_me:$LINENO: result: $ac_cv_link_use_r" >&5 -echo "${ECHO_T}$ac_cv_link_use_r" >&6 - if test "$ac_cv_link_use_r" = yes - then + +fi +echo "$as_me:$LINENO: result: $llvm_cv_link_use_r" >&5 +echo "${ECHO_T}$llvm_cv_link_use_r" >&6 +if test "$llvm_cv_link_use_r" = yes ; then cat >>confdefs.h <<\_ACEOF #define HAVE_LINK_R 1 @@ -19649,6 +19632,7 @@ fi ac_config_files="$ac_config_files Makefile.config" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure From reid at x10sys.com Wed Dec 29 01:28:32 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 01:28:32 -0600 Subject: [llvm-commits] CVS: llvm-test/autoconf/configure.ac Message-ID: <200412290728.BAA19273@zion.cs.uiuc.edu> Changes in directory llvm-test/autoconf: configure.ac updated: 1.13 -> 1.14 --- Log message: * Remove useless Python version checks. * Update to autoconf 2.59 style usage. --- Diffs of the changes: (+8 -24) Index: llvm-test/autoconf/configure.ac diff -u llvm-test/autoconf/configure.ac:1.13 llvm-test/autoconf/configure.ac:1.14 --- llvm-test/autoconf/configure.ac:1.13 Thu Nov 4 10:54:19 2004 +++ llvm-test/autoconf/configure.ac Wed Dec 29 01:28:21 2004 @@ -47,10 +47,10 @@ dnl ************************************************************************** dnl Location of LLVM source code -AC_ARG_WITH(llvmsrc,AC_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),AC_SUBST(LLVM_SRC,[$withval]),AC_SUBST(LLVM_SRC,[`cd ${srcdir}/../..; pwd`])) +AC_ARG_WITH(llvmsrc,AS_HELP_STRING(--with-llvmsrc,Location of LLVM Source Code),AC_SUBST(LLVM_SRC,[$withval]),AC_SUBST(LLVM_SRC,[`cd ${srcdir}/../..; pwd`])) dnl Location of LLVM object code -AC_ARG_WITH(llvmobj,AC_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`])) +AC_ARG_WITH(llvmobj,AS_HELP_STRING(--with-llvmobj,Location of LLVM Object Code),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`])) dnl ************************************************************************** dnl * Check for things needed by the test suite programs @@ -65,7 +65,7 @@ dnl Check for GNU Make. We use its extensions too, so don't build without it AC_CHECK_GNU_MAKE -if test -z "$_cv_gnu_make_command" +if test -z "$llvm_cv_gnu_make_command" then AC_MSG_ERROR([GNU Make required but not found]) fi @@ -78,24 +78,7 @@ AC_PATH_PROG(PYTHON,[python],[true python]) if test "$PYTHON" = "false" then - AC_MSG_WARN([Python is required for the test suite, but it was not found]) -fi -dnl Verify that the version of python available is high enough for qmtest -pyversion=`$PYTHON -V 2>&1 | cut -d\ -f2` -pymajor=`echo $pyversion | cut -d. -f1` -pyminor=`echo $pyversion | cut -d. -f2` - -if test "$pymajor" -ge "2" -then - if test "$pymajor" -eq "2" - then - if test "$pyminor" -lt "2" - then - AC_MSG_WARN([QMTest requires Python 2.2 or later]) - fi - fi -else - AC_MSG_WARN([QMTest requires Python 2.2 or later]) + AC_MSG_WARN([Python is required for the test suite, but it was not found]) fi dnl Checks for header files. @@ -126,9 +109,9 @@ fi dnl LLC Diff Option -AC_ARG_ENABLE(llc_diffs,AC_HELP_STRING([--enable-llc_diffs],[Enable LLC Diffs +AC_ARG_ENABLE(llc_diffs,AS_HELP_STRING(--enable-llc_diffs,Enable LLC Diffs when testing (default is - YES)]),,enableval=yes) + YES)),,enableval=yes) if test ${enableval} = "no" then AC_SUBST(DISABLE_LLC_DIFFS,[DISABLE_LLC_DIFFS:=1]) @@ -137,4 +120,5 @@ fi dnl Create the output files -AC_OUTPUT(Makefile.config) +AC_CONFIG_FILES([Makefile.config]) +AC_OUTPUT From reid at x10sys.com Wed Dec 29 13:13:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 13:13:07 -0600 Subject: [llvm-commits] CVS: llvm-test/autoconf/AutoRegen.sh Message-ID: <200412291913.NAA15315@zion.cs.uiuc.edu> Changes in directory llvm-test/autoconf: AutoRegen.sh updated: 1.3 -> 1.4 --- Log message: Use the --force and --warnings=all options on aclocal and autoconf to ensure that the configure script is completely rebuilt and that any compatibility warnings are generated. --- Diffs of the changes: (+2 -2) Index: llvm-test/autoconf/AutoRegen.sh diff -u llvm-test/autoconf/AutoRegen.sh:1.3 llvm-test/autoconf/AutoRegen.sh:1.4 --- llvm-test/autoconf/AutoRegen.sh:1.3 Tue Sep 7 11:16:59 2004 +++ llvm-test/autoconf/AutoRegen.sh Wed Dec 29 13:12:55 2004 @@ -23,8 +23,8 @@ fi echo "Regenerating aclocal.m4 with aclocal" rm -f aclocal.m4 -aclocal -I $cwd/m4 -I $llvm_m4 || die "aclocal failed" +aclocal --force -I $cwd/m4 -I $llvm_m4 || die "aclocal failed" echo "Regenerating configure with autoconf 2.5x" -autoconf -o ../configure configure.ac || die "autoconf failed" +autoconf --force --warnings=all -o ../configure configure.ac || die "autoconf failed" cd .. exit 0 From reid at x10sys.com Wed Dec 29 13:13:54 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 13:13:54 -0600 Subject: [llvm-commits] CVS: llvm-test/autoconf/m4/external_benchmark.m4 f2c.m4 Message-ID: <200412291913.NAA15336@zion.cs.uiuc.edu> Changes in directory llvm-test/autoconf/m4: external_benchmark.m4 updated: 1.1 -> 1.2 f2c.m4 updated: 1.2 -> 1.3 --- Log message: Convert AC_HELP_STRING -> AS_HELP_STRING to squelch autoconf warnings. --- Diffs of the changes: (+5 -5) Index: llvm-test/autoconf/m4/external_benchmark.m4 diff -u llvm-test/autoconf/m4/external_benchmark.m4:1.1 llvm-test/autoconf/m4/external_benchmark.m4:1.2 --- llvm-test/autoconf/m4/external_benchmark.m4:1.1 Tue Sep 7 11:18:27 2004 +++ llvm-test/autoconf/m4/external_benchmark.m4 Wed Dec 29 13:13:43 2004 @@ -6,7 +6,7 @@ AC_DEFUN([EXTERNAL_BENCHMARK], [m4_define([allcapsname],translit($1,a-z,A-Z)) AC_ARG_ENABLE($1, - AC_HELP_STRING([--enable-$1=ARG], + AS_HELP_STRING([--enable-$1=ARG], [Use $1 as a benchmark (srcs in DIR)]), checkresult=$enableval, checkresult=auto) Index: llvm-test/autoconf/m4/f2c.m4 diff -u llvm-test/autoconf/m4/f2c.m4:1.2 llvm-test/autoconf/m4/f2c.m4:1.3 --- llvm-test/autoconf/m4/f2c.m4:1.2 Thu Oct 7 19:24:43 2004 +++ llvm-test/autoconf/m4/f2c.m4 Wed Dec 29 13:13:44 2004 @@ -17,7 +17,7 @@ AC_DEFUN([CHECK_F2C_ALL], [AC_ARG_WITH(f2c, - AC_HELP_STRING([--with-f2c=DIR], [Use f2c with install prefix DIR]), + AS_HELP_STRING(--with-f2c=DIR,Use f2c with install prefix DIR), f2cdir=$withval) AC_MSG_CHECKING([for installed f2c components]) CHECK_F2C($f2cdir) @@ -58,7 +58,7 @@ dnl Check for f2c binary AC_DEFUN([CHECK_F2C_BIN], [AC_ARG_WITH(f2cbin, - AC_HELP_STRING([--with-f2c-bin=DIR], [Find f2c binary in DIR]), + AS_HELP_STRING(--with-f2c-bin=DIR,Find f2c binary in DIR), f2cbin=$withval) AC_MSG_CHECKING([for f2c binary]) if test -d "$f2cbin" && test -f "$f2cbin/f2c"; then @@ -73,7 +73,7 @@ dnl Check for f2c.h AC_DEFUN([CHECK_F2C_H], [AC_ARG_WITH(f2cinc, - AC_HELP_STRING([--with-f2c-inc=DIR], [Find f2c.h in DIR]), + AS_HELP_STRING(--with-f2c-inc=DIR,Find f2c.h in DIR), f2cinc=$withval) AC_MSG_CHECKING([for f2c.h]) if test -d "$f2cinc" && test -f "$f2cinc/f2c.h"; then @@ -88,7 +88,7 @@ dnl Check for libf2c.a AC_DEFUN([CHECK_F2C_LIB], [AC_ARG_WITH(f2clib, - AC_HELP_STRING([--with-f2c-lib=DIR], [Find libf2c.a in DIR]), + AS_HELP_STRING(--with-f2c-lib=DIR,Find libf2c.a in DIR), f2clib=$withval) AC_MSG_CHECKING([for libf2c.a]) if test -d "$f2clib" && test -f "$f2clib/libf2c.a"; then From reid at x10sys.com Wed Dec 29 13:35:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 13:35:40 -0600 Subject: [llvm-commits] CVS: llvm-test/configure Message-ID: <200412291935.NAA15620@zion.cs.uiuc.edu> Changes in directory llvm-test: configure updated: 1.15 -> 1.16 --- Log message: * Bump version number to 1.5 * Place all command line options in one section * Remove check for Python - not needed any more * Put all the AC_CONFIG_* invocations together. --- Diffs of the changes: (+59 -106) Index: llvm-test/configure diff -u llvm-test/configure:1.15 llvm-test/configure:1.16 --- llvm-test/configure:1.15 Wed Dec 29 01:28:21 2004 +++ llvm-test/configure Wed Dec 29 13:35:29 2004 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for LLVM-TEST 1.4. +# Generated by GNU Autoconf 2.59 for LLVM-TEST 1.5. # # Report bugs to . # @@ -423,11 +423,11 @@ # Identity of this package. PACKAGE_NAME='LLVM-TEST' PACKAGE_TARNAME='-llvm-test-' -PACKAGE_VERSION='1.4' -PACKAGE_STRING='LLVM-TEST 1.4' +PACKAGE_VERSION='1.5' +PACKAGE_STRING='LLVM-TEST 1.5' PACKAGE_BUGREPORT='llvmbugs at cs.uiuc.edu' -ac_unique_file=""Makefile.config.in"" +ac_unique_file="SingleSource/Benchmarks/Makefile" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -465,7 +465,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_SRC LLVM_OBJ CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PYTHON SPEC95_ROOT USE_SPEC95 SPEC2000_ROOT USE_SPEC2000 POVRAY_ROOT USE_POVRAY NAMD_ROOT USE_NAMD SWEEP3D_ROOT USE_SWEEP3D FPGROWTH_ROOT USE_FPGROWTH BOXEDSIM_ROOT USE_BOXEDSIM F2C F2C_INC F2C_LIB USE_F2C DISABLE_LLC_DIFFS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_SRC LLVM_OBJ DISABLE_LLC_DIFFS CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC CPP ifGNUmake LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL SPEC95_ROOT USE_SPEC95 SPEC2000_ROOT USE_SPEC2000 POVRAY_ROOT USE_POVRAY NAMD_ROOT USE_NAMD SWEEP3D_ROOT USE_SWEEP3D FPGROWTH_ROOT USE_FPGROWTH BOXEDSIM_ROOT USE_BOXEDSIM F2C F2C_INC F2C_LIB USE_F2C LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -954,7 +954,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures LLVM-TEST 1.4 to adapt to many kinds of systems. +\`configure' configures LLVM-TEST 1.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1015,13 +1015,14 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of LLVM-TEST 1.4:";; + short | recursive ) echo "Configuration of LLVM-TEST 1.5:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-llc_diffs Enable LLC Diffs when testing (default is YES) --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] @@ -1036,7 +1037,6 @@ --enable-sweep3d=ARG Use sweep3d as a benchmark (srcs in DIR) --enable-fpgrowth=ARG Use fpgrowth as a benchmark (srcs in DIR) --enable-boxedsim=ARG Use boxedsim as a benchmark (srcs in DIR) - --enable-llc_diffs Enable LLC Diffs when testing (default is YES) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1166,7 +1166,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -LLVM-TEST configure 1.4 +LLVM-TEST configure 1.5 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -1180,7 +1180,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by LLVM-TEST $as_me 1.4, which was +It was created by LLVM-TEST $as_me 1.5, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1545,6 +1545,8 @@ + ac_config_files="$ac_config_files Makefile.config" + ac_config_commands="$ac_config_commands Makefile" @@ -1668,6 +1670,22 @@ fi; +# Check whether --enable-llc_diffs or --disable-llc_diffs was given. +if test "${enable_llc_diffs+set}" = set; then + enableval="$enable_llc_diffs" + +else + enableval=yes +fi; +if test ${enableval} = "no" +then + DISABLE_LLC_DIFFS=DISABLE_LLC_DIFFS:=1 + +else + DISABLE_LLC_DIFFS= + +fi + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' @@ -3961,7 +3979,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3964 "configure"' > conftest.$ac_ext + echo '#line 3982 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4835,7 +4853,7 @@ # Provide some information about the compiler. -echo "$as_me:4838:" \ +echo "$as_me:4856:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -5892,11 +5910,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5895: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5913: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5899: \$? = $ac_status" >&5 + echo "$as_me:5917: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6135,11 +6153,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6138: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6156: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6142: \$? = $ac_status" >&5 + echo "$as_me:6160: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6195,11 +6213,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6198: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6216: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6202: \$? = $ac_status" >&5 + echo "$as_me:6220: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8380,7 +8398,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10692: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10678: \$? = $ac_status" >&5 + echo "$as_me:10696: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10731,11 +10749,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10734: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10752: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10738: \$? = $ac_status" >&5 + echo "$as_me:10756: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12092,7 +12110,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13048: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13034: \$? = $ac_status" >&5 + echo "$as_me:13052: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13087,11 +13105,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13090: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13108: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13094: \$? = $ac_status" >&5 + echo "$as_me:13112: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15126,11 +15144,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15129: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15147: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15133: \$? = $ac_status" >&5 + echo "$as_me:15151: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15369,11 +15387,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15372: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15390: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15376: \$? = $ac_status" >&5 + echo "$as_me:15394: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15429,11 +15447,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15432: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15450: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15436: \$? = $ac_status" >&5 + echo "$as_me:15454: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17614,7 +17632,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PYTHON+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $PYTHON in - [\\/]* | ?:[\\/]*) - ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - - test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON="true python" - ;; -esac -fi -PYTHON=$ac_cv_path_PYTHON - -if test -n "$PYTHON"; then - echo "$as_me:$LINENO: result: $PYTHON" >&5 -echo "${ECHO_T}$PYTHON" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -if test "$PYTHON" = "false" -then - { echo "$as_me:$LINENO: WARNING: Python is required for the test suite, but it was not found" >&5 -echo "$as_me: WARNING: Python is required for the test suite, but it was not found" >&2;} -fi - echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then @@ -19615,24 +19587,6 @@ fi -# Check whether --enable-llc_diffs or --disable-llc_diffs was given. -if test "${enable_llc_diffs+set}" = set; then - enableval="$enable_llc_diffs" - -else - enableval=yes -fi; -if test ${enableval} = "no" -then - DISABLE_LLC_DIFFS=DISABLE_LLC_DIFFS:=1 - -else - DISABLE_LLC_DIFFS= - -fi - - ac_config_files="$ac_config_files Makefile.config" - cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -20026,7 +19980,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by LLVM-TEST $as_me 1.4, which was +This file was extended by LLVM-TEST $as_me 1.5, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20084,7 +20038,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -LLVM-TEST config.status 1.4 +LLVM-TEST config.status 1.5 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" @@ -20345,6 +20299,7 @@ s, at LIBS@,$LIBS,;t t s, at LLVM_SRC@,$LLVM_SRC,;t t s, at LLVM_OBJ@,$LLVM_OBJ,;t t +s, at DISABLE_LLC_DIFFS@,$DISABLE_LLC_DIFFS,;t t s, at CXX@,$CXX,;t t s, at CXXFLAGS@,$CXXFLAGS,;t t s, at LDFLAGS@,$LDFLAGS,;t t @@ -20385,7 +20340,6 @@ s, at FFLAGS@,$FFLAGS,;t t s, at ac_ct_F77@,$ac_ct_F77,;t t s, at LIBTOOL@,$LIBTOOL,;t t -s, at PYTHON@,$PYTHON,;t t s, at SPEC95_ROOT@,$SPEC95_ROOT,;t t s, at USE_SPEC95@,$USE_SPEC95,;t t s, at SPEC2000_ROOT@,$SPEC2000_ROOT,;t t @@ -20404,7 +20358,6 @@ s, at F2C_INC@,$F2C_INC,;t t s, at F2C_LIB@,$F2C_LIB,;t t s, at USE_F2C@,$USE_F2C,;t t -s, at DISABLE_LLC_DIFFS@,$DISABLE_LLC_DIFFS,;t t s, at LIBOBJS@,$LIBOBJS,;t t s, at LTLIBOBJS@,$LTLIBOBJS,;t t CEOF From reid at x10sys.com Wed Dec 29 13:35:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 13:35:40 -0600 Subject: [llvm-commits] CVS: llvm-test/autoconf/configure.ac Message-ID: <200412291935.NAA15617@zion.cs.uiuc.edu> Changes in directory llvm-test/autoconf: configure.ac updated: 1.14 -> 1.15 --- Log message: * Bump version number to 1.5 * Place all command line options in one section * Remove check for Python - not needed any more * Put all the AC_CONFIG_* invocations together. --- Diffs of the changes: (+16 -21) Index: llvm-test/autoconf/configure.ac diff -u llvm-test/autoconf/configure.ac:1.14 llvm-test/autoconf/configure.ac:1.15 --- llvm-test/autoconf/configure.ac:1.14 Wed Dec 29 01:28:21 2004 +++ llvm-test/autoconf/configure.ac Wed Dec 29 13:35:29 2004 @@ -1,13 +1,14 @@ dnl Initialize autoconf -AC_INIT([[LLVM-TEST]],[[1.4]],[llvmbugs at cs.uiuc.edu]) +AC_INIT([[LLVM-TEST]],[[1.5]],[llvmbugs at cs.uiuc.edu]) dnl Place all of the extra autoconf files into the config subdirectory AC_CONFIG_AUX_DIR([autoconf]) dnl Verify that the source directory is valid -AC_CONFIG_SRCDIR(["Makefile.config.in"]) +AC_CONFIG_SRCDIR([SingleSource/Benchmarks/Makefile]) dnl Do special configuration of Makefiles +AC_CONFIG_FILES([Makefile.config]) AC_CONFIG_MAKEFILE(Makefile) AC_CONFIG_MAKEFILE(Makefile.common) AC_CONFIG_MAKEFILE(Makefile.f2c) @@ -43,7 +44,7 @@ AC_CONFIG_MAKEFILE(SingleSource/Makefile.singlesrc) dnl ************************************************************************** -dnl * Set the location of various third-party software packages +dnl * Get command line options dnl ************************************************************************** dnl Location of LLVM source code @@ -52,6 +53,18 @@ dnl Location of LLVM object code AC_ARG_WITH(llvmobj,AS_HELP_STRING(--with-llvmobj,Location of LLVM Object Code),AC_SUBST(LLVM_OBJ,[$withval]),AC_SUBST(LLVM_OBJ,[`cd ../..; pwd`])) +dnl LLC Diff Option +AC_ARG_ENABLE(llc_diffs, + AS_HELP_STRING(--enable-llc_diffs, + [Enable LLC Diffs when testing (default is YES)]),, + enableval=yes) +if test ${enableval} = "no" +then + AC_SUBST(DISABLE_LLC_DIFFS,[DISABLE_LLC_DIFFS:=1]) +else + AC_SUBST(DISABLE_LLC_DIFFS,[[]]) +fi + dnl ************************************************************************** dnl * Check for things needed by the test suite programs dnl ************************************************************************** @@ -75,12 +88,6 @@ AC_PROG_BISON AC_PROG_LIBTOOL -AC_PATH_PROG(PYTHON,[python],[true python]) -if test "$PYTHON" = "false" -then - AC_MSG_WARN([Python is required for the test suite, but it was not found]) -fi - dnl Checks for header files. dnl We don't check for ancient stuff or things that are guaranteed to be there dnl by the C++ standard. We always use the versions of C headers. @@ -108,17 +115,5 @@ CHECK_F2C_ENABLE() fi -dnl LLC Diff Option -AC_ARG_ENABLE(llc_diffs,AS_HELP_STRING(--enable-llc_diffs,Enable LLC Diffs - when testing (default is - YES)),,enableval=yes) -if test ${enableval} = "no" -then - AC_SUBST(DISABLE_LLC_DIFFS,[DISABLE_LLC_DIFFS:=1]) -else - AC_SUBST(DISABLE_LLC_DIFFS,[[]]) -fi - dnl Create the output files -AC_CONFIG_FILES([Makefile.config]) AC_OUTPUT From brukman at cs.uiuc.edu Wed Dec 29 14:44:44 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Wed, 29 Dec 2004 14:44:44 -0600 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/FreeBench/Makefile Message-ID: <200412292044.OAA16578@zion.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/FreeBench: Makefile updated: 1.3 -> 1.4 --- Log message: SparcV8 cannot handle analyzer (runs machine out of memory) so disable it --- Diffs of the changes: (+6 -1) Index: llvm-test/MultiSource/Benchmarks/FreeBench/Makefile diff -u llvm-test/MultiSource/Benchmarks/FreeBench/Makefile:1.3 llvm-test/MultiSource/Benchmarks/FreeBench/Makefile:1.4 --- llvm-test/MultiSource/Benchmarks/FreeBench/Makefile:1.3 Wed Sep 1 09:33:21 2004 +++ llvm-test/MultiSource/Benchmarks/FreeBench/Makefile Wed Dec 29 14:44:34 2004 @@ -1,6 +1,11 @@ # MultiSource/Olden Makefile: Build all subdirectories automatically LEVEL = ../../.. -PARALLEL_DIRS := distray mason pcompress2 analyzer fourinarow neural pifft +PARALLEL_DIRS = distray mason pcompress2 analyzer fourinarow neural pifft + +# SparcV8 can't handle analyzer, but we can't separate V8 from V9 now +ifeq ($(ARCH),Sparc) +PARALLEL_DIRS := $(filter-out analyzer, $(PARALLEL_DIRS)) +endif include $(LEVEL)/Makefile.programs From brukman at cs.uiuc.edu Wed Dec 29 21:02:08 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Wed, 29 Dec 2004 21:02:08 -0600 Subject: [llvm-commits] CVS: llvm-www/testresults/index.html Message-ID: <200412300302.VAA21121@zion.cs.uiuc.edu> Changes in directory llvm-www/testresults: index.html updated: 1.24 -> 1.25 --- Log message: Change link to specify that these are the SparcV9 test results --- Diffs of the changes: (+1 -1) Index: llvm-www/testresults/index.html diff -u llvm-www/testresults/index.html:1.24 llvm-www/testresults/index.html:1.25 --- llvm-www/testresults/index.html:1.24 Thu Dec 23 14:04:16 2004 +++ llvm-www/testresults/index.html Wed Dec 29 21:01:57 2004 @@ -42,7 +42,7 @@

        Sparc V9

          -
        1. SunOS 5.8 on Sun Fire V240 (dual 1Ghz CPU) -- debug +
        2. SunOS 5.8 on Sun Fire V240 (dual 1Ghz CPU) -- debug build
        From jeffc at jolt-lang.org Wed Dec 29 21:02:42 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Wed, 29 Dec 2004 21:02:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/DynamicLibrary.cpp Message-ID: <200412300302.VAA21150@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: DynamicLibrary.cpp updated: 1.8 -> 1.9 --- Log message: Fix MINGW compilation errors --- Diffs of the changes: (+2 -2) Index: llvm/lib/System/Win32/DynamicLibrary.cpp diff -u llvm/lib/System/Win32/DynamicLibrary.cpp:1.8 llvm/lib/System/Win32/DynamicLibrary.cpp:1.9 --- llvm/lib/System/Win32/DynamicLibrary.cpp:1.8 Fri Dec 24 22:50:17 2004 +++ llvm/lib/System/Win32/DynamicLibrary.cpp Wed Dec 29 21:02:31 2004 @@ -111,7 +111,7 @@ E = OpenedHandles.end(); I != E; ++I) { FARPROC ptr = GetProcAddress((HMODULE)*I, symbolName); if (ptr) - return ptr; + return (void *) ptr; } return 0; @@ -119,7 +119,7 @@ void *DynamicLibrary::GetAddressOfSymbol(const char *symbolName) { assert(handle != 0 && "Invalid DynamicLibrary handle"); - return GetProcAddress((HMODULE)handle, symbolName); + return (void *) GetProcAddress((HMODULE)handle, symbolName); } } From reid at x10sys.com Wed Dec 29 21:10:49 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 21:10:49 -0600 Subject: [llvm-commits] CVS: llvm-test/RunSafely.sh Message-ID: <200412300310.VAA21307@zion.cs.uiuc.edu> Changes in directory llvm-test: RunSafely.sh updated: 1.16 -> 1.17 --- Log message: Permit this script to run correctly on Cygwin where /bin/sh is not the Bourne Again Shell, just the Bourne Shell. It doesn't support the ulimit command so we avoid running it. --- Diffs of the changes: (+12 -6) Index: llvm-test/RunSafely.sh diff -u llvm-test/RunSafely.sh:1.16 llvm-test/RunSafely.sh:1.17 --- llvm-test/RunSafely.sh:1.16 Sun Nov 7 15:28:32 2004 +++ llvm-test/RunSafely.sh Wed Dec 29 21:10:38 2004 @@ -18,13 +18,19 @@ OUTFILE=$3 PROGRAM=$4 shift 4 +SYSTEM=`uname -s` -ulimit -t $ULIMIT +case $SYSTEM in + CYGWIN*) + ;; + *) + ulimit -t $ULIMIT + ulimit -c unlimited + # To prevent infinite loops which fill up the disk, specify a limit on size of + # files being output by the tests. 10 MB should be enough for anybody. ;) + ulimit -f 10485760 +esac rm -f core core.* -ulimit -c unlimited -# To prevent infinite loops which fill up the disk, specify a limit on size of -# files being output by the tests. 10 MB should be enough for anybody. ;) -ulimit -f 10485760 # # Run the command, timing its execution. @@ -36,7 +42,7 @@ # we tell time to launch a shell which in turn executes $PROGRAM with the # necessary I/O redirection. # -(time -p sh -c "$PROGRAM $* > $OUTFILE 2>&1 < $INFILE") 2>&1 | awk -- '\ +( time -p sh -c "$PROGRAM $* > $OUTFILE 2>&1 < $INFILE" ) 2>&1 | awk -- '\ BEGIN { cpu = 0.0; } /^user/ { cpu += $2; print } /^sys/ { cpu += $2; print } From reid at x10sys.com Wed Dec 29 23:36:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/llvm-db.cpp Message-ID: <200412300536.XAA23158@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: llvm-db.cpp updated: 1.7 -> 1.8 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+39 -32) Index: llvm/tools/llvm-db/llvm-db.cpp diff -u llvm/tools/llvm-db/llvm-db.cpp:1.7 llvm/tools/llvm-db/llvm-db.cpp:1.8 --- llvm/tools/llvm-db/llvm-db.cpp:1.7 Sat Oct 16 21:49:08 2004 +++ llvm/tools/llvm-db/llvm-db.cpp Wed Dec 29 23:36:07 2004 @@ -50,39 +50,46 @@ // main Driver function // int main(int argc, char **argv, char * const *envp) { - cl::ParseCommandLineOptions(argc, argv, - " llvm source-level debugger\n"); - sys::PrintStackTraceOnErrorSignal(); - - if (!Quiet) - std::cout << "llvm-db: The LLVM source-level debugger\n"; - - // Merge Inputfile and InputArgs into the InputArgs list... - if (!InputFile.empty() && InputArgs.empty()) - InputArgs.push_back(InputFile); - - // Create the CLI debugger... - CLIDebugger D; - - // Initialize the debugger with the command line options we read... - Debugger &Dbg = D.getDebugger(); - - // Initialize the debugger environment. - Dbg.initializeEnvironment(envp); - Dbg.setWorkingDirectory(WorkingDirectory); - for (unsigned i = 0, e = SourceDirectories.size(); i != e; ++i) - D.addSourceDirectory(SourceDirectories[i]); - - if (!InputArgs.empty()) { - try { - D.fileCommand(InputArgs[0]); - } catch (const std::string &Error) { - std::cout << "Error: " << Error << "\n"; + try { + cl::ParseCommandLineOptions(argc, argv, + " llvm source-level debugger\n"); + sys::PrintStackTraceOnErrorSignal(); + + if (!Quiet) + std::cout << "llvm-db: The LLVM source-level debugger\n"; + + // Merge Inputfile and InputArgs into the InputArgs list... + if (!InputFile.empty() && InputArgs.empty()) + InputArgs.push_back(InputFile); + + // Create the CLI debugger... + CLIDebugger D; + + // Initialize the debugger with the command line options we read... + Debugger &Dbg = D.getDebugger(); + + // Initialize the debugger environment. + Dbg.initializeEnvironment(envp); + Dbg.setWorkingDirectory(WorkingDirectory); + for (unsigned i = 0, e = SourceDirectories.size(); i != e; ++i) + D.addSourceDirectory(SourceDirectories[i]); + + if (!InputArgs.empty()) { + try { + D.fileCommand(InputArgs[0]); + } catch (const std::string &Error) { + std::cout << "Error: " << Error << "\n"; + } + + Dbg.setProgramArguments(InputArgs.begin()+1, InputArgs.end()); } - Dbg.setProgramArguments(InputArgs.begin()+1, InputArgs.end()); + // Now that we have initialized the debugger, run it. + return D.run(); + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } - - // Now that we have initialized the debugger, run it. - return D.run(); + return 1; } From reid at x10sys.com Wed Dec 29 23:36:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccas/gccas.cpp Message-ID: <200412300536.XAA23159@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccas: gccas.cpp updated: 1.105 -> 1.106 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+72 -64) Index: llvm/tools/gccas/gccas.cpp diff -u llvm/tools/gccas/gccas.cpp:1.105 llvm/tools/gccas/gccas.cpp:1.106 --- llvm/tools/gccas/gccas.cpp:1.105 Tue Dec 21 20:58:43 2004 +++ llvm/tools/gccas/gccas.cpp Wed Dec 29 23:36:07 2004 @@ -128,77 +128,85 @@ int main(int argc, char **argv) { - cl::ParseCommandLineOptions(argc, argv, " llvm .s -> .o assembler for GCC\n"); - sys::PrintStackTraceOnErrorSignal(); - - std::auto_ptr M; try { - // Parse the file now... - M.reset(ParseAssemblyFile(InputFilename)); - } catch (const ParseException &E) { - std::cerr << argv[0] << ": " << E.getMessage() << "\n"; - return 1; - } + cl::ParseCommandLineOptions(argc, argv, + " llvm .s -> .o assembler for GCC\n"); + sys::PrintStackTraceOnErrorSignal(); + + std::auto_ptr M; + try { + // Parse the file now... + M.reset(ParseAssemblyFile(InputFilename)); + } catch (const ParseException &E) { + std::cerr << argv[0] << ": " << E.getMessage() << "\n"; + return 1; + } - if (M.get() == 0) { - std::cerr << argv[0] << ": assembly didn't read correctly.\n"; - return 1; - } + if (M.get() == 0) { + std::cerr << argv[0] << ": assembly didn't read correctly.\n"; + return 1; + } - std::ostream *Out = 0; - if (OutputFilename == "") { // Didn't specify an output filename? - if (InputFilename == "-") { - OutputFilename = "-"; - } else { - std::string IFN = InputFilename; - int Len = IFN.length(); - if (IFN[Len-2] == '.' && IFN[Len-1] == 's') { // Source ends in .s? - OutputFilename = std::string(IFN.begin(), IFN.end()-2); + std::ostream *Out = 0; + if (OutputFilename == "") { // Didn't specify an output filename? + if (InputFilename == "-") { + OutputFilename = "-"; } else { - OutputFilename = IFN; // Append a .o to it + std::string IFN = InputFilename; + int Len = IFN.length(); + if (IFN[Len-2] == '.' && IFN[Len-1] == 's') { // Source ends in .s? + OutputFilename = std::string(IFN.begin(), IFN.end()-2); + } else { + OutputFilename = IFN; // Append a .o to it + } + OutputFilename += ".o"; } - OutputFilename += ".o"; } - } - - if (OutputFilename == "-") - Out = &std::cout; - else { - Out = new std::ofstream(OutputFilename.c_str(), std::ios::out); - - // Make sure that the Out file gets unlinked from the disk if we get a - // signal - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - } - - - if (!Out->good()) { - std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; - return 1; - } - - // In addition to just parsing the input from GCC, we also want to spiff it up - // a little bit. Do this now. - // - PassManager Passes; - - // Add an appropriate TargetData instance for this module... - Passes.add(new TargetData("gccas", M.get())); - - // Add all of the transformation passes to the pass manager to do the cleanup - // and optimization of the GCC output. - // - AddConfiguredTransformationPasses(Passes); - - // Make sure everything is still good. - Passes.add(createVerifierPass()); - // Write bytecode to file... - Passes.add(new WriteBytecodePass(Out,false,!NoCompress)); + if (OutputFilename == "-") + Out = &std::cout; + else { + Out = new std::ofstream(OutputFilename.c_str(), std::ios::out); + + // Make sure that the Out file gets unlinked from the disk if we get a + // signal + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + } - // Run our queue of passes all at once now, efficiently. - Passes.run(*M.get()); + + if (!Out->good()) { + std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; + return 1; + } - if (Out != &std::cout) delete Out; - return 0; + // In addition to just parsing the input from GCC, we also want to spiff it up + // a little bit. Do this now. + // + PassManager Passes; + + // Add an appropriate TargetData instance for this module... + Passes.add(new TargetData("gccas", M.get())); + + // Add all of the transformation passes to the pass manager to do the cleanup + // and optimization of the GCC output. + // + AddConfiguredTransformationPasses(Passes); + + // Make sure everything is still good. + Passes.add(createVerifierPass()); + + // Write bytecode to file... + Passes.add(new WriteBytecodePass(Out,false,!NoCompress)); + + // Run our queue of passes all at once now, efficiently. + Passes.run(*M.get()); + + if (Out != &std::cout) delete Out; + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + } + return 1; } From reid at x10sys.com Wed Dec 29 23:36:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-nm/llvm-nm.cpp Message-ID: <200412300536.XAA23165@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-nm: llvm-nm.cpp updated: 1.21 -> 1.22 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+20 -13) Index: llvm/tools/llvm-nm/llvm-nm.cpp diff -u llvm/tools/llvm-nm/llvm-nm.cpp:1.21 llvm/tools/llvm-nm/llvm-nm.cpp:1.22 --- llvm/tools/llvm-nm/llvm-nm.cpp:1.21 Tue Dec 14 19:53:50 2004 +++ llvm/tools/llvm-nm/llvm-nm.cpp Wed Dec 29 23:36:07 2004 @@ -152,20 +152,27 @@ } int main(int argc, char **argv) { - cl::ParseCommandLineOptions(argc, argv, " llvm symbol table dumper\n"); - sys::PrintStackTraceOnErrorSignal(); + try { + cl::ParseCommandLineOptions(argc, argv, " llvm symbol table dumper\n"); + sys::PrintStackTraceOnErrorSignal(); - ToolName = argv[0]; - if (BSDFormat) OutputFormat = bsd; - if (POSIXFormat) OutputFormat = posix; + ToolName = argv[0]; + if (BSDFormat) OutputFormat = bsd; + if (POSIXFormat) OutputFormat = posix; - switch (InputFilenames.size()) { - case 0: InputFilenames.push_back("-"); - case 1: break; - default: MultipleFiles = true; - } + switch (InputFilenames.size()) { + case 0: InputFilenames.push_back("-"); + case 1: break; + default: MultipleFiles = true; + } - std::for_each (InputFilenames.begin (), InputFilenames.end (), - DumpSymbolNamesFromFile); - return 0; + std::for_each (InputFilenames.begin (), InputFilenames.end (), + DumpSymbolNamesFromFile); + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + } + return 1; } From reid at x10sys.com Wed Dec 29 23:36:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200412300536.XAA23167@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.19 -> 1.20 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+123 -116) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.19 llvm/tools/llvm-ld/llvm-ld.cpp:1.20 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.19 Wed Dec 22 07:50:17 2004 +++ llvm/tools/llvm-ld/llvm-ld.cpp Wed Dec 29 23:36:07 2004 @@ -389,126 +389,133 @@ } int main(int argc, char **argv, char **envp) { - // Initial global variable above for convenience printing of program name. - progname = sys::Path(argv[0]).getBasename(); - Linker TheLinker(progname, Verbose); - - // Set up the library paths for the Linker - TheLinker.addPaths(LibPaths); - TheLinker.addSystemPaths(); - - // Parse the command line options - cl::ParseCommandLineOptions(argc, argv, " llvm linker\n"); - sys::PrintStackTraceOnErrorSignal(); - - // Remove any consecutive duplicates of the same library... - Libraries.erase(std::unique(Libraries.begin(), Libraries.end()), - Libraries.end()); - - if (LinkAsLibrary) { - std::vector Files; - for (unsigned i = 0; i < InputFilenames.size(); ++i ) - Files.push_back(sys::Path(InputFilenames[i])); - if (TheLinker.LinkInFiles(Files)) - return 1; // Error already printed - - // The libraries aren't linked in but are noted as "dependent" in the - // module. - for (cl::list::const_iterator I = Libraries.begin(), - E = Libraries.end(); I != E ; ++I) { - TheLinker.getModule()->addLibrary(*I); + try { + // Initial global variable above for convenience printing of program name. + progname = sys::Path(argv[0]).getBasename(); + Linker TheLinker(progname, Verbose); + + // Set up the library paths for the Linker + TheLinker.addPaths(LibPaths); + TheLinker.addSystemPaths(); + + // Parse the command line options + cl::ParseCommandLineOptions(argc, argv, " llvm linker\n"); + sys::PrintStackTraceOnErrorSignal(); + + // Remove any consecutive duplicates of the same library... + Libraries.erase(std::unique(Libraries.begin(), Libraries.end()), + Libraries.end()); + + if (LinkAsLibrary) { + std::vector Files; + for (unsigned i = 0; i < InputFilenames.size(); ++i ) + Files.push_back(sys::Path(InputFilenames[i])); + if (TheLinker.LinkInFiles(Files)) + return 1; // Error already printed + + // The libraries aren't linked in but are noted as "dependent" in the + // module. + for (cl::list::const_iterator I = Libraries.begin(), + E = Libraries.end(); I != E ; ++I) { + TheLinker.getModule()->addLibrary(*I); + } + } else { + // Build a list of the items from our command line + Linker::ItemList Items; + BuildLinkItems(Items, InputFilenames, Libraries); + + // Link all the items together + if (TheLinker.LinkInItems(Items) ) + return 1; } - } else { - // Build a list of the items from our command line - Linker::ItemList Items; - BuildLinkItems(Items, InputFilenames, Libraries); - - // Link all the items together - if (TheLinker.LinkInItems(Items) ) - return 1; - } - - std::auto_ptr Composite(TheLinker.releaseModule()); - - // Optimize the module - Optimize(Composite.get()); - // Generate the bytecode for the optimized module. - std::string RealBytecodeOutput = OutputFilename; - if (!LinkAsLibrary) RealBytecodeOutput += ".bc"; - GenerateBytecode(Composite.get(), RealBytecodeOutput); - - // If we are not linking a library, generate either a native executable - // or a JIT shell script, depending upon what the user wants. - if (!LinkAsLibrary) { - // If the user wants to generate a native executable, compile it from the - // bytecode file. - // - // Otherwise, create a script that will run the bytecode through the JIT. - if (Native) { - // Name of the Assembly Language output file - sys::Path AssemblyFile ( OutputFilename); - AssemblyFile.appendSuffix("s"); - - // Mark the output files for removal if we get an interrupt. - sys::RemoveFileOnSignal(AssemblyFile); - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - - // Determine the locations of the llc and gcc programs. - sys::Path llc = FindExecutable("llc", argv[0]); - if (llc.isEmpty()) - return PrintAndReturn("Failed to find llc"); - - sys::Path gcc = FindExecutable("gcc", argv[0]); - if (gcc.isEmpty()) - return PrintAndReturn("Failed to find gcc"); - - // Generate an assembly language file for the bytecode. - if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc); - if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, AssemblyFile.toString(), Libraries, - gcc, envp); - - // Remove the assembly language file. - AssemblyFile.destroyFile(); - } else if (NativeCBE) { - sys::Path CFile (OutputFilename); - CFile.appendSuffix("cbe.c"); - - // Mark the output files for removal if we get an interrupt. - sys::RemoveFileOnSignal(CFile); - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - - // Determine the locations of the llc and gcc programs. - sys::Path llc = FindExecutable("llc", argv[0]); - if (llc.isEmpty()) - return PrintAndReturn("Failed to find llc"); - - sys::Path gcc = FindExecutable("gcc", argv[0]); - if (gcc.isEmpty()) - return PrintAndReturn("Failed to find gcc"); - - // Generate an assembly language file for the bytecode. - if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateCFile(CFile.toString(), RealBytecodeOutput, llc); - if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, CFile.toString(), Libraries, gcc, envp); + std::auto_ptr Composite(TheLinker.releaseModule()); - // Remove the assembly language file. - CFile.destroyFile(); + // Optimize the module + Optimize(Composite.get()); - } else { - EmitShellScript(argv); + // Generate the bytecode for the optimized module. + std::string RealBytecodeOutput = OutputFilename; + if (!LinkAsLibrary) RealBytecodeOutput += ".bc"; + GenerateBytecode(Composite.get(), RealBytecodeOutput); + + // If we are not linking a library, generate either a native executable + // or a JIT shell script, depending upon what the user wants. + if (!LinkAsLibrary) { + // If the user wants to generate a native executable, compile it from the + // bytecode file. + // + // Otherwise, create a script that will run the bytecode through the JIT. + if (Native) { + // Name of the Assembly Language output file + sys::Path AssemblyFile ( OutputFilename); + AssemblyFile.appendSuffix("s"); + + // Mark the output files for removal if we get an interrupt. + sys::RemoveFileOnSignal(AssemblyFile); + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + + // Determine the locations of the llc and gcc programs. + sys::Path llc = FindExecutable("llc", argv[0]); + if (llc.isEmpty()) + return PrintAndReturn("Failed to find llc"); + + sys::Path gcc = FindExecutable("gcc", argv[0]); + if (gcc.isEmpty()) + return PrintAndReturn("Failed to find gcc"); + + // Generate an assembly language file for the bytecode. + if (Verbose) std::cout << "Generating Assembly Code\n"; + GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc); + if (Verbose) std::cout << "Generating Native Code\n"; + GenerateNative(OutputFilename, AssemblyFile.toString(), Libraries, + gcc, envp); + + // Remove the assembly language file. + AssemblyFile.destroyFile(); + } else if (NativeCBE) { + sys::Path CFile (OutputFilename); + CFile.appendSuffix("cbe.c"); + + // Mark the output files for removal if we get an interrupt. + sys::RemoveFileOnSignal(CFile); + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + + // Determine the locations of the llc and gcc programs. + sys::Path llc = FindExecutable("llc", argv[0]); + if (llc.isEmpty()) + return PrintAndReturn("Failed to find llc"); + + sys::Path gcc = FindExecutable("gcc", argv[0]); + if (gcc.isEmpty()) + return PrintAndReturn("Failed to find gcc"); + + // Generate an assembly language file for the bytecode. + if (Verbose) std::cout << "Generating Assembly Code\n"; + GenerateCFile(CFile.toString(), RealBytecodeOutput, llc); + if (Verbose) std::cout << "Generating Native Code\n"; + GenerateNative(OutputFilename, CFile.toString(), Libraries, gcc, envp); + + // Remove the assembly language file. + CFile.destroyFile(); + + } else { + EmitShellScript(argv); + } + + // Make the script executable... + sys::Path(OutputFilename).makeExecutable(); + + // Make the bytecode file readable and directly executable in LLEE as well + sys::Path(RealBytecodeOutput).makeExecutable(); + sys::Path(RealBytecodeOutput).makeReadable(); } - - // Make the script executable... - sys::Path(OutputFilename).makeExecutable(); - - // Make the bytecode file readable and directly executable in LLEE as well - sys::Path(RealBytecodeOutput).makeExecutable(); - sys::Path(RealBytecodeOutput).makeReadable(); - } - return 0; + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + } + return 1; } From reid at x10sys.com Wed Dec 29 23:36:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200412300536.XAA23166@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.99 -> 1.100 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+95 -88) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.99 llvm/tools/opt/opt.cpp:1.100 --- llvm/tools/opt/opt.cpp:1.99 Sun Nov 14 16:30:08 2004 +++ llvm/tools/opt/opt.cpp Wed Dec 29 23:36:08 2004 @@ -70,102 +70,109 @@ // main for opt // int main(int argc, char **argv) { - cl::ParseCommandLineOptions(argc, argv, - " llvm .bc -> .bc modular optimizer\n"); - sys::PrintStackTraceOnErrorSignal(); - - // Allocate a full target machine description only if necessary... - // FIXME: The choice of target should be controllable on the command line. - std::auto_ptr target; - - TargetMachine* TM = NULL; - std::string ErrorMessage; - - // Load the input module... - std::auto_ptr M(ParseBytecodeFile(InputFilename, &ErrorMessage)); - if (M.get() == 0) { - std::cerr << argv[0] << ": "; - if (ErrorMessage.size()) - std::cerr << ErrorMessage << "\n"; - else - std::cerr << "bytecode didn't read correctly.\n"; - return 1; - } - - // Figure out what stream we are supposed to write to... - std::ostream *Out = &std::cout; // Default to printing to stdout... - if (OutputFilename != "-") { - if (!Force && std::ifstream(OutputFilename.c_str())) { - // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename - << "': file exists!\n" - << "Use -f command line argument to force output\n"; + try { + cl::ParseCommandLineOptions(argc, argv, + " llvm .bc -> .bc modular optimizer\n"); + sys::PrintStackTraceOnErrorSignal(); + + // Allocate a full target machine description only if necessary... + // FIXME: The choice of target should be controllable on the command line. + std::auto_ptr target; + + TargetMachine* TM = NULL; + std::string ErrorMessage; + + // Load the input module... + std::auto_ptr M(ParseBytecodeFile(InputFilename, &ErrorMessage)); + if (M.get() == 0) { + std::cerr << argv[0] << ": "; + if (ErrorMessage.size()) + std::cerr << ErrorMessage << "\n"; + else + std::cerr << "bytecode didn't read correctly.\n"; return 1; } - Out = new std::ofstream(OutputFilename.c_str()); - if (!Out->good()) { - std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; - return 1; + // Figure out what stream we are supposed to write to... + std::ostream *Out = &std::cout; // Default to printing to stdout... + if (OutputFilename != "-") { + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + std::cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists!\n" + << "Use -f command line argument to force output\n"; + return 1; + } + Out = new std::ofstream(OutputFilename.c_str()); + + if (!Out->good()) { + std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; + return 1; + } + + // Make sure that the Output file gets unlinked from the disk if we get a + // SIGINT + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); } - // Make sure that the Output file gets unlinked from the disk if we get a - // SIGINT - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - } - - // If the output is set to be emitted to standard out, and standard out is a - // console, print out a warning message and refuse to do it. We don't impress - // anyone by spewing tons of binary goo to a terminal. - if (Out == &std::cout && isStandardOutAConsole() && !Force && !NoOutput - && !Quiet) { - std::cerr << "WARNING: It looks like you're attempting to print out a " - << "bytecode file. I'm\ngoing to pretend you didn't ask me to do" - << " this (for your own good). If you\nREALLY want to taste LLVM" - << " bytecode first-hand, you can force output with the\n`-f'" - << " option.\n\n"; - NoOutput = true; - } + // If the output is set to be emitted to standard out, and standard out is a + // console, print out a warning message and refuse to do it. We don't impress + // anyone by spewing tons of binary goo to a terminal. + if (Out == &std::cout && isStandardOutAConsole() && !Force && !NoOutput + && !Quiet) { + std::cerr << "WARNING: It looks like you're attempting to print out a " + << "bytecode file. I'm\ngoing to pretend you didn't ask me to do" + << " this (for your own good). If you\nREALLY want to taste LLVM" + << " bytecode first-hand, you can force output with the\n`-f'" + << " option.\n\n"; + NoOutput = true; + } - // Create a PassManager to hold and optimize the collection of passes we are - // about to build... - // - PassManager Passes; - - // Add an appropriate TargetData instance for this module... - Passes.add(new TargetData("opt", M.get())); - - // Create a new optimization pass for each one specified on the command line - for (unsigned i = 0; i < OptimizationList.size(); ++i) { - const PassInfo *Opt = OptimizationList[i]; - - if (Opt->getNormalCtor()) - Passes.add(Opt->getNormalCtor()()); - else if (Opt->getTargetCtor()) { + // Create a PassManager to hold and optimize the collection of passes we are + // about to build... + // + PassManager Passes; + + // Add an appropriate TargetData instance for this module... + Passes.add(new TargetData("opt", M.get())); + + // Create a new optimization pass for each one specified on the command line + for (unsigned i = 0; i < OptimizationList.size(); ++i) { + const PassInfo *Opt = OptimizationList[i]; + + if (Opt->getNormalCtor()) + Passes.add(Opt->getNormalCtor()()); + else if (Opt->getTargetCtor()) { #if 0 - if (target.get() == NULL) - target.reset(allocateSparcTargetMachine()); // FIXME: target option + if (target.get() == NULL) + target.reset(allocateSparcTargetMachine()); // FIXME: target option #endif - assert(target.get() && "Could not allocate target machine!"); - Passes.add(Opt->getTargetCtor()(*target.get())); - } else - std::cerr << argv[0] << ": cannot create pass: " << Opt->getPassName() - << "\n"; - - if (PrintEachXForm) - Passes.add(new PrintModulePass(&std::cerr)); - } + assert(target.get() && "Could not allocate target machine!"); + Passes.add(Opt->getTargetCtor()(*target.get())); + } else + std::cerr << argv[0] << ": cannot create pass: " << Opt->getPassName() + << "\n"; - // Check that the module is well formed on completion of optimization - if (!NoVerify) - Passes.add(createVerifierPass()); - - // Write bytecode out to disk or cout as the last step... - if (!NoOutput) - Passes.add(new WriteBytecodePass(Out, Out != &std::cout)); - - // Now that we have all of the passes ready, run them. - Passes.run(*M.get()); + if (PrintEachXForm) + Passes.add(new PrintModulePass(&std::cerr)); + } - return 0; + // Check that the module is well formed on completion of optimization + if (!NoVerify) + Passes.add(createVerifierPass()); + + // Write bytecode out to disk or cout as the last step... + if (!NoOutput) + Passes.add(new WriteBytecodePass(Out, Out != &std::cout)); + + // Now that we have all of the passes ready, run them. + Passes.run(*M.get()); + + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + } + return 1; } From reid at x10sys.com Wed Dec 29 23:36:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/lli/lli.cpp Message-ID: <200412300536.XAA23164@zion.cs.uiuc.edu> Changes in directory llvm/tools/lli: lli.cpp updated: 1.47 -> 1.48 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+62 -55) Index: llvm/tools/lli/lli.cpp diff -u llvm/tools/lli/lli.cpp:1.47 llvm/tools/lli/lli.cpp:1.48 --- llvm/tools/lli/lli.cpp:1.47 Wed Sep 1 17:55:37 2004 +++ llvm/tools/lli/lli.cpp Wed Dec 29 23:36:07 2004 @@ -47,62 +47,69 @@ // main Driver function // int main(int argc, char **argv, char * const *envp) { - cl::ParseCommandLineOptions(argc, argv, - " llvm interpreter & dynamic compiler\n"); - sys::PrintStackTraceOnErrorSignal(); - - // Load the bytecode... - std::string ErrorMsg; - ModuleProvider *MP = 0; try { - MP = getBytecodeModuleProvider(InputFile); - } catch (std::string &err) { - std::cerr << "Error loading program '" << InputFile << "': " << err << "\n"; - exit(1); + cl::ParseCommandLineOptions(argc, argv, + " llvm interpreter & dynamic compiler\n"); + sys::PrintStackTraceOnErrorSignal(); + + // Load the bytecode... + std::string ErrorMsg; + ModuleProvider *MP = 0; + try { + MP = getBytecodeModuleProvider(InputFile); + } catch (std::string &err) { + std::cerr << "Error loading program '" << InputFile << "': " << err << "\n"; + exit(1); + } + + ExecutionEngine *EE = ExecutionEngine::create(MP, ForceInterpreter); + assert(EE && "Couldn't create an ExecutionEngine, not even an interpreter?"); + + // If the user specifically requested an argv[0] to pass into the program, do + // it now. + if (!FakeArgv0.empty()) { + InputFile = FakeArgv0; + } else { + // Otherwise, if there is a .bc suffix on the executable strip it off, it + // might confuse the program. + if (InputFile.rfind(".bc") == InputFile.length() - 3) + InputFile.erase(InputFile.length() - 3); + } + + // Add the module's name to the start of the vector of arguments to main(). + InputArgv.insert(InputArgv.begin(), InputFile); + + // Call the main function from M as if its signature were: + // int main (int argc, char **argv, const char **envp) + // using the contents of Args to determine argc & argv, and the contents of + // EnvVars to determine envp. + // + Function *Fn = MP->getModule()->getMainFunction(); + if (!Fn) { + std::cerr << "'main' function not found in module.\n"; + return -1; + } + + // Run main... + int Result = EE->runFunctionAsMain(Fn, InputArgv, envp); + + // If the program didn't explicitly call exit, call exit now, for the program. + // This ensures that any atexit handlers get called correctly. + Function *Exit = MP->getModule()->getOrInsertFunction("exit", Type::VoidTy, + Type::IntTy, 0); + + std::vector Args; + GenericValue ResultGV; + ResultGV.IntVal = Result; + Args.push_back(ResultGV); + EE->runFunction(Exit, Args); + + std::cerr << "ERROR: exit(" << Result << ") returned!\n"; + abort(); + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } - - ExecutionEngine *EE = ExecutionEngine::create(MP, ForceInterpreter); - assert(EE && "Couldn't create an ExecutionEngine, not even an interpreter?"); - - // If the user specifically requested an argv[0] to pass into the program, do - // it now. - if (!FakeArgv0.empty()) { - InputFile = FakeArgv0; - } else { - // Otherwise, if there is a .bc suffix on the executable strip it off, it - // might confuse the program. - if (InputFile.rfind(".bc") == InputFile.length() - 3) - InputFile.erase(InputFile.length() - 3); - } - - // Add the module's name to the start of the vector of arguments to main(). - InputArgv.insert(InputArgv.begin(), InputFile); - - // Call the main function from M as if its signature were: - // int main (int argc, char **argv, const char **envp) - // using the contents of Args to determine argc & argv, and the contents of - // EnvVars to determine envp. - // - Function *Fn = MP->getModule()->getMainFunction(); - if (!Fn) { - std::cerr << "'main' function not found in module.\n"; - return -1; - } - - // Run main... - int Result = EE->runFunctionAsMain(Fn, InputArgv, envp); - - // If the program didn't explicitly call exit, call exit now, for the program. - // This ensures that any atexit handlers get called correctly. - Function *Exit = MP->getModule()->getOrInsertFunction("exit", Type::VoidTy, - Type::IntTy, 0); - - std::vector Args; - GenericValue ResultGV; - ResultGV.IntVal = Result; - Args.push_back(ResultGV); - EE->runFunction(Exit, Args); - - std::cerr << "ERROR: exit(" << Result << ") returned!\n"; abort(); } From reid at x10sys.com Wed Dec 29 23:36:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/extract/extract.cpp Message-ID: <200412300536.XAA23168@zion.cs.uiuc.edu> Changes in directory llvm/tools/extract: extract.cpp updated: 1.25 -> 1.26 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+51 -44) Index: llvm/tools/extract/extract.cpp diff -u llvm/tools/extract/extract.cpp:1.25 llvm/tools/extract/extract.cpp:1.26 --- llvm/tools/extract/extract.cpp:1.25 Wed Sep 1 17:55:37 2004 +++ llvm/tools/extract/extract.cpp Wed Dec 29 23:36:07 2004 @@ -45,53 +45,60 @@ cl::value_desc("function")); int main(int argc, char **argv) { - cl::ParseCommandLineOptions(argc, argv, " llvm extractor\n"); - sys::PrintStackTraceOnErrorSignal(); - - std::auto_ptr M(ParseBytecodeFile(InputFilename)); - if (M.get() == 0) { - std::cerr << argv[0] << ": bytecode didn't read correctly.\n"; - return 1; - } - - // Figure out which function we should extract - Function *F = M.get()->getNamedFunction(ExtractFunc); - if (F == 0) { - std::cerr << argv[0] << ": program doesn't contain function named '" - << ExtractFunc << "'!\n"; - return 1; - } + try { + cl::ParseCommandLineOptions(argc, argv, " llvm extractor\n"); + sys::PrintStackTraceOnErrorSignal(); + + std::auto_ptr M(ParseBytecodeFile(InputFilename)); + if (M.get() == 0) { + std::cerr << argv[0] << ": bytecode didn't read correctly.\n"; + return 1; + } - // In addition to deleting all other functions, we also want to spiff it up a - // little bit. Do this now. - // - PassManager Passes; - Passes.add(new TargetData("extract", M.get())); // Use correct TargetData - // Either isolate the function or delete it from the Module - Passes.add(createFunctionExtractionPass(F, DeleteFn)); - Passes.add(createGlobalDCEPass()); // Delete unreachable globals - Passes.add(createFunctionResolvingPass()); // Delete prototypes - Passes.add(createDeadTypeEliminationPass()); // Remove dead types... - - std::ostream *Out = 0; - - if (OutputFilename != "-") { // Not stdout? - if (!Force && std::ifstream(OutputFilename.c_str())) { - // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename - << "': file exists!\n" - << "Use -f command line argument to force output\n"; + // Figure out which function we should extract + Function *F = M.get()->getNamedFunction(ExtractFunc); + if (F == 0) { + std::cerr << argv[0] << ": program doesn't contain function named '" + << ExtractFunc << "'!\n"; return 1; } - Out = new std::ofstream(OutputFilename.c_str()); - } else { // Specified stdout - Out = &std::cout; - } - Passes.add(new WriteBytecodePass(Out)); // Write bytecode to file... - Passes.run(*M.get()); + // In addition to deleting all other functions, we also want to spiff it up a + // little bit. Do this now. + // + PassManager Passes; + Passes.add(new TargetData("extract", M.get())); // Use correct TargetData + // Either isolate the function or delete it from the Module + Passes.add(createFunctionExtractionPass(F, DeleteFn)); + Passes.add(createGlobalDCEPass()); // Delete unreachable globals + Passes.add(createFunctionResolvingPass()); // Delete prototypes + Passes.add(createDeadTypeEliminationPass()); // Remove dead types... + + std::ostream *Out = 0; + + if (OutputFilename != "-") { // Not stdout? + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + std::cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists!\n" + << "Use -f command line argument to force output\n"; + return 1; + } + Out = new std::ofstream(OutputFilename.c_str()); + } else { // Specified stdout + Out = &std::cout; + } - if (Out != &std::cout) - delete Out; - return 0; + Passes.add(new WriteBytecodePass(Out)); // Write bytecode to file... + Passes.run(*M.get()); + + if (Out != &std::cout) + delete Out; + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + } + return 1; } From reid at x10sys.com Wed Dec 29 23:36:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-prof/llvm-prof.cpp Message-ID: <200412300536.XAA23186@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-prof: llvm-prof.cpp updated: 1.23 -> 1.24 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+112 -105) Index: llvm/tools/llvm-prof/llvm-prof.cpp diff -u llvm/tools/llvm-prof/llvm-prof.cpp:1.23 llvm/tools/llvm-prof/llvm-prof.cpp:1.24 --- llvm/tools/llvm-prof/llvm-prof.cpp:1.23 Wed Sep 1 17:55:37 2004 +++ llvm/tools/llvm-prof/llvm-prof.cpp Wed Dec 29 23:36:08 2004 @@ -107,124 +107,131 @@ int main(int argc, char **argv) { - cl::ParseCommandLineOptions(argc, argv, " llvm profile dump decoder\n"); - sys::PrintStackTraceOnErrorSignal(); - - // Read in the bytecode file... - std::string ErrorMessage; - Module *M = ParseBytecodeFile(BytecodeFile, &ErrorMessage); - if (M == 0) { - std::cerr << argv[0] << ": " << BytecodeFile << ": " << ErrorMessage - << "\n"; - return 1; - } - - // Read the profiling information - ProfileInfoLoader PI(argv[0], ProfileDataFile, *M); - - std::map FuncFreqs; - std::map BlockFreqs; - std::map EdgeFreqs; - - // Output a report. Eventually, there will be multiple reports selectable on - // the command line, for now, just keep things simple. - - // Emit the most frequent function table... - std::vector > FunctionCounts; - PI.getFunctionCounts(FunctionCounts); - FuncFreqs.insert(FunctionCounts.begin(), FunctionCounts.end()); - - // Sort by the frequency, backwards. - std::sort(FunctionCounts.begin(), FunctionCounts.end(), - PairSecondSortReverse()); - - unsigned long long TotalExecutions = 0; - for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) - TotalExecutions += FunctionCounts[i].second; - - std::cout << "===" << std::string(73, '-') << "===\n" - << "LLVM profiling output for execution"; - if (PI.getNumExecutions() != 1) std::cout << "s"; - std::cout << ":\n"; - - for (unsigned i = 0, e = PI.getNumExecutions(); i != e; ++i) { - std::cout << " "; - if (e != 1) std::cout << i+1 << ". "; - std::cout << PI.getExecution(i) << "\n"; - } - - std::cout << "\n===" << std::string(73, '-') << "===\n"; - std::cout << "Function execution frequencies:\n\n"; - - // Print out the function frequencies... - printf(" ## Frequency\n"); - for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) { - if (FunctionCounts[i].second == 0) { - printf("\n NOTE: %d function%s never executed!\n", - e-i, e-i-1 ? "s were" : " was"); - break; + try { + cl::ParseCommandLineOptions(argc, argv, " llvm profile dump decoder\n"); + sys::PrintStackTraceOnErrorSignal(); + + // Read in the bytecode file... + std::string ErrorMessage; + Module *M = ParseBytecodeFile(BytecodeFile, &ErrorMessage); + if (M == 0) { + std::cerr << argv[0] << ": " << BytecodeFile << ": " << ErrorMessage + << "\n"; + return 1; } - printf("%3d. %5u/%llu %s\n", i+1, FunctionCounts[i].second, TotalExecutions, - FunctionCounts[i].first->getName().c_str()); - } + // Read the profiling information + ProfileInfoLoader PI(argv[0], ProfileDataFile, *M); - std::set FunctionsToPrint; - - // If we have block count information, print out the LLVM module with - // frequency annotations. - if (PI.hasAccurateBlockCounts()) { - std::vector > Counts; - PI.getBlockCounts(Counts); - - TotalExecutions = 0; - for (unsigned i = 0, e = Counts.size(); i != e; ++i) - TotalExecutions += Counts[i].second; + std::map FuncFreqs; + std::map BlockFreqs; + std::map EdgeFreqs; + + // Output a report. Eventually, there will be multiple reports selectable on + // the command line, for now, just keep things simple. + + // Emit the most frequent function table... + std::vector > FunctionCounts; + PI.getFunctionCounts(FunctionCounts); + FuncFreqs.insert(FunctionCounts.begin(), FunctionCounts.end()); // Sort by the frequency, backwards. - std::sort(Counts.begin(), Counts.end(), - PairSecondSortReverse()); + std::sort(FunctionCounts.begin(), FunctionCounts.end(), + PairSecondSortReverse()); + + unsigned long long TotalExecutions = 0; + for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) + TotalExecutions += FunctionCounts[i].second; + + std::cout << "===" << std::string(73, '-') << "===\n" + << "LLVM profiling output for execution"; + if (PI.getNumExecutions() != 1) std::cout << "s"; + std::cout << ":\n"; + + for (unsigned i = 0, e = PI.getNumExecutions(); i != e; ++i) { + std::cout << " "; + if (e != 1) std::cout << i+1 << ". "; + std::cout << PI.getExecution(i) << "\n"; + } std::cout << "\n===" << std::string(73, '-') << "===\n"; - std::cout << "Top 20 most frequently executed basic blocks:\n\n"; + std::cout << "Function execution frequencies:\n\n"; // Print out the function frequencies... - printf(" ## %%%% \tFrequency\n"); - unsigned BlocksToPrint = Counts.size(); - if (BlocksToPrint > 20) BlocksToPrint = 20; - for (unsigned i = 0; i != BlocksToPrint; ++i) { - if (Counts[i].second == 0) break; - Function *F = Counts[i].first->getParent(); - printf("%3d. %5.2f%% %5u/%llu\t%s() - %s\n", i+1, - Counts[i].second/(double)TotalExecutions*100, - Counts[i].second, TotalExecutions, - F->getName().c_str(), Counts[i].first->getName().c_str()); - FunctionsToPrint.insert(F); + printf(" ## Frequency\n"); + for (unsigned i = 0, e = FunctionCounts.size(); i != e; ++i) { + if (FunctionCounts[i].second == 0) { + printf("\n NOTE: %d function%s never executed!\n", + e-i, e-i-1 ? "s were" : " was"); + break; + } + + printf("%3d. %5u/%llu %s\n", i+1, FunctionCounts[i].second, TotalExecutions, + FunctionCounts[i].first->getName().c_str()); } - BlockFreqs.insert(Counts.begin(), Counts.end()); - } - - if (PI.hasAccurateEdgeCounts()) { - std::vector > Counts; - PI.getEdgeCounts(Counts); - EdgeFreqs.insert(Counts.begin(), Counts.end()); - } + std::set FunctionsToPrint; - if (PrintAnnotatedLLVM || PrintAllCode) { - std::cout << "\n===" << std::string(73, '-') << "===\n"; - std::cout << "Annotated LLVM code for the module:\n\n"; + // If we have block count information, print out the LLVM module with + // frequency annotations. + if (PI.hasAccurateBlockCounts()) { + std::vector > Counts; + PI.getBlockCounts(Counts); + + TotalExecutions = 0; + for (unsigned i = 0, e = Counts.size(); i != e; ++i) + TotalExecutions += Counts[i].second; + + // Sort by the frequency, backwards. + std::sort(Counts.begin(), Counts.end(), + PairSecondSortReverse()); + + std::cout << "\n===" << std::string(73, '-') << "===\n"; + std::cout << "Top 20 most frequently executed basic blocks:\n\n"; + + // Print out the function frequencies... + printf(" ## %%%% \tFrequency\n"); + unsigned BlocksToPrint = Counts.size(); + if (BlocksToPrint > 20) BlocksToPrint = 20; + for (unsigned i = 0; i != BlocksToPrint; ++i) { + if (Counts[i].second == 0) break; + Function *F = Counts[i].first->getParent(); + printf("%3d. %5.2f%% %5u/%llu\t%s() - %s\n", i+1, + Counts[i].second/(double)TotalExecutions*100, + Counts[i].second, TotalExecutions, + F->getName().c_str(), Counts[i].first->getName().c_str()); + FunctionsToPrint.insert(F); + } + + BlockFreqs.insert(Counts.begin(), Counts.end()); + } - ProfileAnnotator PA(FuncFreqs, BlockFreqs, EdgeFreqs); + if (PI.hasAccurateEdgeCounts()) { + std::vector > Counts; + PI.getEdgeCounts(Counts); + EdgeFreqs.insert(Counts.begin(), Counts.end()); + } - if (FunctionsToPrint.empty() || PrintAllCode) - M->print(std::cout, &PA); - else - // Print just a subset of the functions... - for (std::set::iterator I = FunctionsToPrint.begin(), - E = FunctionsToPrint.end(); I != E; ++I) - (*I)->print(std::cout, &PA); - } + if (PrintAnnotatedLLVM || PrintAllCode) { + std::cout << "\n===" << std::string(73, '-') << "===\n"; + std::cout << "Annotated LLVM code for the module:\n\n"; + + ProfileAnnotator PA(FuncFreqs, BlockFreqs, EdgeFreqs); + + if (FunctionsToPrint.empty() || PrintAllCode) + M->print(std::cout, &PA); + else + // Print just a subset of the functions... + for (std::set::iterator I = FunctionsToPrint.begin(), + E = FunctionsToPrint.end(); I != E; ++I) + (*I)->print(std::cout, &PA); + } - return 0; + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + } + return 1; } From reid at x10sys.com Wed Dec 29 23:36:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:22 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/llvmc.cpp Message-ID: <200412300536.XAA23169@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: llvmc.cpp updated: 1.21 -> 1.22 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+1 -0) Index: llvm/tools/llvmc/llvmc.cpp diff -u llvm/tools/llvmc/llvmc.cpp:1.21 llvm/tools/llvmc/llvmc.cpp:1.22 --- llvm/tools/llvmc/llvmc.cpp:1.21 Fri Dec 10 18:14:15 2004 +++ llvm/tools/llvmc/llvmc.cpp Wed Dec 29 23:36:08 2004 @@ -368,4 +368,5 @@ } catch (...) { std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } + return 1; } From reid at x10sys.com Wed Dec 29 23:36:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-dis/llvm-dis.cpp Message-ID: <200412300536.XAA23185@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-dis: llvm-dis.cpp updated: 1.47 -> 1.48 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+74 -67) Index: llvm/tools/llvm-dis/llvm-dis.cpp diff -u llvm/tools/llvm-dis/llvm-dis.cpp:1.47 llvm/tools/llvm-dis/llvm-dis.cpp:1.48 --- llvm/tools/llvm-dis/llvm-dis.cpp:1.47 Sun Nov 14 16:21:57 2004 +++ llvm/tools/llvm-dis/llvm-dis.cpp Wed Dec 29 23:36:07 2004 @@ -41,81 +41,88 @@ CWriteMode("c", cl::desc("Obsolete option, do not use"), cl::ReallyHidden); int main(int argc, char **argv) { - cl::ParseCommandLineOptions(argc, argv, " llvm .bc -> .ll disassembler\n"); - sys::PrintStackTraceOnErrorSignal(); - - std::ostream *Out = &std::cout; // Default to printing to stdout... - std::string ErrorMessage; - - if (CWriteMode) { - std::cerr << "ERROR: llvm-dis no longer contains the C backend. " - << "Use 'llc -march=c' instead!\n"; - exit(1); - } + try { + cl::ParseCommandLineOptions(argc, argv, " llvm .bc -> .ll disassembler\n"); + sys::PrintStackTraceOnErrorSignal(); + + std::ostream *Out = &std::cout; // Default to printing to stdout... + std::string ErrorMessage; + + if (CWriteMode) { + std::cerr << "ERROR: llvm-dis no longer contains the C backend. " + << "Use 'llc -march=c' instead!\n"; + exit(1); + } - std::auto_ptr M(ParseBytecodeFile(InputFilename, &ErrorMessage)); - if (M.get() == 0) { - std::cerr << argv[0] << ": "; - if (ErrorMessage.size()) - std::cerr << ErrorMessage << "\n"; - else - std::cerr << "bytecode didn't read correctly.\n"; - return 1; - } - - if (OutputFilename != "") { // Specified an output filename? - if (OutputFilename != "-") { // Not stdout? - if (!Force && std::ifstream(OutputFilename.c_str())) { - // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename - << "': file exists! Sending to standard output.\n"; - } else { - Out = new std::ofstream(OutputFilename.c_str()); - } + std::auto_ptr M(ParseBytecodeFile(InputFilename, &ErrorMessage)); + if (M.get() == 0) { + std::cerr << argv[0] << ": "; + if (ErrorMessage.size()) + std::cerr << ErrorMessage << "\n"; + else + std::cerr << "bytecode didn't read correctly.\n"; + return 1; } - } else { - if (InputFilename == "-") { - OutputFilename = "-"; - } else { - std::string IFN = InputFilename; - int Len = IFN.length(); - if (IFN[Len-3] == '.' && IFN[Len-2] == 'b' && IFN[Len-1] == 'c') { - // Source ends in .bc - OutputFilename = std::string(IFN.begin(), IFN.end()-3)+".ll"; - } else { - OutputFilename = IFN+".ll"; + + if (OutputFilename != "") { // Specified an output filename? + if (OutputFilename != "-") { // Not stdout? + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + std::cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists! Sending to standard output.\n"; + } else { + Out = new std::ofstream(OutputFilename.c_str()); + } } - - if (!Force && std::ifstream(OutputFilename.c_str())) { - // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename - << "': file exists! Sending to standard output.\n"; + } else { + if (InputFilename == "-") { + OutputFilename = "-"; } else { - Out = new std::ofstream(OutputFilename.c_str()); - - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + std::string IFN = InputFilename; + int Len = IFN.length(); + if (IFN[Len-3] == '.' && IFN[Len-2] == 'b' && IFN[Len-1] == 'c') { + // Source ends in .bc + OutputFilename = std::string(IFN.begin(), IFN.end()-3)+".ll"; + } else { + OutputFilename = IFN+".ll"; + } + + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + std::cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists! Sending to standard output.\n"; + } else { + Out = new std::ofstream(OutputFilename.c_str()); + + // Make sure that the Out file gets unlinked from the disk if we get a + // SIGINT + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + } } } - } - if (!Out->good()) { - std::cerr << argv[0] << ": error opening " << OutputFilename - << ": sending to stdout instead!\n"; - Out = &std::cout; - } + if (!Out->good()) { + std::cerr << argv[0] << ": error opening " << OutputFilename + << ": sending to stdout instead!\n"; + Out = &std::cout; + } - // All that dis does is write the assembly or C out to a file... - // - PassManager Passes; - Passes.add(new PrintModulePass(Out)); - Passes.run(*M.get()); - - if (Out != &std::cout) { - ((std::ofstream*)Out)->close(); - delete Out; + // All that dis does is write the assembly or C out to a file... + // + PassManager Passes; + Passes.add(new PrintModulePass(Out)); + Passes.run(*M.get()); + + if (Out != &std::cout) { + ((std::ofstream*)Out)->close(); + delete Out; + } + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } - return 0; + return 1; } From reid at x10sys.com Wed Dec 29 23:36:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/bugpoint.cpp Message-ID: <200412300536.XAA23197@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: bugpoint.cpp updated: 1.22 -> 1.23 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+3 -2) Index: llvm/tools/bugpoint/bugpoint.cpp diff -u llvm/tools/bugpoint/bugpoint.cpp:1.22 llvm/tools/bugpoint/bugpoint.cpp:1.23 --- llvm/tools/bugpoint/bugpoint.cpp:1.22 Mon Dec 27 00:18:02 2004 +++ llvm/tools/bugpoint/bugpoint.cpp Wed Dec 29 23:36:07 2004 @@ -51,10 +51,11 @@ return D.run(); } catch (ToolExecutionError &TEE) { std::cerr << "Tool execution error: " << TEE.what() << '\n'; - return 1; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; } catch (...) { std::cerr << "Whoops, an exception leaked out of bugpoint. " << "This is a bug in bugpoint!\n"; - return 1; } + return 1; } From reid at x10sys.com Wed Dec 29 23:36:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llc/llc.cpp Message-ID: <200412300536.XAA23182@zion.cs.uiuc.edu> Changes in directory llvm/tools/llc: llc.cpp updated: 1.103 -> 1.104 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+100 -93) Index: llvm/tools/llc/llc.cpp diff -u llvm/tools/llc/llc.cpp:1.103 llvm/tools/llc/llc.cpp:1.104 --- llvm/tools/llc/llc.cpp:1.103 Sun Nov 14 16:18:35 2004 +++ llvm/tools/llc/llc.cpp Wed Dec 29 23:36:07 2004 @@ -63,110 +63,117 @@ // main - Entry point for the llc compiler. // int main(int argc, char **argv) { - cl::ParseCommandLineOptions(argc, argv, " llvm system compiler\n"); - sys::PrintStackTraceOnErrorSignal(); - - // Load the module to be compiled... - std::auto_ptr M(ParseBytecodeFile(InputFilename)); - if (M.get() == 0) { - std::cerr << argv[0] << ": bytecode didn't read correctly.\n"; - return 1; - } - Module &mod = *M.get(); - - // Allocate target machine. First, check whether the user has - // explicitly specified an architecture to compile for. - TargetMachine* (*TargetMachineAllocator)(const Module&, - IntrinsicLowering *) = 0; - if (MArch == 0) { - std::string Err; - MArch = TargetMachineRegistry::getClosestStaticTargetForModule(mod, Err); - if (MArch == 0) { - std::cerr << argv[0] << ": error auto-selecting target for module '" - << Err << "'. Please use the -march option to explicitly " - << "pick a target.\n"; + try { + cl::ParseCommandLineOptions(argc, argv, " llvm system compiler\n"); + sys::PrintStackTraceOnErrorSignal(); + + // Load the module to be compiled... + std::auto_ptr M(ParseBytecodeFile(InputFilename)); + if (M.get() == 0) { + std::cerr << argv[0] << ": bytecode didn't read correctly.\n"; return 1; } - } + Module &mod = *M.get(); - std::auto_ptr target(MArch->CtorFn(mod, 0)); - assert(target.get() && "Could not allocate target machine!"); - TargetMachine &Target = *target.get(); - const TargetData &TD = Target.getTargetData(); - - // Build up all of the passes that we want to do to the module... - PassManager Passes; - Passes.add(new TargetData("llc", TD.isLittleEndian(), TD.getPointerSize(), - TD.getPointerAlignment(), TD.getDoubleAlignment())); - - // Figure out where we are going to send the output... - std::ostream *Out = 0; - if (OutputFilename != "") { - if (OutputFilename != "-") { - // Specified an output filename? - if (!Force && std::ifstream(OutputFilename.c_str())) { - // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename - << "': file exists!\n" - << "Use -f command line argument to force output\n"; + // Allocate target machine. First, check whether the user has + // explicitly specified an architecture to compile for. + TargetMachine* (*TargetMachineAllocator)(const Module&, + IntrinsicLowering *) = 0; + if (MArch == 0) { + std::string Err; + MArch = TargetMachineRegistry::getClosestStaticTargetForModule(mod, Err); + if (MArch == 0) { + std::cerr << argv[0] << ": error auto-selecting target for module '" + << Err << "'. Please use the -march option to explicitly " + << "pick a target.\n"; return 1; } - Out = new std::ofstream(OutputFilename.c_str()); - - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - } else { - Out = &std::cout; } - } else { - if (InputFilename == "-") { - OutputFilename = "-"; - Out = &std::cout; - } else { - OutputFilename = GetFileNameRoot(InputFilename); - if (MArch->Name[0] != 'c' || MArch->Name[1] != 0) // not CBE - OutputFilename += ".s"; - else - OutputFilename += ".cbe.c"; - - if (!Force && std::ifstream(OutputFilename.c_str())) { - // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename - << "': file exists!\n" - << "Use -f command line argument to force output\n"; - return 1; + std::auto_ptr target(MArch->CtorFn(mod, 0)); + assert(target.get() && "Could not allocate target machine!"); + TargetMachine &Target = *target.get(); + const TargetData &TD = Target.getTargetData(); + + // Build up all of the passes that we want to do to the module... + PassManager Passes; + Passes.add(new TargetData("llc", TD.isLittleEndian(), TD.getPointerSize(), + TD.getPointerAlignment(), TD.getDoubleAlignment())); + + // Figure out where we are going to send the output... + std::ostream *Out = 0; + if (OutputFilename != "") { + if (OutputFilename != "-") { + // Specified an output filename? + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + std::cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists!\n" + << "Use -f command line argument to force output\n"; + return 1; + } + Out = new std::ofstream(OutputFilename.c_str()); + + // Make sure that the Out file gets unlinked from the disk if we get a + // SIGINT + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); + } else { + Out = &std::cout; } - - Out = new std::ofstream(OutputFilename.c_str()); - if (!Out->good()) { - std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; - delete Out; - return 1; + } else { + if (InputFilename == "-") { + OutputFilename = "-"; + Out = &std::cout; + } else { + OutputFilename = GetFileNameRoot(InputFilename); + + if (MArch->Name[0] != 'c' || MArch->Name[1] != 0) // not CBE + OutputFilename += ".s"; + else + OutputFilename += ".cbe.c"; + + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + std::cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists!\n" + << "Use -f command line argument to force output\n"; + return 1; + } + + Out = new std::ofstream(OutputFilename.c_str()); + if (!Out->good()) { + std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n"; + delete Out; + return 1; + } + + // Make sure that the Out file gets unlinked from the disk if we get a + // SIGINT + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); } - - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); } - } - // Ask the target to add backend passes as necessary - if (Target.addPassesToEmitAssembly(Passes, *Out)) { - std::cerr << argv[0] << ": target '" << Target.getName() - << "' does not support static compilation!\n"; - if (Out != &std::cout) delete Out; - // And the Out file is empty and useless, so remove it now. - std::remove(OutputFilename.c_str()); - return 1; - } else { - // Run our queue of passes all at once now, efficiently. - Passes.run(*M.get()); - } + // Ask the target to add backend passes as necessary + if (Target.addPassesToEmitAssembly(Passes, *Out)) { + std::cerr << argv[0] << ": target '" << Target.getName() + << "' does not support static compilation!\n"; + if (Out != &std::cout) delete Out; + // And the Out file is empty and useless, so remove it now. + std::remove(OutputFilename.c_str()); + return 1; + } else { + // Run our queue of passes all at once now, efficiently. + Passes.run(*M.get()); + } - // Delete the ostream if it's not a stdout stream - if (Out != &std::cout) delete Out; + // Delete the ostream if it's not a stdout stream + if (Out != &std::cout) delete Out; - return 0; + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + } + return 1; } From reid at x10sys.com Wed Dec 29 23:36:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/analyze/analyze.cpp Message-ID: <200412300536.XAA23191@zion.cs.uiuc.edu> Changes in directory llvm/tools/analyze: analyze.cpp updated: 1.62 -> 1.63 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+54 -46) Index: llvm/tools/analyze/analyze.cpp diff -u llvm/tools/analyze/analyze.cpp:1.62 llvm/tools/analyze/analyze.cpp:1.63 --- llvm/tools/analyze/analyze.cpp:1.62 Sun Sep 19 23:48:03 2004 +++ llvm/tools/analyze/analyze.cpp Wed Dec 29 23:36:07 2004 @@ -116,58 +116,66 @@ } int main(int argc, char **argv) { - cl::ParseCommandLineOptions(argc, argv, " llvm analysis printer tool\n"); - sys::PrintStackTraceOnErrorSignal(); - - Module *CurMod = 0; try { + cl::ParseCommandLineOptions(argc, argv, " llvm analysis printer tool\n"); + sys::PrintStackTraceOnErrorSignal(); + + Module *CurMod = 0; + try { #if 0 - TimeRegion RegionTimer(BytecodeLoadTimer); + TimeRegion RegionTimer(BytecodeLoadTimer); #endif - CurMod = ParseBytecodeFile(InputFilename); - if (!CurMod && !(CurMod = ParseAssemblyFile(InputFilename))){ - std::cerr << argv[0] << ": input file didn't read correctly.\n"; + CurMod = ParseBytecodeFile(InputFilename); + if (!CurMod && !(CurMod = ParseAssemblyFile(InputFilename))){ + std::cerr << argv[0] << ": input file didn't read correctly.\n"; + return 1; + } + } catch (const ParseException &E) { + std::cerr << argv[0] << ": " << E.getMessage() << "\n"; return 1; } - } catch (const ParseException &E) { - std::cerr << argv[0] << ": " << E.getMessage() << "\n"; - return 1; - } - // Create a PassManager to hold and optimize the collection of passes we are - // about to build... - // - PassManager Passes; - - // Add an appropriate TargetData instance for this module... - Passes.add(new TargetData("analyze", CurMod)); - - // Make sure the input LLVM is well formed. - if (!NoVerify) - Passes.add(createVerifierPass()); - - // Create a new optimization pass for each one specified on the command line - for (unsigned i = 0; i < AnalysesList.size(); ++i) { - const PassInfo *Analysis = AnalysesList[i]; - - if (Analysis->getNormalCtor()) { - Pass *P = Analysis->getNormalCtor()(); - Passes.add(P); - - if (BasicBlockPass *BBP = dynamic_cast(P)) - Passes.add(new BasicBlockPassPrinter(Analysis)); - else if (FunctionPass *FP = dynamic_cast(P)) - Passes.add(new FunctionPassPrinter(Analysis)); - else - Passes.add(new ModulePassPrinter(Analysis)); - - } else - std::cerr << argv[0] << ": cannot create pass: " - << Analysis->getPassName() << "\n"; - } + // Create a PassManager to hold and optimize the collection of passes we are + // about to build... + // + PassManager Passes; + + // Add an appropriate TargetData instance for this module... + Passes.add(new TargetData("analyze", CurMod)); + + // Make sure the input LLVM is well formed. + if (!NoVerify) + Passes.add(createVerifierPass()); + + // Create a new optimization pass for each one specified on the command line + for (unsigned i = 0; i < AnalysesList.size(); ++i) { + const PassInfo *Analysis = AnalysesList[i]; + + if (Analysis->getNormalCtor()) { + Pass *P = Analysis->getNormalCtor()(); + Passes.add(P); + + if (BasicBlockPass *BBP = dynamic_cast(P)) + Passes.add(new BasicBlockPassPrinter(Analysis)); + else if (FunctionPass *FP = dynamic_cast(P)) + Passes.add(new FunctionPassPrinter(Analysis)); + else + Passes.add(new ModulePassPrinter(Analysis)); + + } else + std::cerr << argv[0] << ": cannot create pass: " + << Analysis->getPassName() << "\n"; + } + + Passes.run(*CurMod); - Passes.run(*CurMod); + delete CurMod; + return 0; - delete CurMod; - return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + } + return 1; } From reid at x10sys.com Wed Dec 29 23:36:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-link/llvm-link.cpp Message-ID: <200412300536.XAA23203@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-link: llvm-link.cpp updated: 1.52 -> 1.53 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+58 -51) Index: llvm/tools/llvm-link/llvm-link.cpp diff -u llvm/tools/llvm-link/llvm-link.cpp:1.52 llvm/tools/llvm-link/llvm-link.cpp:1.53 --- llvm/tools/llvm-link/llvm-link.cpp:1.52 Sun Dec 12 21:01:03 2004 +++ llvm/tools/llvm-link/llvm-link.cpp Wed Dec 29 23:36:07 2004 @@ -75,70 +75,77 @@ } int main(int argc, char **argv) { - cl::ParseCommandLineOptions(argc, argv, " llvm linker\n"); - sys::PrintStackTraceOnErrorSignal(); - assert(InputFilenames.size() > 0 && "OneOrMore is not working"); - - unsigned BaseArg = 0; - std::string ErrorMessage; - - std::auto_ptr Composite(LoadFile(InputFilenames[BaseArg])); - if (Composite.get() == 0) { - std::cerr << argv[0] << ": error loading file '" - << InputFilenames[BaseArg] << "'\n"; - return 1; - } + try { + cl::ParseCommandLineOptions(argc, argv, " llvm linker\n"); + sys::PrintStackTraceOnErrorSignal(); + assert(InputFilenames.size() > 0 && "OneOrMore is not working"); + + unsigned BaseArg = 0; + std::string ErrorMessage; - for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) { - std::auto_ptr M(LoadFile(InputFilenames[i])); - if (M.get() == 0) { + std::auto_ptr Composite(LoadFile(InputFilenames[BaseArg])); + if (Composite.get() == 0) { std::cerr << argv[0] << ": error loading file '" - << InputFilenames[i] << "'\n"; + << InputFilenames[BaseArg] << "'\n"; return 1; } - if (Verbose) std::cerr << "Linking in '" << InputFilenames[i] << "'\n"; - - if (Linker::LinkModules(Composite.get(), M.get(), &ErrorMessage)) { - std::cerr << argv[0] << ": link error in '" << InputFilenames[i] - << "': " << ErrorMessage << "\n"; - return 1; + for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) { + std::auto_ptr M(LoadFile(InputFilenames[i])); + if (M.get() == 0) { + std::cerr << argv[0] << ": error loading file '" + << InputFilenames[i] << "'\n"; + return 1; + } + + if (Verbose) std::cerr << "Linking in '" << InputFilenames[i] << "'\n"; + + if (Linker::LinkModules(Composite.get(), M.get(), &ErrorMessage)) { + std::cerr << argv[0] << ": link error in '" << InputFilenames[i] + << "': " << ErrorMessage << "\n"; + return 1; + } } - } - // TODO: Iterate over the -l list and link in any modules containing - // global symbols that have not been resolved so far. + // TODO: Iterate over the -l list and link in any modules containing + // global symbols that have not been resolved so far. - if (DumpAsm) std::cerr << "Here's the assembly:\n" << Composite.get(); + if (DumpAsm) std::cerr << "Here's the assembly:\n" << Composite.get(); - std::ostream *Out = &std::cout; // Default to printing to stdout... - if (OutputFilename != "-") { - if (!Force && std::ifstream(OutputFilename.c_str())) { - // If force is not specified, make sure not to overwrite a file! - std::cerr << argv[0] << ": error opening '" << OutputFilename - << "': file exists!\n" - << "Use -f command line argument to force output\n"; - return 1; + std::ostream *Out = &std::cout; // Default to printing to stdout... + if (OutputFilename != "-") { + if (!Force && std::ifstream(OutputFilename.c_str())) { + // If force is not specified, make sure not to overwrite a file! + std::cerr << argv[0] << ": error opening '" << OutputFilename + << "': file exists!\n" + << "Use -f command line argument to force output\n"; + return 1; + } + Out = new std::ofstream(OutputFilename.c_str()); + if (!Out->good()) { + std::cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n"; + return 1; + } + + // Make sure that the Out file gets unlinked from the disk if we get a + // SIGINT + sys::RemoveFileOnSignal(sys::Path(OutputFilename)); } - Out = new std::ofstream(OutputFilename.c_str()); - if (!Out->good()) { - std::cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n"; + + if (verifyModule(*Composite.get())) { + std::cerr << argv[0] << ": linked module is broken!\n"; return 1; } - // Make sure that the Out file gets unlinked from the disk if we get a - // SIGINT - sys::RemoveFileOnSignal(sys::Path(OutputFilename)); - } + if (Verbose) std::cerr << "Writing bytecode...\n"; + WriteBytecodeToFile(Composite.get(), *Out, !NoCompress); - if (verifyModule(*Composite.get())) { - std::cerr << argv[0] << ": linked module is broken!\n"; - return 1; + if (Out != &std::cout) delete Out; + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } - - if (Verbose) std::cerr << "Writing bytecode...\n"; - WriteBytecodeToFile(Composite.get(), *Out, !NoCompress); - - if (Out != &std::cout) delete Out; - return 0; + return 1; } From reid at x10sys.com Wed Dec 29 23:36:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp Message-ID: <200412300536.XAA23192@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.38 -> 1.39 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+9 -2) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.38 llvm/tools/llvm-as/llvm-as.cpp:1.39 --- llvm/tools/llvm-as/llvm-as.cpp:1.38 Sun Nov 14 16:20:53 2004 +++ llvm/tools/llvm-as/llvm-as.cpp Wed Dec 29 23:36:07 2004 @@ -52,6 +52,7 @@ cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n"); sys::PrintStackTraceOnErrorSignal(); + int exitCode = 0; std::ostream *Out = 0; try { // Parse the file now... @@ -126,10 +127,16 @@ WriteBytecodeToFile(M.get(), *Out, !NoCompress); } catch (const ParseException &E) { std::cerr << argv[0] << ": " << E.getMessage() << "\n"; - return 1; + exitCode = 1; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + exitCode = 1; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; + exitCode = 1; } if (Out != &std::cout) delete Out; - return 0; + return exitCode; } From reid at x10sys.com Wed Dec 29 23:36:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 29 Dec 2004 23:36:23 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Message-ID: <200412300536.XAA23200@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-bcanalyzer: llvm-bcanalyzer.cpp updated: 1.4 -> 1.5 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Place a try/catch block around the entire tool to Make sure std::string exceptions are caught and printed before exiting the tool. * Make sure we catch unhandled exceptions at the top level so that we don't abort with a useless message but indicate than an unhandled exception was generated. --- Diffs of the changes: (+47 -41) Index: llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp diff -u llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.4 llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.5 --- llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp:1.4 Wed Sep 1 17:55:37 2004 +++ llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp Wed Dec 29 23:36:07 2004 @@ -49,52 +49,58 @@ static cl::opt Verify ("verify", cl::desc("Progressively verify module")); int -main(int argc, char **argv) -{ - cl::ParseCommandLineOptions(argc, argv, - " llvm-bcanalyzer Analysis of ByteCode Dumper\n"); - - sys::PrintStackTraceOnErrorSignal(); - - std::ostream* Out = &std::cout; // Default to printing to stdout... - std::istream* In = &std::cin; // Default to reading stdin - std::string ErrorMessage; - BytecodeAnalysis bca; - - /// Determine what to generate - bca.detailedResults = !NoDetails; - bca.progressiveVerify = Verify; - - /// Analyze the bytecode file - Module* M = AnalyzeBytecodeFile(InputFilename, bca, &ErrorMessage, (Dump?Out:0)); - - // All that bcanalyzer does is write the gathered statistics to the output - PrintBytecodeAnalysis(bca,*Out); - - if ( M && Verify ) { - std::string verificationMsg; - try { - verifyModule( *M, ThrowExceptionAction ); - } catch (std::string& errmsg ) { - verificationMsg = errmsg; +main(int argc, char **argv) { + try { + cl::ParseCommandLineOptions(argc, argv, + " llvm-bcanalyzer Analysis of ByteCode Dumper\n"); + + sys::PrintStackTraceOnErrorSignal(); + + std::ostream* Out = &std::cout; // Default to printing to stdout... + std::istream* In = &std::cin; // Default to reading stdin + std::string ErrorMessage; + BytecodeAnalysis bca; + + /// Determine what to generate + bca.detailedResults = !NoDetails; + bca.progressiveVerify = Verify; + + /// Analyze the bytecode file + Module* M = AnalyzeBytecodeFile(InputFilename, bca, &ErrorMessage, (Dump?Out:0)); + + // All that bcanalyzer does is write the gathered statistics to the output + PrintBytecodeAnalysis(bca,*Out); + + if ( M && Verify ) { + std::string verificationMsg; + try { + verifyModule( *M, ThrowExceptionAction ); + } catch (std::string& errmsg ) { + verificationMsg = errmsg; + } + if ( verificationMsg.length() > 0 ) + std::cerr << "Final Verification Message: " << verificationMsg << "\n"; } - if ( verificationMsg.length() > 0 ) - std::cerr << "Final Verification Message: " << verificationMsg << "\n"; - } - // If there was an error, print it and stop. - if ( ErrorMessage.size() ) { - std::cerr << argv[0] << ": " << ErrorMessage << "\n"; - return 1; - } - + // If there was an error, print it and stop. + if ( ErrorMessage.size() ) { + std::cerr << argv[0] << ": " << ErrorMessage << "\n"; + return 1; + } + - if (Out != &std::cout) { - ((std::ofstream*)Out)->close(); - delete Out; + if (Out != &std::cout) { + ((std::ofstream*)Out)->close(); + delete Out; + } + return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; + } catch (...) { + std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n"; } - return 0; + return 1; } // vim: sw=2 From reid at x10sys.com Thu Dec 30 11:52:08 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Dec 2004 11:52:08 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ranlib/llvm-ranlib.cpp Message-ID: <200412301752.LAA20177@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ranlib: llvm-ranlib.cpp updated: 1.3 -> 1.4 --- Log message: Fix the help documentation to not imply multiple archive files can be processed. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-ranlib/llvm-ranlib.cpp diff -u llvm/tools/llvm-ranlib/llvm-ranlib.cpp:1.3 llvm/tools/llvm-ranlib/llvm-ranlib.cpp:1.4 --- llvm/tools/llvm-ranlib/llvm-ranlib.cpp:1.3 Tue Dec 14 19:53:50 2004 +++ llvm/tools/llvm-ranlib/llvm-ranlib.cpp Thu Dec 30 11:51:57 2004 @@ -22,7 +22,7 @@ // llvm-ar operation code and modifier flags static cl::opt -ArchiveName(cl::Positional, cl::Optional, cl::desc("...")); +ArchiveName(cl::Positional, cl::Optional, cl::desc("")); static cl::opt Verbose("verbose",cl::Optional,cl::init(false), From reid at x10sys.com Thu Dec 30 17:08:06 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Dec 2004 17:08:06 -0600 Subject: [llvm-commits] CVS: llvm/utils/GenLibDeps.pl Message-ID: <200412302308.RAA23356@zion.cs.uiuc.edu> Changes in directory llvm/utils: GenLibDeps.pl added (r1.1) --- Log message: A Perl script to generate an HTML definition list containing the LLVM library dependencies, for documentation purposes. --- Diffs of the changes: (+101 -0) Index: llvm/utils/GenLibDeps.pl diff -c /dev/null llvm/utils/GenLibDeps.pl:1.1 *** /dev/null Thu Dec 30 17:08:06 2004 --- llvm/utils/GenLibDeps.pl Thu Dec 30 17:07:56 2004 *************** *** 0 **** --- 1,101 ---- + #!/usr/bin/perl -w + # + # Program: GenLibDeps.pl + # + # Synopsis: Generate HTML output that shows the dependencies between a set of + # libraries. The output of this script should periodically replace + # the similar content in the UsingLibraries.html document. + # + # Syntax: GenLibDeps.pl + # + + # Give first option a name. + my $Directory = $ARGV[0]; + + # Open the directory and read its contents, sorting by name and differentiating + # by whether its a library (.a) or an object file (.o) + opendir DIR,$Directory; + my @files = readdir DIR; + closedir DIR; + @libs = grep(/libLLVM.*\.a$/,sort(@files)); + @objs = grep(/LLVM.*\.o$/,sort(@files)); + + # Declare the hashes we will use to keep track of the library and object file + # symbol definitions. + my %libdefs; + my %objdefs; + + # Gather definitions from the libraries + foreach $lib (@libs ) { + open DEFS, + "nm -g --defined-only $lib | grep ' [ABCDGRSTVW] ' | sed -e 's/^[0-9A-Fa-f]* [ABCDGRSTVW] //' | sort | uniq |"; + while () { + chomp($_); + $libdefs{$_} = $lib; + } + close DEFS; + } + + # Gather definitions from the object files. + foreach $obj (@objs ) { + open DEFS, + "nm -g --defined-only $obj | grep ' [ABCDGRST] ' | sed -e 's/^[0-9A-Fa-f]* [ABCDGRST] //' | sort | uniq |"; + while () { + chomp($_); + $objdefs{$_} = $obj; + } + close DEFS; + } + + # Generate one entry in the
        list. This generates the
        and
        elements + # for one library or object file. The
        provides the name of the library or + # object. The
        provides a list of the libraries/objects it depends on. + sub gen_one_entry { + my $lib = $_[0]; + print "
        $lib
        \n"; + open UNDEFS, + "nm -u $lib | grep ' U ' | sed -e 's/ U //' | sort | uniq |"; + open DEPENDS, + "| sort | uniq > GenLibDeps.out"; + while () { + chomp; + if (defined($libdefs{$_}) && $libdefs{$_} ne $lib) { + print DEPENDS "$libdefs{$_}\n"; + } elsif (defined($objdefs{$_}) && $objdefs{$_} ne $lib) { + $libroot = $lib; + $libroot =~ s/lib(.*).a/$1/; + if ($objdefs{$_} ne "$libroot.o") { + print DEPENDS "$objdefs{$_}\n"; + } + } + } + close UNDEFS; + close DEPENDS; + open DF, ") { + chomp; + print " $_\n"; + } + close DF; + print "
        \n"; + } + + # Make sure we flush on write. This is slower but correct based on the way we + # write I/O in gen_one_entry. + $| = 1; + + # Print the definition list tag + print "
        \n"; + + # Print libraries first + foreach $lib (@libs) { + gen_one_entry($lib); + } + + # Print objects second + foreach $obj (@objs) { + gen_one_entry($obj); + } + + # Print end tag of definition list element + print "
        \n"; From reid at x10sys.com Thu Dec 30 17:12:15 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 30 Dec 2004 17:12:15 -0600 Subject: [llvm-commits] CVS: llvm/docs/UsingLibraries.html Message-ID: <200412302312.RAA23443@zion.cs.uiuc.edu> Changes in directory llvm/docs: UsingLibraries.html updated: 1.14 -> 1.15 --- Log message: Add a section on library dependencies now that GenLibDeps.html is written. --- Diffs of the changes: (+296 -1) Index: llvm/docs/UsingLibraries.html diff -u llvm/docs/UsingLibraries.html:1.14 llvm/docs/UsingLibraries.html:1.15 --- llvm/docs/UsingLibraries.html:1.14 Sun Nov 7 18:26:32 2004 +++ llvm/docs/UsingLibraries.html Thu Dec 30 17:12:04 2004 @@ -10,6 +10,7 @@
      • Abstract
      • Introduction
      • Library Descriptions
      • +
      • Library Dependencies
      • Linkage Rules Of Thumb
        1. Always link LLVMCore, LLVMSupport, LLVMSystem @@ -149,6 +150,300 @@ +
          Library Dependencies
          +
          +

          The following list shows the dependency relationships between libraries. + This information can be automatically generated with the + GenLibDeps.pl utility in the llvm/utils directory.

          + + + + + +
          +
          libLLVMAnalysis.a
            +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          libLLVMArchive.a
            +
          • libLLVMSupport.a
          • +
          • libLLVMSystem.a
          • +
          • LLVMBCReader.o
          • +
          +
          libLLVMDataStructure.a
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          libLLVMInstrumentation.a
            +
          • libLLVMSupport.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          libLLVMLinker.a
            +
          • libLLVMArchive.a
          • +
          • libLLVMSystem.a
          • +
          • LLVMBCReader.o
          • +
          • LLVMCore.o
          • +
          +
          libLLVMScalarOpts.a
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          libLLVMSparcV9RegAlloc.a
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          • LLVMSparcV9LiveVar.o
          • +
          • LLVMSparcV9.o
          • +
          +
          libLLVMSupport.a
            +
          • libLLVMSystem.a
          • +
          • LLVMbzip2.o
          • +
          +
          libLLVMSystem.a
            +
          +
          libLLVMTarget.a
            +
          • libLLVMSupport.a
          • +
          • LLVMCore.o
          • +
          +
          libLLVMTransformUtils.a
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSupport.a
          • +
          • LLVMCore.o
          • +
          +
          libLLVMTransforms.a
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          libLLVMipa.a
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • LLVMCore.o
          • +
          +
          libLLVMipo.a
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMipa.a
          • +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMAnalysis.o
            +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMAsmParser.o
            +
          • LLVMCore.o
          • +
          +
          LLVMBCReader.o
            +
          • libLLVMSupport.a
          • +
          • libLLVMSystem.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMBCWriter.o
            +
          • libLLVMSupport.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMCBackend.o
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMipa.a
          • +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMCodeGen.o
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMCore.o
            +
          • libLLVMSupport.a
          • +
          +
          LLVMDataStructure.o
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMDebugger.o
            +
          • libLLVMSupport.a
          • +
          • libLLVMSystem.a
          • +
          • LLVMBCReader.o
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          • LLVMExecutionEngine.o
          • +
          +
          LLVMExecutionEngine.o
            +
          • libLLVMSupport.a
          • +
          • libLLVMSystem.a
          • +
          • libLLVMTarget.a
          • +
          • LLVMCore.o
          • +
          • LLVMInterpreter.o
          • +
          • LLVMJIT.o
          • +
          +
          LLVMInstrumentation.o
            +
          • libLLVMSupport.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMInterpreter.o
            +
          • libLLVMSupport.a
          • +
          • libLLVMSystem.a
          • +
          • libLLVMTarget.a
          • +
          • LLVMCore.o
          • +
          • LLVMExecutionEngine.o
          • +
          +
          LLVMJIT.o
            +
          • libLLVMSupport.a
          • +
          • libLLVMSystem.a
          • +
          • libLLVMTarget.a
          • +
          • LLVMCore.o
          • +
          • LLVMExecutionEngine.o
          • +
          +
          LLVMPowerPC.o
            +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          +
          LLVMProfilePaths.o
            +
          • libLLVMInstrumentation.a
          • +
          • libLLVMSupport.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMScalarOpts.o
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMSelectionDAG.o
            +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          +
          LLVMSkeleton.o
            +
          • libLLVMTarget.a
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          +
          LLVMSparcV8.o
            +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          +
          LLVMSparcV9.o
            +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSparcV9RegAlloc.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • LLVMBCWriter.o
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          • LLVMSparcV9InstrSched.o
          • +
          • LLVMSparcV9ModuloSched.o
          • +
          +
          LLVMSparcV9InstrSched.o
            +
          • libLLVMSupport.a
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          • LLVMSparcV9LiveVar.o
          • +
          • LLVMSparcV9.o
          • +
          +
          LLVMSparcV9LiveVar.o
            +
          • libLLVMSupport.a
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          +
          LLVMSparcV9ModuloSched.o
            +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          • LLVMSparcV9.o
          • +
          +
          LLVMSparcV9RegAlloc.o
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          • LLVMSparcV9LiveVar.o
          • +
          • LLVMSparcV9.o
          • +
          +
          LLVMSupport.o
            +
          • libLLVMSystem.a
          • +
          • LLVMbzip2.o
          • +
          +
          LLVMSystem.o
            +
          +
          LLVMTarget.o
            +
          • libLLVMSupport.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMTransformUtils.o
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSupport.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMTransforms.o
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMX86.o
            +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • LLVMCodeGen.o
          • +
          • LLVMCore.o
          • +
          +
          LLVMbzip2.o
            +
          +
          LLVMipa.o
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMSupport.a
          • +
          • LLVMCore.o
          • +
          +
          LLVMipo.o
            +
          • libLLVMAnalysis.a
          • +
          • libLLVMipa.a
          • +
          • libLLVMScalarOpts.a
          • +
          • libLLVMSupport.a
          • +
          • libLLVMTarget.a
          • +
          • libLLVMTransformUtils.a
          • +
          • LLVMCore.o
          • +
          +
          +
          + +

          This section contains various "rules of thumb" about what files you @@ -184,7 +479,7 @@ Reid Spencer The LLVM Compiler Infrastructure -
          Last modified: $Date: 2004/11/08 00:26:32 $

          +
          Last modified: $Date: 2004/12/30 23:12:04 $ - - - +

          If you are building LLVM and the GCC front-end under AIX, do NOT use GNU Binutils. They are not stable under AIX and may produce incorrect and/or @@ -103,17 +99,26 @@

            -
          1. Configure and build the LLVM libraries and tools using:

            -
            +
          2. Configure and build the LLVM libraries and tools. There are two ways to +do this: either with objdir == srcdir or not. It is recommended +that srcdir not be the same as objdir:

            +
              +
            • With objdir != srcdir:
              + % cd objdir
              + % srcdir/configure --prefix=/some/path/you/can/install/to [options...]
              + % gmake tools-only
              +  
            • +
            • With objdir == srcdir:
                % cd llvm
                % ./configure --prefix=/some/path/you/can/install/to [options...]
                % gmake tools-only
              -
              -

              This will build all of the LLVM tools and libraries. The --prefix - option defaults to /usr/local (per configure standards) but unless you are a - system administrator, you probably won't be able to install LLVM there because - of permissions. Specify a path into which LLVM can be installed (e.g. - --prefix=/home/user/llvm).

              +
          3. +
      +

      This will build all of the LLVM tools and libraries. The --prefix +option defaults to /usr/local (per configure standards) but unless you are a +system administrator, you probably won't be able to install LLVM there because +of permissions. Specify a path into which LLVM can be installed (e.g. +--prefix=/home/user/llvm).

    • Add the directory containing the tools to your PATH.

      @@ -338,7 +343,7 @@ Brian Gaeke
      LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/12/23 19:49:54 $ + Last modified: $Date: 2004/12/31 19:48:59 $ From reid at x10sys.com Fri Dec 31 16:54:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 31 Dec 2004 16:54:41 -0600 Subject: [llvm-commits] CVS: llvm/configure Makefile.config.in Message-ID: <200412312254.QAA23738@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.167 -> 1.168 Makefile.config.in updated: 1.45 -> 1.46 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Make LLVM_ON_UNIX and LLVM_ON_WIN32 available in the makefiles --- Diffs of the changes: (+44 -30) Index: llvm/configure diff -u llvm/configure:1.167 llvm/configure:1.168 --- llvm/configure:1.167 Thu Dec 30 23:49:15 2004 +++ llvm/configure Fri Dec 31 16:54:28 2004 @@ -476,7 +476,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT ENABLE_DOXYGEN CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON ifGNUmake LN_S CMP CP DATE FIND GREP MKDIR MV PAX RANLIB ac_ct_RANLIB RM SED TAR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA BZIP2 DOT DOXYGEN ETAGS GROFF GZIP POD2HTML POD2MAN RUNTEST TCLSH ZIP EGREP INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL ECHO AR ac_ct_AR STRIP ac_ct_STRIP CXXCPP F! 77 FFLAGS ac_ct_F77 LIBTOOL ETAGSFLAGS LLVMGCC LLVMGXX ALLOCA MMAP_FILE LLVMCC1 LLVMCC1PLUS LLVMGCCDIR SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LLVM_COPYRIGHT subdirs build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os OS LLVM_ON_UNIX LLVM_ON_WIN32 ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT ENABLE_DOXYGEN CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON ifGNUmake LN_S CMP CP DATE FIND GREP MKDIR MV PAX RANLIB ac_ct_RANLIB RM SED TAR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA BZIP2 DOT DOXYGEN ETAGS GROFF GZIP POD2HTML POD2MAN RUNTEST TCLSH ZIP EGREP INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL ECHO AR ac_ct_AR! STRIP ac_ct_STRIP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ETAGSFLAGS LLVMGCC LLVMGXX ALLOCA MMAP_FILE LLVMCC1 LLVMCC1PLUS LLVMGCCDIR SHLIBEXT LLVM_PREFIX LLVM_BINDIR LLVM_LIBDIR LLVM_DATADIR LLVM_DOCSDIR LLVM_ETCDIR LLVM_INCLUDEDIR LLVM_INFODIR LLVM_MANDIR LLVM_CONFIGTIME LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -1756,6 +1756,10 @@ #define LLVM_ON_UNIX 1 _ACEOF + LLVM_ON_UNIX=1 + + LLVM_ON_WIN32=0 + ;; Win32) @@ -1763,6 +1767,10 @@ #define LLVM_ON_WIN32 1 _ACEOF + LLVM_ON_UNIX=0 + + LLVM_ON_WIN32=1 + ;; esac @@ -8217,7 +8225,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext + echo '#line 10219 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10693,7 +10701,7 @@ # Provide some information about the compiler. -echo "$as_me:10696:" \ +echo "$as_me:10704:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 @@ -11750,11 +11758,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11753: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11761: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11757: \$? = $ac_status" >&5 + echo "$as_me:11765: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -11993,11 +12001,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11996: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12004: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12000: \$? = $ac_status" >&5 + echo "$as_me:12008: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12053,11 +12061,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12056: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12064: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12060: \$? = $ac_status" >&5 + echo "$as_me:12068: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14238,7 +14246,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:16540: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16536: \$? = $ac_status" >&5 + echo "$as_me:16544: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -16589,11 +16597,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16592: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16600: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16596: \$? = $ac_status" >&5 + echo "$as_me:16604: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17950,7 +17958,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:18896: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18892: \$? = $ac_status" >&5 + echo "$as_me:18900: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -18945,11 +18953,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18948: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18956: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18952: \$? = $ac_status" >&5 + echo "$as_me:18960: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -20984,11 +20992,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:20987: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20995: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:20991: \$? = $ac_status" >&5 + echo "$as_me:20999: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -21227,11 +21235,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21230: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21238: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21234: \$? = $ac_status" >&5 + echo "$as_me:21242: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -21287,11 +21295,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21290: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21298: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:21294: \$? = $ac_status" >&5 + echo "$as_me:21302: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -23472,7 +23480,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory llvm/autoconf: configure.ac updated: 1.160 -> 1.161 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Make LLVM_ON_UNIX and LLVM_ON_WIN32 available in the makefiles --- Diffs of the changes: (+4 -0) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.160 llvm/autoconf/configure.ac:1.161 --- llvm/autoconf/configure.ac:1.160 Thu Dec 30 23:49:15 2004 +++ llvm/autoconf/configure.ac Fri Dec 31 16:54:28 2004 @@ -147,9 +147,13 @@ case $llvm_cv_platform_type in Unix) AC_DEFINE([LLVM_ON_UNIX],[1],[Define if this is Unixish platform]) + AC_SUBST(LLVM_ON_UNIX,[1]) + AC_SUBST(LLVM_ON_WIN32,[0]) ;; Win32) AC_DEFINE([LLVM_ON_WIN32],[1],[Define if this is Win32ish platform]) + AC_SUBST(LLVM_ON_UNIX,[0]) + AC_SUBST(LLVM_ON_WIN32,[1]) ;; esac From reid at x10sys.com Fri Dec 31 16:56:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 31 Dec 2004 16:56:24 -0600 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200412312256.QAA23766@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.40 -> 1.41 --- Log message: Correct the conditional test for non-portable tools so that it will correctly omit them for non-Unix operating systems. --- Diffs of the changes: (+1 -2) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.40 llvm/tools/Makefile:1.41 --- llvm/tools/Makefile:1.40 Fri Dec 17 02:00:40 2004 +++ llvm/tools/Makefile Fri Dec 31 16:56:14 2004 @@ -18,8 +18,7 @@ # on fork(2) behavior that Win32 doesn't have. At some point they'll be # rewritten to not depend on fork at which time they should be added back to # the list above. - -ifeq ($(OS),Win32) +ifneq ($(LLVM_ON_UNIX),1) PARALLEL_DIRS := $(filter-out bugpoint llvm-db,$(PARALLEL_DIRS)) endif From reid at x10sys.com Sat Jan 1 03:27:06 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 03:27:06 -0600 Subject: [llvm-commits] CVS: llvm/projects/sample/configure Message-ID: <200501010927.DAA10263@zion.cs.uiuc.edu> Changes in directory llvm/projects/sample: configure updated: 1.1 -> 1.2 --- Log message: Update to autoconf 2.59 standards. --- Diffs of the changes: (+237 -111) Index: llvm/projects/sample/configure diff -u llvm/projects/sample/configure:1.1 llvm/projects/sample/configure:1.2 --- llvm/projects/sample/configure:1.1 Wed Oct 15 20:45:35 2003 +++ llvm/projects/sample/configure Sat Jan 1 03:26:55 2005 @@ -1,11 +1,10 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57 for [SAMPLE] [x.xx]. +# Generated by GNU Autoconf 2.59 for [SAMPLE] [x.xx]. # # Report bugs to . # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -22,9 +21,10 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -43,7 +43,7 @@ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -220,16 +220,17 @@ if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -632,7 +633,7 @@ # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -672,10 +673,10 @@ # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -747,9 +748,9 @@ cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -823,12 +824,45 @@ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. @@ -839,7 +873,7 @@ echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then + test -f $ac_srcdir/configure.in; then echo $ac_configure --help else @@ -853,10 +887,9 @@ if $ac_init_version; then cat <<\_ACEOF [SAMPLE] configure [x.xx] -generated by GNU Autoconf 2.57 +generated by GNU Autoconf 2.59 -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -868,7 +901,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by [SAMPLE] $as_me [x.xx], which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -945,19 +978,19 @@ 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. @@ -991,12 +1024,12 @@ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } @@ -1025,7 +1058,7 @@ for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi @@ -1044,7 +1077,7 @@ echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && + rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -1124,7 +1157,7 @@ # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" @@ -1141,13 +1174,13 @@ ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. @@ -1230,6 +1263,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + ac_config_files="$ac_config_files Makefile.common" + ac_config_commands="$ac_config_commands Makefile" @@ -1280,7 +1315,6 @@ fi; - ac_config_files="$ac_config_files Makefile.common" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -1309,13 +1343,13 @@ # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | @@ -1345,13 +1379,13 @@ # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ + ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; +s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; -s/^[^=]*=[ ]*$//; +s/^[^=]*=[ ]*$//; }' fi @@ -1365,13 +1399,13 @@ cat >confdef2opt.sed <<\_ACEOF t clear : clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g @@ -1393,7 +1427,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' @@ -1437,9 +1471,10 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false @@ -1458,7 +1493,7 @@ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var @@ -1637,16 +1672,17 @@ if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS @@ -1673,7 +1709,7 @@ cat >&5 <<_CSEOF This file was extended by [SAMPLE] $as_me [x.xx], which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -1717,7 +1753,7 @@ -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE Configuration files: $config_files @@ -1731,11 +1767,10 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ [SAMPLE] config.status [x.xx] -configured by $0, generated by GNU Autoconf 2.57, +configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir @@ -1967,9 +2002,9 @@ (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end @@ -1987,21 +2022,21 @@ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -2017,10 +2052,10 @@ as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } @@ -2058,12 +2093,45 @@ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac @@ -2081,7 +2149,7 @@ configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." + sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. @@ -2090,24 +2158,24 @@ case $f in -) echo $tmp/stdin ;; [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - echo $f;; + echo "$f";; *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } - fi;; + fi;; esac done` || { (exit 1); exit 1; } _ACEOF @@ -2148,16 +2216,41 @@ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. if test "$ac_dir" != .; then @@ -2183,12 +2276,45 @@ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 From reid at x10sys.com Sat Jan 1 03:27:06 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 03:27:06 -0600 Subject: [llvm-commits] CVS: llvm/projects/sample/autoconf/configure.ac Message-ID: <200501010927.DAA10266@zion.cs.uiuc.edu> Changes in directory llvm/projects/sample/autoconf: configure.ac updated: 1.1 -> 1.2 --- Log message: Update to autoconf 2.59 standards. --- Diffs of the changes: (+2 -1) Index: llvm/projects/sample/autoconf/configure.ac diff -u llvm/projects/sample/autoconf/configure.ac:1.1 llvm/projects/sample/autoconf/configure.ac:1.2 --- llvm/projects/sample/autoconf/configure.ac:1.1 Wed Oct 15 20:44:19 2003 +++ llvm/projects/sample/autoconf/configure.ac Sat Jan 1 03:26:55 2005 @@ -7,6 +7,7 @@ AC_CONFIG_AUX_DIR([autoconf]) dnl Configure a header file +AC_CONFIG_FILES([Makefile.common]) dnl Configure Makefiles dnl List every Makefile that ecists within your source tree @@ -61,4 +62,4 @@ dnl ************************************************************************** dnl * Create the output files dnl ************************************************************************** -AC_OUTPUT(Makefile.common) +AC_OUTPUT From lattner at cs.uiuc.edu Sat Jan 1 09:59:11 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 09:59:11 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveVariables.h Message-ID: <200501011559.j01FxALj030728@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: LiveVariables.h updated: 1.19 -> 1.20 --- Log message: Add a useful accessor --- Diffs of the changes: (+10 -0) Index: llvm/include/llvm/CodeGen/LiveVariables.h diff -u llvm/include/llvm/CodeGen/LiveVariables.h:1.19 llvm/include/llvm/CodeGen/LiveVariables.h:1.20 --- llvm/include/llvm/CodeGen/LiveVariables.h:1.19 Thu Aug 26 17:23:32 2004 +++ llvm/include/llvm/CodeGen/LiveVariables.h Sat Jan 1 09:58:55 2005 @@ -125,6 +125,16 @@ return RegistersKilled.equal_range(MI); } + /// KillsRegister - Return true if the specified instruction kills the + /// specified register. + bool KillsRegister(MachineInstr *MI, unsigned Reg) { + std::pair KIP = killed_range(MI); + for (; KIP.first != KIP.second; ++KIP.first) + if (KIP.first->second == Reg) + return true; + return false; + } + killed_iterator dead_begin(MachineInstr *MI) { return RegistersDead.lower_bound(MI); } From lattner at cs.uiuc.edu Sat Jan 1 09:59:24 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 09:59:24 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/ValueTypes.h Message-ID: <200501011559.j01FxO3g030736@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/CodeGen: ValueTypes.h updated: 1.5 -> 1.6 --- Log message: Add two helper functions. --- Diffs of the changes: (+7 -0) Index: llvm/include/llvm/CodeGen/ValueTypes.h diff -u llvm/include/llvm/CodeGen/ValueTypes.h:1.5 llvm/include/llvm/CodeGen/ValueTypes.h:1.6 --- llvm/include/llvm/CodeGen/ValueTypes.h:1.5 Tue Nov 11 16:41:31 2003 +++ llvm/include/llvm/CodeGen/ValueTypes.h Sat Jan 1 09:58:41 2005 @@ -40,6 +40,13 @@ isVoid = 11, // This has no value }; + + static inline bool isInteger(ValueType VT) { + return VT >= i1 && VT <= i128; + } + static inline bool isFloatingPoint(ValueType VT) { + return VT >= f32 && VT <= f128; + } }; } // End llvm namespace From lattner at cs.uiuc.edu Sat Jan 1 10:00:09 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:00:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200501011600.j01G09E8030758@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.118 -> 1.119 --- Log message: Allow getZeroExtend and getSignExtend to work with boolean inputs. --- Diffs of the changes: (+13 -5) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.118 llvm/lib/VMCore/Constants.cpp:1.119 --- llvm/lib/VMCore/Constants.cpp:1.118 Mon Dec 13 13:48:51 2004 +++ llvm/lib/VMCore/Constants.cpp Sat Jan 1 09:59:57 2005 @@ -1239,18 +1239,26 @@ } Constant *ConstantExpr::getSignExtend(Constant *C, const Type *Ty) { - assert(C->getType()->isInteger() && Ty->isInteger() && + assert(C->getType()->isIntegral() && Ty->isIntegral() && C->getType()->getPrimitiveSize() <= Ty->getPrimitiveSize() && "This is an illegal sign extension!"); - C = ConstantExpr::getCast(C, C->getType()->getSignedVersion()); - return ConstantExpr::getCast(C, Ty); + if (C->getType() != Type::BoolTy) { + C = ConstantExpr::getCast(C, C->getType()->getSignedVersion()); + return ConstantExpr::getCast(C, Ty); + } else { + if (C == ConstantBool::True) + return ConstantIntegral::getAllOnesValue(Ty); + else + return ConstantIntegral::getNullValue(Ty); + } } Constant *ConstantExpr::getZeroExtend(Constant *C, const Type *Ty) { - assert(C->getType()->isInteger() && Ty->isInteger() && + assert(C->getType()->isIntegral() && Ty->isIntegral() && C->getType()->getPrimitiveSize() <= Ty->getPrimitiveSize() && "This is an illegal zero extension!"); - C = ConstantExpr::getCast(C, C->getType()->getUnsignedVersion()); + if (C->getType() != Type::BoolTy) + C = ConstantExpr::getCast(C, C->getType()->getUnsignedVersion()); return ConstantExpr::getCast(C, Ty); } From lattner at cs.uiuc.edu Sat Jan 1 10:01:08 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:01:08 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/SimplifyCFG/DeadSetCC.ll Message-ID: <200501011601.j01G18YS030777@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/SimplifyCFG: DeadSetCC.ll added (r1.1) --- Log message: Add new test to make sure simplifycfg doesn't leave around trivially dead instructions. --- Diffs of the changes: (+26 -0) Index: llvm/test/Regression/Transforms/SimplifyCFG/DeadSetCC.ll diff -c /dev/null llvm/test/Regression/Transforms/SimplifyCFG/DeadSetCC.ll:1.1 *** /dev/null Sat Jan 1 10:01:06 2005 --- llvm/test/Regression/Transforms/SimplifyCFG/DeadSetCC.ll Sat Jan 1 10:00:56 2005 *************** *** 0 **** --- 1,26 ---- + ; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep seteq + + ; Check that simplifycfg deletes a dead 'seteq' instruction when it + ; folds a conditional branch into a switch instruction. + + declare void %foo() + declare void %bar() + + void %testcfg(uint %V) { + %C = seteq uint %V, 18 + %D = seteq uint %V, 180 + %E = or bool %C, %D + br bool %E, label %L1, label %Sw + Sw: + switch uint %V, label %L1 [ + uint 15, label %L2 + uint 16, label %L2 + ] + L1: + call void %foo() + ret void + L2: + call void %bar() + ret void + } + From lattner at cs.uiuc.edu Sat Jan 1 10:02:24 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:02:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Utils/SimplifyCFG.cpp Message-ID: <200501011602.j01G2OoA030795@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Utils: SimplifyCFG.cpp updated: 1.61 -> 1.62 --- Log message: Implement SimplifyCFG/DeadSetCC.ll SimplifyCFG is one of those passes that we use for final cleanup: it should not rely on other passes to clean up its garbage. This fixes the "why are trivially dead setcc's in the output of gccas" problem. --- Diffs of the changes: (+8 -0) Index: llvm/lib/Transforms/Utils/SimplifyCFG.cpp diff -u llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.61 llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.62 --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1.61 Fri Dec 10 11:42:31 2004 +++ llvm/lib/Transforms/Utils/SimplifyCFG.cpp Sat Jan 1 10:02:12 2005 @@ -521,8 +521,16 @@ SwitchInst *NewSI = new SwitchInst(CV, PredDefault, PTI); for (unsigned i = 0, e = PredCases.size(); i != e; ++i) NewSI->addCase(PredCases[i].first, PredCases[i].second); + + Instruction *DeadCond = 0; + if (BranchInst *BI = dyn_cast(PTI)) + // If PTI is a branch, remember the condition. + DeadCond = dyn_cast(BI->getCondition()); Pred->getInstList().erase(PTI); + // If the condition is dead now, remove the instruction tree. + if (DeadCond) ErasePossiblyDeadInstructionTree(DeadCond); + // Okay, last check. If BB is still a successor of PSI, then we must // have an infinite loop case. If so, add an infinitely looping block // to handle the case to preserve the behavior of the code. From lattner at cs.uiuc.edu Sat Jan 1 10:07:09 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:07:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp Message-ID: <200501011607.j01G79b5030873@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV8: SparcV8ISelSimple.cpp updated: 1.87 -> 1.88 --- Log message: Substantially improve the code generated by non-folded setcc instructions. In particular, instead of compiling this: bool %test(int %A, int %B) { %C = setlt int %A, %B ret bool %C } to this: test: save %sp, -96, %sp subcc %i0, %i1, %g0 bl .LBBtest_1 ! nop ba .LBBtest_2 ! nop .LBBtest_1: ! or %g0, 1, %i0 ba .LBBtest_3 ! nop .LBBtest_2: ! or %g0, 0, %i0 ba .LBBtest_3 ! nop .LBBtest_3: ! restore %g0, %g0, %g0 retl nop We now compile it to this: test: save %sp, -96, %sp subcc %i0, %i1, %g0 or %g0, 1, %i0 bl .LBBtest_2 ! nop .LBBtest_1: ! or %g0, %g0, %i0 .LBBtest_2: ! restore %g0, %g0, %g0 retl nop --- Diffs of the changes: (+19 -32) Index: llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp diff -u llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.87 llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.88 --- llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.87 Fri Dec 17 13:07:04 2004 +++ llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp Sat Jan 1 10:06:57 2005 @@ -251,7 +251,6 @@ } if (C->getType()->isIntegral ()) { - uint64_t Val; unsigned Class = getClassB (C->getType ()); if (Class == cLong) { unsigned TmpReg = makeAnotherReg (Type::IntTy); @@ -267,12 +266,13 @@ } assert(Class <= cInt && "Type not handled yet!"); + unsigned Val; if (C->getType() == Type::BoolTy) { Val = (C == ConstantBool::True); } else { ConstantIntegral *CI = cast (C); - Val = CI->getRawValue (); + Val = CI->getRawValue(); } if (C->getType()->isSigned()) { switch (Class) { @@ -289,7 +289,7 @@ } if (Val == 0) { BuildMI (*MBB, IP, V8::ORrr, 2, R).addReg (V8::G0).addReg(V8::G0); - } else if (((int64_t)Val >= -4096) && ((int64_t)Val <= 4095)) { + } else if ((int)Val >= -4096 && (int)Val <= 4095) { BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (V8::G0).addSImm(Val); } else { unsigned TmpReg = makeAnotherReg (C->getType ()); @@ -1639,55 +1639,42 @@ // thisMBB: // ... // subcc %reg0, %reg1, %g0 - // bCC copy1MBB - // ba copy0MBB + // TrueVal = or G0, 1 + // bCC sinkMBB + + unsigned TrueValue = makeAnotherReg (I.getType ()); + BuildMI (BB, V8::ORri, 2, TrueValue).addReg (V8::G0).addZImm (1); - // FIXME: we wouldn't need copy0MBB (we could fold it into thisMBB) - // if we could insert other, non-terminator instructions after the - // bCC. But MBB->getFirstTerminator() can't understand this. - MachineBasicBlock *copy1MBB = new MachineBasicBlock (LLVM_BB); - F->getBasicBlockList ().push_back (copy1MBB); - BuildMI (BB, Opcode, 1).addMBB (copy1MBB); MachineBasicBlock *copy0MBB = new MachineBasicBlock (LLVM_BB); - F->getBasicBlockList ().push_back (copy0MBB); - BuildMI (BB, V8::BA, 1).addMBB (copy0MBB); + MachineBasicBlock *sinkMBB = new MachineBasicBlock (LLVM_BB); + BuildMI (BB, Opcode, 1).addMBB (sinkMBB); + // Update machine-CFG edges - BB->addSuccessor (copy1MBB); + BB->addSuccessor (sinkMBB); BB->addSuccessor (copy0MBB); // copy0MBB: // %FalseValue = or %G0, 0 - // ba sinkMBB + // # fall through BB = copy0MBB; + F->getBasicBlockList ().push_back (BB); unsigned FalseValue = makeAnotherReg (I.getType ()); - BuildMI (BB, V8::ORri, 2, FalseValue).addReg (V8::G0).addZImm (0); - MachineBasicBlock *sinkMBB = new MachineBasicBlock (LLVM_BB); - F->getBasicBlockList ().push_back (sinkMBB); - BuildMI (BB, V8::BA, 1).addMBB (sinkMBB); + BuildMI (BB, V8::ORrr, 2, FalseValue).addReg (V8::G0).addReg (V8::G0); + // Update machine-CFG edges BB->addSuccessor (sinkMBB); DEBUG (std::cerr << "thisMBB is at " << (void*)thisMBB << "\n"); - DEBUG (std::cerr << "copy1MBB is at " << (void*)copy1MBB << "\n"); DEBUG (std::cerr << "copy0MBB is at " << (void*)copy0MBB << "\n"); DEBUG (std::cerr << "sinkMBB is at " << (void*)sinkMBB << "\n"); - // copy1MBB: - // %TrueValue = or %G0, 1 - // ba sinkMBB - BB = copy1MBB; - unsigned TrueValue = makeAnotherReg (I.getType ()); - BuildMI (BB, V8::ORri, 2, TrueValue).addReg (V8::G0).addZImm (1); - BuildMI (BB, V8::BA, 1).addMBB (sinkMBB); - // Update machine-CFG edges - BB->addSuccessor (sinkMBB); - // sinkMBB: - // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, copy1MBB ] + // %Result = phi [ %FalseValue, copy0MBB ], [ %TrueValue, thisMBB ] // ... BB = sinkMBB; + F->getBasicBlockList ().push_back (BB); BuildMI (BB, V8::PHI, 4, DestReg).addReg (FalseValue) - .addMBB (copy0MBB).addReg (TrueValue).addMBB (copy1MBB); + .addMBB (copy0MBB).addReg (TrueValue).addMBB (thisMBB); } void V8ISel::visitAllocaInst(AllocaInst &I) { From lattner at cs.uiuc.edu Sat Jan 1 10:10:24 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:10:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Message-ID: <200501011610.j01GAOWT030900@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32ISelSimple.cpp updated: 1.117 -> 1.118 --- Log message: Fix a FIXME: Select instructions on longs were miscompiled. While we're at it, improve codegen of select instructions. For this testcase: int %test(bool %C, int %A, int %B) { %D = select bool %C, int %A, int %B ret int %D } We used to generate this code: _test: cmpwi cr0, r3, 0 bne .LBB_test_2 ; .LBB_test_1: ; b .LBB_test_3 ; .LBB_test_2: ; or r5, r4, r4 .LBB_test_3: ; or r3, r5, r5 blr Now we emit: _test: cmpwi cr0, r3, 0 bne .LBB_test_2 ; .LBB_test_1: ; or r4, r5, r5 .LBB_test_2: ; or r3, r4, r4 blr -Chris --- Diffs of the changes: (+9 -19) Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.117 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.118 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.117 Tue Nov 30 01:30:20 2004 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Sat Jan 1 10:10:12 2005 @@ -1429,34 +1429,25 @@ // thisMBB: // ... + // TrueVal = ... // cmpTY cr0, r1, r2 // bCC copy1MBB // fallthrough --> copy0MBB MachineBasicBlock *copy0MBB = new MachineBasicBlock(LLVM_BB); - MachineBasicBlock *copy1MBB = new MachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB); - BuildMI(BB, Opcode, 2).addReg(PPC::CR0).addMBB(copy1MBB); + unsigned TrueValue = getReg(TrueVal, BB, BB->begin()); + BuildMI(BB, Opcode, 2).addReg(PPC::CR0).addMBB(sinkMBB); F->getBasicBlockList().insert(It, copy0MBB); - F->getBasicBlockList().insert(It, copy1MBB); F->getBasicBlockList().insert(It, sinkMBB); // Update machine-CFG edges BB->addSuccessor(copy0MBB); - BB->addSuccessor(copy1MBB); + BB->addSuccessor(sinkMBB); // copy0MBB: // %FalseValue = ... - // b sinkMBB + // # fallthrough to sinkMBB BB = copy0MBB; unsigned FalseValue = getReg(FalseVal, BB, BB->begin()); - BuildMI(BB, PPC::B, 1).addMBB(sinkMBB); - // Update machine-CFG edges - BB->addSuccessor(sinkMBB); - - // copy1MBB: - // %TrueValue = ... - // fallthrough - BB = copy1MBB; - unsigned TrueValue = getReg(TrueVal, BB, BB->begin()); // Update machine-CFG edges BB->addSuccessor(sinkMBB); @@ -1465,13 +1456,12 @@ // ... BB = sinkMBB; BuildMI(BB, PPC::PHI, 4, DestReg).addReg(FalseValue) - .addMBB(copy0MBB).addReg(TrueValue).addMBB(copy1MBB); + .addMBB(copy0MBB).addReg(TrueValue).addMBB(thisMBB); - // For a register pair representing a long value, define the second reg - // FIXME: Can this really be correct for selecting longs? + // For a register pair representing a long value, define the top part. if (getClassB(TrueVal->getType()) == cLong) - BuildMI(BB, PPC::LI, 1, DestReg+1).addImm(0); - return; + BuildMI(BB, PPC::PHI, 4, DestReg+1).addReg(FalseValue+1) + .addMBB(copy0MBB).addReg(TrueValue+1).addMBB(thisMBB); } From lattner at cs.uiuc.edu Sat Jan 1 10:13:04 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:13:04 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll Message-ID: <200501011613.j01GD4MG030952@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: 2004-11-22-Missed-and-fold.ll updated: 1.1 -> 1.2 --- Log message: This now works. --- Diffs of the changes: (+0 -1) Index: llvm/test/Regression/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll diff -u llvm/test/Regression/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll:1.1 llvm/test/Regression/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll:1.2 --- llvm/test/Regression/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll:1.1 Mon Nov 22 13:24:11 2004 +++ llvm/test/Regression/Transforms/InstCombine/2004-11-22-Missed-and-fold.ll Sat Jan 1 10:12:52 2005 @@ -1,5 +1,4 @@ ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep and -; XFAIL: * sbyte %test21(sbyte %A) { %C = shr sbyte %A, ubyte 7 ;; sign extend From lattner at cs.uiuc.edu Sat Jan 1 10:13:31 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:13:31 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/and.ll Message-ID: <200501011613.j01GDV9U030965@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: and.ll updated: 1.25 -> 1.26 --- Log message: Add a bunch of tests for ANDs that should be eliminated. --- Diffs of the changes: (+13 -0) Index: llvm/test/Regression/Transforms/InstCombine/and.ll diff -u llvm/test/Regression/Transforms/InstCombine/and.ll:1.25 llvm/test/Regression/Transforms/InstCombine/and.ll:1.26 --- llvm/test/Regression/Transforms/InstCombine/and.ll:1.25 Mon Nov 22 13:24:11 2004 +++ llvm/test/Regression/Transforms/InstCombine/and.ll Sat Jan 1 10:13:19 2005 @@ -179,3 +179,16 @@ %E = add ubyte %D, 16 ret ubyte %E } + +int %test28(int %X) { ;; This is juse a zero extending shr. + %Y = shr int %X, ubyte 24 ;; Sign extend + %Z = and int %Y, 255 ;; Mask out sign bits + ret int %Z +} + +int %test29(ubyte %X) { + %Y = cast ubyte %X to int + %Z = and int %Y, 255 ;; Zero extend makes this unneeded. + ret int %Z +} + From lattner at cs.uiuc.edu Sat Jan 1 10:13:56 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:13:56 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/cast.ll Message-ID: <200501011613.j01GDudJ030981@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: cast.ll updated: 1.22 -> 1.23 --- Log message: Add a bunch of tests for cases that should be eliminated. --- Diffs of the changes: (+27 -0) Index: llvm/test/Regression/Transforms/InstCombine/cast.ll diff -u llvm/test/Regression/Transforms/InstCombine/cast.ll:1.22 llvm/test/Regression/Transforms/InstCombine/cast.ll:1.23 --- llvm/test/Regression/Transforms/InstCombine/cast.ll:1.22 Tue Sep 28 22:18:20 2004 +++ llvm/test/Regression/Transforms/InstCombine/cast.ll Sat Jan 1 10:13:43 2005 @@ -128,3 +128,30 @@ %D = setlt int %C, -1 ret bool %D ;; false } + +uint %test21(uint %X) { + %Y = cast uint %X to sbyte + %Z = cast sbyte %Y to uint ;; sext -> zext -> and -> nop + %RV = and uint %Z, 255 + ret uint %RV +} + +uint %test22(uint %X) { + %Y = cast uint %X to sbyte + %Z = cast sbyte %Y to uint ;; sext -> zext -> and -> nop + %RV = shl uint %Z, ubyte 24 + ret uint %RV +} + +int %test23(int %X) { + %Y = cast int %X to ushort ;; Turn into an AND even though X + %Z = cast ushort %Y to int ;; and Z are signed. + ret int %Z +} + +bool %test24(bool %C) { + %X = select bool %C, uint 14, uint 1234 + %Y = cast uint %X to bool ;; Fold cast into select + ret bool %Y +} + From lattner at cs.uiuc.edu Sat Jan 1 10:14:30 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:14:30 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/and-or-and.ll Message-ID: <200501011614.j01GEUgH031047@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: and-or-and.ll added (r1.1) --- Log message: New testcase for common bitfield manipulation instruction sequences. --- Diffs of the changes: (+54 -0) Index: llvm/test/Regression/Transforms/InstCombine/and-or-and.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/and-or-and.ll:1.1 *** /dev/null Sat Jan 1 10:14:28 2005 --- llvm/test/Regression/Transforms/InstCombine/and-or-and.ll Sat Jan 1 10:14:18 2005 *************** *** 0 **** --- 1,54 ---- + ; If we have an 'and' of the result of an 'or', and one of the 'or' operands + ; cannot have contributed any of the resultant bits, delete the or. This + ; occurs for very common C/C++ code like this: + ; + ; struct foo { int A : 16; int B : 16; }; + ; void test(struct foo *F, int X, int Y) { + ; F->A = X; F->B = Y; + ; } + ; + ; Which corresponds to test1. + + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep 'or ' + + int %test1(int %X, int %Y) { + %A = and int %X, 7 + %B = and int %Y, 8 + %C = or int %A, %B + %D = and int %C, 7 ;; This cannot include any bits from %Y! + ret int %D + } + + int %test2(int %X, ubyte %Y) { + %B = cast ubyte %Y to int + %C = or int %X, %B + %D = and int %C, 65536 ;; This cannot include any bits from %Y! + ret int %D + } + + int %test3(int %X, int %Y) { + %B = shl int %Y, ubyte 1 + %C = or int %X, %B + %D = and int %C, 1 ;; This cannot include any bits from %Y! + ret int %D + } + + uint %test4(uint %X, uint %Y) { + %B = shr uint %Y, ubyte 31 + %C = or uint %X, %B + %D = and uint %C, 2 ;; This cannot include any bits from %Y! + ret uint %D + } + + int %or_test1(int %X, int %Y) { + %A = and int %X, 1 + %B = or int %A, 1 ;; This cannot include any bits from X! + ret int %B + } + + ubyte %or_test2(ubyte %X, ubyte %Y) { + %A = shl ubyte %X, ubyte 7 + %B = or ubyte %A, 128 ;; This cannot include any bits from X! + ret ubyte %B + } + From lattner at cs.uiuc.edu Sat Jan 1 10:14:58 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:14:58 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/cast-cast-to-and.ll zeroext-and-reduce.ll Message-ID: <200501011614.j01GEwHE031065@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/InstCombine: cast-cast-to-and.ll added (r1.1) zeroext-and-reduce.ll added (r1.1) --- Log message: New testcases that we should combine. --- Diffs of the changes: (+16 -0) Index: llvm/test/Regression/Transforms/InstCombine/cast-cast-to-and.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/cast-cast-to-and.ll:1.1 *** /dev/null Sat Jan 1 10:14:56 2005 --- llvm/test/Regression/Transforms/InstCombine/cast-cast-to-and.ll Sat Jan 1 10:14:46 2005 *************** *** 0 **** --- 1,8 ---- + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep ubyte + + int %test1(uint %X) { + %Y = cast uint %X to ubyte ;; Turn into an AND + %Z = cast ubyte %Y to int + ret int %Z + } + Index: llvm/test/Regression/Transforms/InstCombine/zeroext-and-reduce.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/zeroext-and-reduce.ll:1.1 *** /dev/null Sat Jan 1 10:14:58 2005 --- llvm/test/Regression/Transforms/InstCombine/zeroext-and-reduce.ll Sat Jan 1 10:14:46 2005 *************** *** 0 **** --- 1,8 ---- + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'and int %Y, 8' + + int %test1(ubyte %X) { + %Y = cast ubyte %X to int + %Z = and int %Y, 65544 ;; Prune this to and Y, 8 + ret int %Z + } + From lattner at cs.uiuc.edu Sat Jan 1 10:22:42 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 10:22:42 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200501011622.j01GMgOU031117@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.295 -> 1.296 --- Log message: This is a bulk commit that implements the following primary improvements: * We can now fold cast instructions into select instructions that have at least one constant operand. * We now optimize expressions more aggressively based on bits that are known to be zero. These optimizations occur a lot in code that uses bitfields even in simple ways. * We now turn more cast-cast sequences into AND instructions. Before we would only do this if it if all types were unsigned. Now only the middle type needs to be unsigned (guaranteeing a zero extend). * We transform sign extensions into zero extensions in several cases. This corresponds to these test/Regression/Transforms/InstCombine testcases: 2004-11-22-Missed-and-fold.ll and.ll: test28-29 cast.ll: test21-24 and-or-and.ll cast-cast-to-and.ll zeroext-and-reduce.ll --- Diffs of the changes: (+268 -78) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.295 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.296 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.295 Tue Dec 14 14:08:06 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sat Jan 1 10:22:27 2005 @@ -486,31 +486,60 @@ } }; -static Value *FoldOperationIntoSelectOperand(Instruction &BI, Value *SO, +static Value *FoldOperationIntoSelectOperand(Instruction &I, Value *SO, InstCombiner *IC) { + if (isa(I)) { + if (Constant *SOC = dyn_cast(SO)) + return ConstantExpr::getCast(SOC, I.getType()); + + return IC->InsertNewInstBefore(new CastInst(SO, I.getType(), + SO->getName() + ".cast"), I); + } + // Figure out if the constant is the left or the right argument. - bool ConstIsRHS = isa(BI.getOperand(1)); - Constant *ConstOperand = cast(BI.getOperand(ConstIsRHS)); + bool ConstIsRHS = isa(I.getOperand(1)); + Constant *ConstOperand = cast(I.getOperand(ConstIsRHS)); if (Constant *SOC = dyn_cast(SO)) { if (ConstIsRHS) - return ConstantExpr::get(BI.getOpcode(), SOC, ConstOperand); - return ConstantExpr::get(BI.getOpcode(), ConstOperand, SOC); + return ConstantExpr::get(I.getOpcode(), SOC, ConstOperand); + return ConstantExpr::get(I.getOpcode(), ConstOperand, SOC); } Value *Op0 = SO, *Op1 = ConstOperand; if (!ConstIsRHS) std::swap(Op0, Op1); Instruction *New; - if (BinaryOperator *BO = dyn_cast(&BI)) - New = BinaryOperator::create(BO->getOpcode(), Op0, Op1); - else if (ShiftInst *SI = dyn_cast(&BI)) - New = new ShiftInst(SI->getOpcode(), Op0, Op1); + if (BinaryOperator *BO = dyn_cast(&I)) + New = BinaryOperator::create(BO->getOpcode(), Op0, Op1,SO->getName()+".op"); + else if (ShiftInst *SI = dyn_cast(&I)) + New = new ShiftInst(SI->getOpcode(), Op0, Op1, SO->getName()+".sh"); else { assert(0 && "Unknown binary instruction type!"); abort(); } - return IC->InsertNewInstBefore(New, BI); + return IC->InsertNewInstBefore(New, I); +} + +// FoldOpIntoSelect - Given an instruction with a select as one operand and a +// constant as the other operand, try to fold the binary operator into the +// select arguments. This also works for Cast instructions, which obviously do +// not have a second operand. +static Instruction *FoldOpIntoSelect(Instruction &Op, SelectInst *SI, + InstCombiner *IC) { + // Don't modify shared select instructions + if (!SI->hasOneUse()) return 0; + Value *TV = SI->getOperand(1); + Value *FV = SI->getOperand(2); + + if (isa(TV) || isa(FV)) { + Value *SelectTrueVal = FoldOperationIntoSelectOperand(Op, TV, IC); + Value *SelectFalseVal = FoldOperationIntoSelectOperand(Op, FV, IC); + + return new SelectInst(SI->getCondition(), SelectTrueVal, + SelectFalseVal); + } + return 0; } @@ -555,26 +584,6 @@ return ReplaceInstUsesWith(I, NewPN); } -// FoldBinOpIntoSelect - Given an instruction with a select as one operand and a -// constant as the other operand, try to fold the binary operator into the -// select arguments. -static Instruction *FoldBinOpIntoSelect(Instruction &BI, SelectInst *SI, - InstCombiner *IC) { - // Don't modify shared select instructions - if (!SI->hasOneUse()) return 0; - Value *TV = SI->getOperand(1); - Value *FV = SI->getOperand(2); - - if (isa(TV) || isa(FV)) { - Value *SelectTrueVal = FoldOperationIntoSelectOperand(BI, TV, IC); - Value *SelectFalseVal = FoldOperationIntoSelectOperand(BI, FV, IC); - - return new SelectInst(SI->getCondition(), SelectTrueVal, - SelectFalseVal); - } - return 0; -} - Instruction *InstCombiner::visitAdd(BinaryOperator &I) { bool Changed = SimplifyCommutative(I); Value *LHS = I.getOperand(0), *RHS = I.getOperand(1); @@ -667,10 +676,9 @@ } } - // Try to fold constant add into select arguments. if (SelectInst *SI = dyn_cast(LHS)) - if (Instruction *R = FoldBinOpIntoSelect(I, SI, this)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) return R; } @@ -761,7 +769,7 @@ // Try to fold constant sub into select arguments. if (SelectInst *SI = dyn_cast(Op1)) - if (Instruction *R = FoldBinOpIntoSelect(I, SI, this)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) return R; if (isa(Op0)) @@ -889,7 +897,7 @@ // Try to fold constant mul into select arguments. if (SelectInst *SI = dyn_cast(Op0)) - if (Instruction *R = FoldBinOpIntoSelect(I, SI, this)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) return R; if (isa(Op0)) @@ -990,7 +998,7 @@ if (!RHS->isNullValue()) { if (SelectInst *SI = dyn_cast(Op0)) - if (Instruction *R = FoldBinOpIntoSelect(I, SI, this)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) return R; if (isa(Op0)) if (Instruction *NV = FoldOpIntoPhi(I)) @@ -1066,7 +1074,7 @@ if (!RHS->isNullValue()) { if (SelectInst *SI = dyn_cast(Op0)) - if (Instruction *R = FoldBinOpIntoSelect(I, SI, this)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) return R; if (isa(Op0)) if (Instruction *NV = FoldOpIntoPhi(I)) @@ -1251,6 +1259,70 @@ }; +/// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use +/// this predicate to simplify operations downstream. V and Mask are known to +/// be the same type. +static bool MaskedValueIsZero(Value *V, ConstantIntegral *Mask) { + if (isa(V) || Mask->isNullValue()) + return true; + if (ConstantIntegral *CI = dyn_cast(V)) + return ConstantExpr::getAnd(CI, Mask)->isNullValue(); + + if (Instruction *I = dyn_cast(V)) { + switch (I->getOpcode()) { + case Instruction::And: + // (X & C1) & C2 == 0 iff C1 & C2 == 0. + if (ConstantIntegral *CI = dyn_cast(I->getOperand(1))) + if (ConstantExpr::getAnd(CI, Mask)->isNullValue()) + return true; + break; + case Instruction::Cast: { + const Type *SrcTy = I->getOperand(0)->getType(); + if (SrcTy->isIntegral()) { + // (cast X to int) & C2 == 0 iff could not have contained C2. + if (SrcTy->isUnsigned() && // Only handle zero ext. + ConstantExpr::getCast(Mask, SrcTy)->isNullValue()) + return true; + + // If this is a noop cast, recurse. + if (SrcTy != Type::BoolTy) + if ((SrcTy->isSigned() && SrcTy->getUnsignedVersion() ==I->getType()) || + SrcTy->getSignedVersion() == I->getType()) { + Constant *NewMask = + ConstantExpr::getCast(Mask, I->getOperand(0)->getType()); + return MaskedValueIsZero(I->getOperand(0), + cast(NewMask)); + } + } + break; + } + case Instruction::Shl: + // (shl X, C1) & C2 == 0 iff (-1 << C1) & C2 == 0 + if (ConstantUInt *SA = dyn_cast(I->getOperand(1))) { + Constant *C1 = ConstantIntegral::getAllOnesValue(I->getType()); + C1 = ConstantExpr::getShl(C1, SA); + C1 = ConstantExpr::getAnd(C1, Mask); + if (C1->isNullValue()) + return true; + } + break; + case Instruction::Shr: + // (ushr X, C1) & C2 == 0 iff (-1 >> C1) & C2 == 0 + if (ConstantUInt *SA = dyn_cast(I->getOperand(1))) + if (I->getType()->isUnsigned()) { + Constant *C1 = ConstantIntegral::getAllOnesValue(I->getType()); + C1 = ConstantExpr::getShr(C1, SA); + C1 = ConstantExpr::getAnd(C1, Mask); + if (C1->isNullValue()) + return true; + } + break; + } + } + + return false; +} + // OptAndOp - This handles expressions of the form ((val OP C1) & C2). Where // the Op parameter is 'OP', OpRHS is 'C1', and AndRHS is 'C2'. Op is // guaranteed to be either a shift instruction or a binary operator. @@ -1265,10 +1337,7 @@ switch (Op->getOpcode()) { case Instruction::Xor: - if (Together->isNullValue()) { - // (X ^ C1) & C2 --> (X & C2) iff (C1&C2) == 0 - return BinaryOperator::createAnd(X, AndRHS); - } else if (Op->hasOneUse()) { + if (Op->hasOneUse()) { // (X ^ C1) & C2 --> (X & C2) ^ (C1&C2) std::string OpName = Op->getName(); Op->setName(""); Instruction *And = BinaryOperator::createAnd(X, AndRHS, OpName); @@ -1277,20 +1346,15 @@ } break; case Instruction::Or: - // (X | C1) & C2 --> X & C2 iff C1 & C1 == 0 - if (Together->isNullValue()) - return BinaryOperator::createAnd(X, AndRHS); - else { - if (Together == AndRHS) // (X | C) & C --> C - return ReplaceInstUsesWith(TheAnd, AndRHS); + if (Together == AndRHS) // (X | C) & C --> C + return ReplaceInstUsesWith(TheAnd, AndRHS); - if (Op->hasOneUse() && Together != OpRHS) { - // (X | C1) & C2 --> (X | (C1&C2)) & C2 - std::string Op0Name = Op->getName(); Op->setName(""); - Instruction *Or = BinaryOperator::createOr(X, Together, Op0Name); - InsertNewInstBefore(Or, TheAnd); - return BinaryOperator::createAnd(Or, AndRHS); - } + if (Op->hasOneUse() && Together != OpRHS) { + // (X | C1) & C2 --> (X | (C1&C2)) & C2 + std::string Op0Name = Op->getName(); Op->setName(""); + Instruction *Or = BinaryOperator::createOr(X, Together, Op0Name); + InsertNewInstBefore(Or, TheAnd); + return BinaryOperator::createAnd(Or, AndRHS); } break; case Instruction::Add: @@ -1445,27 +1509,103 @@ if (isa(Op1)) // X & undef -> 0 return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); - // and X, X = X and X, 0 == 0 - if (Op0 == Op1 || Op1 == Constant::getNullValue(I.getType())) + // and X, X = X + if (Op0 == Op1) return ReplaceInstUsesWith(I, Op1); // and X, -1 == X - if (ConstantIntegral *RHS = dyn_cast(Op1)) { - if (RHS->isAllOnesValue()) + if (ConstantIntegral *AndRHS = dyn_cast(Op1)) { + if (AndRHS->isAllOnesValue()) // and X, -1 == X return ReplaceInstUsesWith(I, Op0); + if (MaskedValueIsZero(Op0, AndRHS)) // LHS & RHS == 0 + return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); + + // If the mask is not masking out any bits, there is no reason to do the + // and in the first place. + if (MaskedValueIsZero(Op0, + cast(ConstantExpr::getNot(AndRHS)))) + return ReplaceInstUsesWith(I, Op0); + // Optimize a variety of ((val OP C1) & C2) combinations... if (isa(Op0) || isa(Op0)) { Instruction *Op0I = cast(Op0); - Value *X = Op0I->getOperand(0); + Value *Op0LHS = Op0I->getOperand(0); + Value *Op0RHS = Op0I->getOperand(1); + switch (Op0I->getOpcode()) { + case Instruction::Xor: + case Instruction::Or: + // (X ^ V) & C2 --> (X & C2) iff (V & C2) == 0 + // (X | V) & C2 --> (X & C2) iff (V & C2) == 0 + if (MaskedValueIsZero(Op0LHS, AndRHS)) + return BinaryOperator::createAnd(Op0RHS, AndRHS); + if (MaskedValueIsZero(Op0RHS, AndRHS)) + return BinaryOperator::createAnd(Op0LHS, AndRHS); + break; + case Instruction::And: + // (X & V) & C2 --> 0 iff (V & C2) == 0 + if (MaskedValueIsZero(Op0LHS, AndRHS) || + MaskedValueIsZero(Op0RHS, AndRHS)) + return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); + break; + } + if (ConstantInt *Op0CI = dyn_cast(Op0I->getOperand(1))) - if (Instruction *Res = OptAndOp(Op0I, Op0CI, RHS, I)) + if (Instruction *Res = OptAndOp(Op0I, Op0CI, AndRHS, I)) return Res; + } else if (CastInst *CI = dyn_cast(Op0)) { + const Type *SrcTy = CI->getOperand(0)->getType(); + + // If this is an integer sign or zero extension instruction. + if (SrcTy->isIntegral() && + SrcTy->getPrimitiveSize() < CI->getType()->getPrimitiveSize()) { + + if (SrcTy->isUnsigned()) { + // See if this and is clearing out bits that are known to be zero + // anyway (due to the zero extension). + Constant *Mask = ConstantIntegral::getAllOnesValue(SrcTy); + Mask = ConstantExpr::getZeroExtend(Mask, CI->getType()); + Constant *Result = ConstantExpr::getAnd(Mask, AndRHS); + if (Result == Mask) // The "and" isn't doing anything, remove it. + return ReplaceInstUsesWith(I, CI); + if (Result != AndRHS) { // Reduce the and RHS constant. + I.setOperand(1, Result); + return &I; + } + + } else { + if (CI->hasOneUse() && SrcTy->isInteger()) { + // We can only do this if all of the sign bits brought in are masked + // out. Compute this by first getting 0000011111, then inverting + // it. + Constant *Mask = ConstantIntegral::getAllOnesValue(SrcTy); + Mask = ConstantExpr::getZeroExtend(Mask, CI->getType()); + Mask = ConstantExpr::getNot(Mask); // 1's in the new bits. + if (ConstantExpr::getAnd(Mask, AndRHS)->isNullValue()) { + // If the and is clearing all of the sign bits, change this to a + // zero extension cast. To do this, cast the cast input to + // unsigned, then to the requested size. + Value *CastOp = CI->getOperand(0); + Instruction *NC = + new CastInst(CastOp, CastOp->getType()->getUnsignedVersion(), + CI->getName()+".uns"); + NC = InsertNewInstBefore(NC, I); + // Finally, insert a replacement for CI. + NC = new CastInst(NC, CI->getType(), CI->getName()); + CI->setName(""); + NC = InsertNewInstBefore(NC, I); + WorkList.push_back(CI); // Delete CI later. + I.setOperand(0, NC); + return &I; // The AND operand was modified. + } + } + } + } } // Try to fold constant and into select arguments. if (SelectInst *SI = dyn_cast(Op0)) - if (Instruction *R = FoldBinOpIntoSelect(I, SI, this)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) return R; if (isa(Op0)) if (Instruction *NV = FoldOpIntoPhi(I)) @@ -1599,8 +1739,11 @@ // or X, -1 == -1 if (ConstantIntegral *RHS = dyn_cast(Op1)) { - if (RHS->isAllOnesValue()) - return ReplaceInstUsesWith(I, Op1); + // If X is known to only contain bits that already exist in RHS, just + // replace this instruction with RHS directly. + if (MaskedValueIsZero(Op0, + cast(ConstantExpr::getNot(RHS)))) + return ReplaceInstUsesWith(I, RHS); ConstantInt *C1; Value *X; // (X & C1) | C2 --> (X | C2) & (C1|C2) @@ -1622,7 +1765,7 @@ // Try to fold constant and into select arguments. if (SelectInst *SI = dyn_cast(Op0)) - if (Instruction *R = FoldBinOpIntoSelect(I, SI, this)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) return R; if (isa(Op0)) if (Instruction *NV = FoldOpIntoPhi(I)) @@ -1840,7 +1983,7 @@ // Try to fold constant and into select arguments. if (SelectInst *SI = dyn_cast(Op0)) - if (Instruction *R = FoldBinOpIntoSelect(I, SI, this)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) return R; if (isa(Op0)) if (Instruction *NV = FoldOpIntoPhi(I)) @@ -2671,7 +2814,7 @@ // Try to fold constant and into select arguments. if (isa(Op0)) if (SelectInst *SI = dyn_cast(Op1)) - if (Instruction *R = FoldBinOpIntoSelect(I, SI, this)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) return R; if (ConstantUInt *CUI = dyn_cast(Op1)) { @@ -2697,15 +2840,48 @@ // Try to fold constant and into select arguments. if (SelectInst *SI = dyn_cast(Op0)) - if (Instruction *R = FoldBinOpIntoSelect(I, SI, this)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) return R; if (isa(Op0)) if (Instruction *NV = FoldOpIntoPhi(I)) return NV; - // If the operand is an bitwise operator with a constant RHS, and the - // shift is the only use, we can pull it out of the shift. - if (Op0->hasOneUse()) + if (Op0->hasOneUse()) { + // If this is a SHL of a sign-extending cast, see if we can turn the input + // into a zero extending cast (a simple strength reduction). + if (CastInst *CI = dyn_cast(Op0)) { + const Type *SrcTy = CI->getOperand(0)->getType(); + if (isLeftShift && SrcTy->isInteger() && SrcTy->isSigned() && + SrcTy->getPrimitiveSize() < CI->getType()->getPrimitiveSize()) { + // We can change it to a zero extension if we are shifting out all of + // the sign extended bits. To check this, form a mask of all of the + // sign extend bits, then shift them left and see if we have anything + // left. + Constant *Mask = ConstantIntegral::getAllOnesValue(SrcTy); // 1111 + Mask = ConstantExpr::getZeroExtend(Mask, CI->getType()); // 00001111 + Mask = ConstantExpr::getNot(Mask); // 1's in the sign bits: 11110000 + if (ConstantExpr::getShl(Mask, CUI)->isNullValue()) { + // If the shift is nuking all of the sign bits, change this to a + // zero extension cast. To do this, cast the cast input to + // unsigned, then to the requested size. + Value *CastOp = CI->getOperand(0); + Instruction *NC = + new CastInst(CastOp, CastOp->getType()->getUnsignedVersion(), + CI->getName()+".uns"); + NC = InsertNewInstBefore(NC, I); + // Finally, insert a replacement for CI. + NC = new CastInst(NC, CI->getType(), CI->getName()); + CI->setName(""); + NC = InsertNewInstBefore(NC, I); + WorkList.push_back(CI); // Delete CI later. + I.setOperand(0, NC); + return &I; // The SHL operand was modified. + } + } + } + + // If the operand is an bitwise operator with a constant RHS, and the + // shift is the only use, we can pull it out of the shift. if (BinaryOperator *Op0BO = dyn_cast(Op0)) if (ConstantInt *Op0C = dyn_cast(Op0BO->getOperand(1))) { bool isValid = true; // Valid only for And, Or, Xor @@ -2749,6 +2925,7 @@ NewRHS); } } + } // If this is a shift of a shift, see if we can fold the two together... if (ShiftInst *Op0SI = dyn_cast(Op0)) @@ -2926,9 +3103,10 @@ // If casting the result of another cast instruction, try to eliminate this // one! // - if (CastInst *CSrc = dyn_cast(Src)) { - if (isEliminableCastOfCast(CSrc->getOperand(0)->getType(), - CSrc->getType(), CI.getType(), TD)) { + if (CastInst *CSrc = dyn_cast(Src)) { // A->B->C cast + Value *A = CSrc->getOperand(0); + if (isEliminableCastOfCast(A->getType(), CSrc->getType(), + CI.getType(), TD)) { // This instruction now refers directly to the cast's src operand. This // has a good chance of making CSrc dead. CI.setOperand(0, CSrc->getOperand(0)); @@ -2938,18 +3116,27 @@ // If this is an A->B->A cast, and we are dealing with integral types, try // to convert this into a logical 'and' instruction. // - if (CSrc->getOperand(0)->getType() == CI.getType() && + if (A->getType()->isInteger() && CI.getType()->isInteger() && CSrc->getType()->isInteger() && - CI.getType()->isUnsigned() && CSrc->getType()->isUnsigned() && - CSrc->getType()->getPrimitiveSize() < CI.getType()->getPrimitiveSize()){ + CSrc->getType()->isUnsigned() && // B->A cast must zero extend + CSrc->getType()->getPrimitiveSize() < CI.getType()->getPrimitiveSize()&& + A->getType()->getPrimitiveSize() == CI.getType()->getPrimitiveSize()) { assert(CSrc->getType() != Type::ULongTy && "Cannot have type bigger than ulong!"); uint64_t AndValue = (1ULL << CSrc->getType()->getPrimitiveSize()*8)-1; - Constant *AndOp = ConstantUInt::get(CI.getType(), AndValue); - return BinaryOperator::createAnd(CSrc->getOperand(0), AndOp); + Constant *AndOp = ConstantUInt::get(A->getType()->getUnsignedVersion(), + AndValue); + AndOp = ConstantExpr::getCast(AndOp, A->getType()); + Instruction *And = BinaryOperator::createAnd(CSrc->getOperand(0), AndOp); + if (And->getType() != CI.getType()) { + And->setName(CSrc->getName()+".mask"); + InsertNewInstBefore(And, CI); + And = new CastInst(And, CI.getType()); + } + return And; } } - + // If this is a cast to bool, turn it into the appropriate setne instruction. if (CI.getType() == Type::BoolTy) return BinaryOperator::createSetNE(CI.getOperand(0), @@ -3001,6 +3188,9 @@ } } + if (SelectInst *SI = dyn_cast(Src)) + if (Instruction *NV = FoldOpIntoSelect(CI, SI, this)) + return NV; if (isa(Src)) if (Instruction *NV = FoldOpIntoPhi(CI)) return NV; From reid at x10sys.com Sat Jan 1 12:14:29 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 12:14:29 -0600 Subject: [llvm-commits] CVS: llvm/projects/Stacker/autoconf/.cvsignore Message-ID: <200501011814.MAA21079@zion.cs.uiuc.edu> Changes in directory llvm/projects/Stacker/autoconf: .cvsignore added (r1.1) --- Log message: Ignore some files --- Diffs of the changes: (+2 -0) Index: llvm/projects/Stacker/autoconf/.cvsignore diff -c /dev/null llvm/projects/Stacker/autoconf/.cvsignore:1.1 *** /dev/null Sat Jan 1 12:14:28 2005 --- llvm/projects/Stacker/autoconf/.cvsignore Sat Jan 1 12:14:18 2005 *************** *** 0 **** --- 1,2 ---- + aclocal.m4 + autom4te.cache From reid at x10sys.com Sat Jan 1 12:16:27 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 12:16:27 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200501011816.MAA21153@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.45 -> 1.46 --- Log message: Add HAVE_SBRK --- Diffs of the changes: (+3 -0) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.45 llvm/include/llvm/Config/config.h.in:1.46 --- llvm/include/llvm/Config/config.h.in:1.45 Wed Dec 29 01:07:57 2004 +++ llvm/include/llvm/Config/config.h.in Sat Jan 1 12:16:16 2005 @@ -231,6 +231,9 @@ /* Define to 1 if you have the `rindex' function. */ #undef HAVE_RINDEX +/* Define to 1 if you have the `sbrk' function. */ +#undef HAVE_SBRK + /* Define to 1 if you have the `setrlimit' function. */ #undef HAVE_SETRLIMIT From jeffc at jolt-lang.org Sat Jan 1 12:17:51 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 12:17:51 -0600 Subject: [llvm-commits] CVS: llvm/win32/x86/x86.vcproj Message-ID: <200501011817.MAA21190@zion.cs.uiuc.edu> Changes in directory llvm/win32/x86: x86.vcproj updated: 1.7 -> 1.8 --- Log message: Improve TableGen dependencies Move TableGen generated files out of the src tree Add descriptions to the custom build steps --- Diffs of the changes: (+72 -22) Index: llvm/win32/x86/x86.vcproj diff -u llvm/win32/x86/x86.vcproj:1.7 llvm/win32/x86/x86.vcproj:1.8 --- llvm/win32/x86/x86.vcproj:1.7 Sat Dec 18 20:29:00 2004 +++ llvm/win32/x86/x86.vcproj Sat Jan 1 12:17:40 2005 @@ -4,6 +4,7 @@ Version="7.10" Name="x86" ProjectGUID="{144EEBF6-8C9B-4473-B715-2C821666AF6C}" + RootNamespace="x86" Keyword="Win32Proj"> + Name="VCPreBuildEventTool"/> + Name="VCPreBuildEventTool"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From jeffc at jolt-lang.org Sat Jan 1 12:17:51 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 12:17:51 -0600 Subject: [llvm-commits] CVS: llvm/win32/Configure/Configure.vcproj Message-ID: <200501011817.MAA21193@zion.cs.uiuc.edu> Changes in directory llvm/win32/Configure: Configure.vcproj updated: 1.5 -> 1.6 --- Log message: Improve TableGen dependencies Move TableGen generated files out of the src tree Add descriptions to the custom build steps --- Diffs of the changes: (+5 -0) Index: llvm/win32/Configure/Configure.vcproj diff -u llvm/win32/Configure/Configure.vcproj:1.5 llvm/win32/Configure/Configure.vcproj:1.6 --- llvm/win32/Configure/Configure.vcproj:1.5 Fri Dec 24 10:26:47 2004 +++ llvm/win32/Configure/Configure.vcproj Sat Jan 1 12:17:40 2005 @@ -73,6 +73,7 @@ Name="Configure|Win32"> @@ -84,6 +85,7 @@ Name="Configure|Win32"> @@ -95,6 +97,7 @@ Name="Configure|Win32"> @@ -106,6 +109,7 @@ Name="Configure|Win32"> @@ -117,6 +121,7 @@ Name="Configure|Win32"> From jeffc at jolt-lang.org Sat Jan 1 12:17:51 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 12:17:51 -0600 Subject: [llvm-commits] CVS: llvm/win32/TableGen/TableGen.vcproj Message-ID: <200501011817.MAA21194@zion.cs.uiuc.edu> Changes in directory llvm/win32/TableGen: TableGen.vcproj updated: 1.6 -> 1.7 --- Log message: Improve TableGen dependencies Move TableGen generated files out of the src tree Add descriptions to the custom build steps --- Diffs of the changes: (+8 -6) Index: llvm/win32/TableGen/TableGen.vcproj diff -u llvm/win32/TableGen/TableGen.vcproj:1.6 llvm/win32/TableGen/TableGen.vcproj:1.7 --- llvm/win32/TableGen/TableGen.vcproj:1.6 Sat Dec 18 20:29:00 2004 +++ llvm/win32/TableGen/TableGen.vcproj Sat Jan 1 12:17:40 2005 @@ -46,8 +46,7 @@ + Name="VCPostBuildEventTool"/> + Name="VCPostBuildEventTool"/> @@ -148,6 +147,7 @@ Name="Release|Win32"> @@ -159,8 +159,9 @@ Name="Debug|Win32"> @@ -168,8 +169,9 @@ Name="Release|Win32"> From jeffc at jolt-lang.org Sat Jan 1 12:58:34 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 12:58:34 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/TimeValue.h Message-ID: <200501011858.MAA21638@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: TimeValue.h updated: 1.10 -> 1.11 --- Log message: Fix bountiful sources of VC++ 'possible loss of data' warnings --- Diffs of the changes: (+2 -2) Index: llvm/include/llvm/System/TimeValue.h diff -u llvm/include/llvm/System/TimeValue.h:1.10 llvm/include/llvm/System/TimeValue.h:1.11 --- llvm/include/llvm/System/TimeValue.h:1.10 Mon Dec 13 23:26:43 2004 +++ llvm/include/llvm/System/TimeValue.h Sat Jan 1 12:58:23 2005 @@ -314,7 +314,7 @@ /// @brief Converts from microsecond format to TimeValue format void usec( int64_t microseconds ) { this->seconds_ = microseconds / MICROSECONDS_PER_SECOND; - this->nanos_ = (microseconds % MICROSECONDS_PER_SECOND) * + this->nanos_ = NanoSecondsType(microseconds % MICROSECONDS_PER_SECOND) * NANOSECONDS_PER_MICROSECOND; this->normalize(); } @@ -322,7 +322,7 @@ /// @brief Converts from millisecond format to TimeValue format void msec( int64_t milliseconds ) { this->seconds_ = milliseconds / MILLISECONDS_PER_SECOND; - this->nanos_ = (milliseconds % MILLISECONDS_PER_SECOND) * + this->nanos_ = NanoSecondsType(milliseconds % MILLISECONDS_PER_SECOND) * NANOSECONDS_PER_MILLISECOND; this->normalize(); } From jeffc at jolt-lang.org Sat Jan 1 12:58:34 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 12:58:34 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/IntrinsicInst.h Message-ID: <200501011858.MAA21635@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: IntrinsicInst.h updated: 1.4 -> 1.5 --- Log message: Fix bountiful sources of VC++ 'possible loss of data' warnings --- Diffs of the changes: (+2 -2) Index: llvm/include/llvm/IntrinsicInst.h diff -u llvm/include/llvm/IntrinsicInst.h:1.4 llvm/include/llvm/IntrinsicInst.h:1.5 --- llvm/include/llvm/IntrinsicInst.h:1.4 Mon Nov 22 11:18:05 2004 +++ llvm/include/llvm/IntrinsicInst.h Sat Jan 1 12:58:23 2005 @@ -74,10 +74,10 @@ struct DbgStopPointInst : public DbgInfoIntrinsic { unsigned getLineNo() const { - return cast(getOperand(2))->getRawValue(); + return unsigned(cast(getOperand(2))->getRawValue()); } unsigned getColNo() const { - return cast(getOperand(3))->getRawValue(); + return unsigned(cast(getOperand(3))->getRawValue()); } Value *getContext() const { return const_cast(getOperand(4)); } From jeffc at jolt-lang.org Sat Jan 1 13:37:25 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 13:37:25 -0600 Subject: [llvm-commits] CVS: llvm/win32/Fibonacci/Fibonacci.vcproj Message-ID: <200501011937.NAA21889@zion.cs.uiuc.edu> Changes in directory llvm/win32/Fibonacci: Fibonacci.vcproj updated: 1.6 -> 1.7 --- Log message: Put executables into a single directory --- Diffs of the changes: (+3 -6) Index: llvm/win32/Fibonacci/Fibonacci.vcproj diff -u llvm/win32/Fibonacci/Fibonacci.vcproj:1.6 llvm/win32/Fibonacci/Fibonacci.vcproj:1.7 --- llvm/win32/Fibonacci/Fibonacci.vcproj:1.6 Sun Dec 19 00:40:39 2004 +++ llvm/win32/Fibonacci/Fibonacci.vcproj Sat Jan 1 13:37:14 2005 @@ -4,6 +4,7 @@ Version="7.10" Name="Fibonacci" ProjectGUID="{48FB551D-E37E-42EC-BC97-FF7219774867}" + RootNamespace="Fibonacci" Keyword="Win32Proj"> @@ -41,10 +42,6 @@ ForceSymbolReferences="_X86TargetMachineModule" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/Fibonacci.pdb" - GenerateMapFile="TRUE" - MapFileName="$(OutDir)/Fibonacci.map" - MapExports="TRUE" - MapLines="TRUE" SubSystem="1" OptimizeReferences="0" TargetMachine="1"/> @@ -71,7 +68,7 @@ From jeffc at jolt-lang.org Sat Jan 1 13:37:25 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 13:37:25 -0600 Subject: [llvm-commits] CVS: llvm/win32/llc/llc.vcproj Message-ID: <200501011937.NAA21886@zion.cs.uiuc.edu> Changes in directory llvm/win32/llc: llc.vcproj updated: 1.2 -> 1.3 --- Log message: Put executables into a single directory --- Diffs of the changes: (+2 -2) Index: llvm/win32/llc/llc.vcproj diff -u llvm/win32/llc/llc.vcproj:1.2 llvm/win32/llc/llc.vcproj:1.3 --- llvm/win32/llc/llc.vcproj:1.2 Thu Dec 23 00:45:32 2004 +++ llvm/win32/llc/llc.vcproj Sat Jan 1 13:37:14 2005 @@ -12,7 +12,7 @@ @@ -66,7 +66,7 @@ From jeffc at jolt-lang.org Sat Jan 1 13:37:25 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 13:37:25 -0600 Subject: [llvm-commits] CVS: llvm/win32/TableGen/TableGen.vcproj Message-ID: <200501011937.NAA21892@zion.cs.uiuc.edu> Changes in directory llvm/win32/TableGen: TableGen.vcproj updated: 1.7 -> 1.8 --- Log message: Put executables into a single directory --- Diffs of the changes: (+2 -2) Index: llvm/win32/TableGen/TableGen.vcproj diff -u llvm/win32/TableGen/TableGen.vcproj:1.7 llvm/win32/TableGen/TableGen.vcproj:1.8 --- llvm/win32/TableGen/TableGen.vcproj:1.7 Sat Jan 1 12:17:40 2005 +++ llvm/win32/TableGen/TableGen.vcproj Sat Jan 1 13:37:14 2005 @@ -38,7 +38,7 @@ Name="VCLinkerTool" OutputFile="$(OutDir)\TableGen.exe" LinkIncremental="2" - AdditionalLibraryDirectories="C:\Project\llvm\win32\Debug" + AdditionalLibraryDirectories="" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/TableGen.pdb" SubSystem="1" @@ -88,7 +88,7 @@ Name="VCLinkerTool" OutputFile="$(OutDir)\TableGen.exe" LinkIncremental="1" - AdditionalLibraryDirectories="C:\Project\llvm\win32\Release" + AdditionalLibraryDirectories="" GenerateDebugInformation="TRUE" SubSystem="1" OptimizeReferences="2" From jeffc at jolt-lang.org Sat Jan 1 13:37:25 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 13:37:25 -0600 Subject: [llvm-commits] CVS: llvm/win32/lli/lli.vcproj Message-ID: <200501011937.NAA21895@zion.cs.uiuc.edu> Changes in directory llvm/win32/lli: lli.vcproj updated: 1.2 -> 1.3 --- Log message: Put executables into a single directory --- Diffs of the changes: (+2 -2) Index: llvm/win32/lli/lli.vcproj diff -u llvm/win32/lli/lli.vcproj:1.2 llvm/win32/lli/lli.vcproj:1.3 --- llvm/win32/lli/lli.vcproj:1.2 Fri Dec 24 01:57:09 2004 +++ llvm/win32/lli/lli.vcproj Sat Jan 1 13:37:14 2005 @@ -12,7 +12,7 @@ @@ -66,7 +66,7 @@ From llvm at cs.uiuc.edu Sat Jan 1 14:17:21 2005 From: llvm at cs.uiuc.edu (LLVM) Date: Sat, 1 Jan 2005 14:17:21 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-dis/ Message-ID: <200501012017.OAA22282@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-dis: --- Log message: Directory /var/cvs/llvm/llvm/win32/llvm-dis added to the repository --- Diffs of the changes: (+0 -0) From jeffc at jolt-lang.org Sat Jan 1 14:18:14 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:18:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm.sln Message-ID: <200501012018.OAA22307@zion.cs.uiuc.edu> Changes in directory llvm/win32: llvm.sln updated: 1.6 -> 1.7 --- Log message: Add llvm-dis project to Visual Studio --- Diffs of the changes: (+13 -0) Index: llvm/win32/llvm.sln diff -u llvm/win32/llvm.sln:1.6 llvm/win32/llvm.sln:1.7 --- llvm/win32/llvm.sln:1.6 Fri Dec 24 01:57:09 2004 +++ llvm/win32/llvm.sln Sat Jan 1 14:18:03 2005 @@ -96,6 +96,15 @@ {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-dis", "llvm-dis\llvm-dis.vcproj", "{B13476BC-30AB-4EA0-BC1E-212C0A459405}" + ProjectSection(ProjectDependencies) = postProject + {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} + {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} + {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} + {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -162,6 +171,10 @@ {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Debug.Build.0 = Debug|Win32 {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Release.ActiveCfg = Release|Win32 {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Release.Build.0 = Release|Win32 + {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Debug.ActiveCfg = Debug|Win32 + {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Debug.Build.0 = Debug|Win32 + {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Release.ActiveCfg = Release|Win32 + {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection From jeffc at jolt-lang.org Sat Jan 1 14:18:14 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:18:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-dis/llvm-dis.vcproj Message-ID: <200501012018.OAA22310@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-dis: llvm-dis.vcproj added (r1.1) --- Log message: Add llvm-dis project to Visual Studio --- Diffs of the changes: (+142 -0) Index: llvm/win32/llvm-dis/llvm-dis.vcproj diff -c /dev/null llvm/win32/llvm-dis/llvm-dis.vcproj:1.1 *** /dev/null Sat Jan 1 14:18:13 2005 --- llvm/win32/llvm-dis/llvm-dis.vcproj Sat Jan 1 14:18:03 2005 *************** *** 0 **** --- 1,142 ---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From llvm at cs.uiuc.edu Sat Jan 1 14:50:31 2005 From: llvm at cs.uiuc.edu (LLVM) Date: Sat, 1 Jan 2005 14:50:31 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-as/ Message-ID: <200501012050.OAA22458@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-as: --- Log message: Directory /var/cvs/llvm/llvm/win32/llvm-as added to the repository --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Sat Jan 1 14:50:31 2005 From: llvm at cs.uiuc.edu (LLVM) Date: Sat, 1 Jan 2005 14:50:31 -0600 Subject: [llvm-commits] CVS: llvm/win32/AsmParser/ Message-ID: <200501012050.OAA22459@zion.cs.uiuc.edu> Changes in directory llvm/win32/AsmParser: --- Log message: Directory /var/cvs/llvm/llvm/win32/AsmParser added to the repository --- Diffs of the changes: (+0 -0) From jeffc at jolt-lang.org Sat Jan 1 14:51:54 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:51:54 -0600 Subject: [llvm-commits] CVS: llvm/win32/Bytecode/Bytecode.vcproj Message-ID: <200501012051.OAA22520@zion.cs.uiuc.edu> Changes in directory llvm/win32/Bytecode: Bytecode.vcproj updated: 1.1 -> 1.2 --- Log message: Add llvm-as project to Visual Studio --- Diffs of the changes: (+0 -8) Index: llvm/win32/Bytecode/Bytecode.vcproj diff -u llvm/win32/Bytecode/Bytecode.vcproj:1.1 llvm/win32/Bytecode/Bytecode.vcproj:1.2 --- llvm/win32/Bytecode/Bytecode.vcproj:1.1 Tue Dec 21 18:27:14 2004 +++ llvm/win32/Bytecode/Bytecode.vcproj Sat Jan 1 14:51:41 2005 @@ -184,14 +184,6 @@ RelativePath="..\..\include\llvm\Bytecode\Writer.h"> - - - - From jeffc at jolt-lang.org Sat Jan 1 14:51:54 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:51:54 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-as/llvm-as.vcproj Message-ID: <200501012051.OAA22524@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-as: llvm-as.vcproj added (r1.1) --- Log message: Add llvm-as project to Visual Studio --- Diffs of the changes: (+137 -0) Index: llvm/win32/llvm-as/llvm-as.vcproj diff -c /dev/null llvm/win32/llvm-as/llvm-as.vcproj:1.1 *** /dev/null Sat Jan 1 14:51:51 2005 --- llvm/win32/llvm-as/llvm-as.vcproj Sat Jan 1 14:51:41 2005 *************** *** 0 **** --- 1,137 ---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From jeffc at jolt-lang.org Sat Jan 1 14:51:54 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:51:54 -0600 Subject: [llvm-commits] CVS: llvm/win32/AsmParser/AsmParser.vcproj Message-ID: <200501012051.OAA22529@zion.cs.uiuc.edu> Changes in directory llvm/win32/AsmParser: AsmParser.vcproj added (r1.1) --- Log message: Add llvm-as project to Visual Studio --- Diffs of the changes: (+180 -0) Index: llvm/win32/AsmParser/AsmParser.vcproj diff -c /dev/null llvm/win32/AsmParser/AsmParser.vcproj:1.1 *** /dev/null Sat Jan 1 14:51:51 2005 --- llvm/win32/AsmParser/AsmParser.vcproj Sat Jan 1 14:51:41 2005 *************** *** 0 **** --- 1,180 ---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From jeffc at jolt-lang.org Sat Jan 1 14:51:54 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:51:54 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-dis/llvm-dis.vcproj Message-ID: <200501012051.OAA22523@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-dis: llvm-dis.vcproj updated: 1.1 -> 1.2 --- Log message: Add llvm-as project to Visual Studio --- Diffs of the changes: (+0 -5) Index: llvm/win32/llvm-dis/llvm-dis.vcproj diff -u llvm/win32/llvm-dis/llvm-dis.vcproj:1.1 llvm/win32/llvm-dis/llvm-dis.vcproj:1.2 --- llvm/win32/llvm-dis/llvm-dis.vcproj:1.1 Sat Jan 1 14:18:03 2005 +++ llvm/win32/llvm-dis/llvm-dis.vcproj Sat Jan 1 14:51:41 2005 @@ -131,11 +131,6 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> - - From jeffc at jolt-lang.org Sat Jan 1 14:51:54 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:51:54 -0600 Subject: [llvm-commits] CVS: llvm/win32/lli/lli.vcproj Message-ID: <200501012051.OAA22530@zion.cs.uiuc.edu> Changes in directory llvm/win32/lli: lli.vcproj updated: 1.3 -> 1.4 --- Log message: Add llvm-as project to Visual Studio --- Diffs of the changes: (+0 -5) Index: llvm/win32/lli/lli.vcproj diff -u llvm/win32/lli/lli.vcproj:1.3 llvm/win32/lli/lli.vcproj:1.4 --- llvm/win32/lli/lli.vcproj:1.3 Sat Jan 1 13:37:14 2005 +++ llvm/win32/lli/lli.vcproj Sat Jan 1 14:51:41 2005 @@ -133,11 +133,6 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> - - From jeffc at jolt-lang.org Sat Jan 1 14:51:54 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:51:54 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm.sln Message-ID: <200501012051.OAA22535@zion.cs.uiuc.edu> Changes in directory llvm/win32: llvm.sln updated: 1.7 -> 1.8 --- Log message: Add llvm-as project to Visual Studio --- Diffs of the changes: (+23 -0) Index: llvm/win32/llvm.sln diff -u llvm/win32/llvm.sln:1.7 llvm/win32/llvm.sln:1.8 --- llvm/win32/llvm.sln:1.7 Sat Jan 1 14:18:03 2005 +++ llvm/win32/llvm.sln Sat Jan 1 14:51:41 2005 @@ -105,6 +105,21 @@ {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-as", "llvm-as\llvm-as.vcproj", "{4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}" + ProjectSection(ProjectDependencies) = postProject + {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} + {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} + {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} + {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} + {3DC216F5-1DDD-478A-84F8-C124E5C31982} = {3DC216F5-1DDD-478A-84F8-C124E5C31982} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsmParser", "AsmParser\AsmParser.vcproj", "{3DC216F5-1DDD-478A-84F8-C124E5C31982}" + ProjectSection(ProjectDependencies) = postProject + {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -175,6 +190,14 @@ {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Debug.Build.0 = Debug|Win32 {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Release.ActiveCfg = Release|Win32 {B13476BC-30AB-4EA0-BC1E-212C0A459405}.Release.Build.0 = Release|Win32 + {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Debug.ActiveCfg = Debug|Win32 + {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Debug.Build.0 = Debug|Win32 + {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Release.ActiveCfg = Release|Win32 + {4FBC40A5-E626-4A6C-A9D3-FAE5C28D30CC}.Release.Build.0 = Release|Win32 + {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Debug.ActiveCfg = Debug|Win32 + {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Debug.Build.0 = Debug|Win32 + {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Release.ActiveCfg = Release|Win32 + {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection From jeffc at jolt-lang.org Sat Jan 1 14:51:54 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:51:54 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Assembly/Parser.h Message-ID: <200501012051.OAA22536@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Assembly: Parser.h updated: 1.8 -> 1.9 --- Log message: Add llvm-as project to Visual Studio --- Diffs of the changes: (+2 -1) Index: llvm/include/llvm/Assembly/Parser.h diff -u llvm/include/llvm/Assembly/Parser.h:1.8 llvm/include/llvm/Assembly/Parser.h:1.9 --- llvm/include/llvm/Assembly/Parser.h:1.8 Tue Nov 11 16:41:31 2003 +++ llvm/include/llvm/Assembly/Parser.h Sat Jan 1 14:51:41 2005 @@ -36,7 +36,8 @@ // ParseException - For when an exceptional event is generated by the parser. // This class lets you print out the exception message // -struct ParseException { +class ParseException { +public: ParseException(const std::string &filename, const std::string &message, int LineNo = -1, int ColNo = -1); From jeffc at jolt-lang.org Sat Jan 1 14:51:55 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:51:55 -0600 Subject: [llvm-commits] CVS: llvm/win32/TableGen/TableGen.vcproj Message-ID: <200501012051.OAA22541@zion.cs.uiuc.edu> Changes in directory llvm/win32/TableGen: TableGen.vcproj updated: 1.8 -> 1.9 --- Log message: Add llvm-as project to Visual Studio --- Diffs of the changes: (+1 -1) Index: llvm/win32/TableGen/TableGen.vcproj diff -u llvm/win32/TableGen/TableGen.vcproj:1.8 llvm/win32/TableGen/TableGen.vcproj:1.9 --- llvm/win32/TableGen/TableGen.vcproj:1.8 Sat Jan 1 13:37:14 2005 +++ llvm/win32/TableGen/TableGen.vcproj Sat Jan 1 14:51:41 2005 @@ -170,7 +170,7 @@ From jeffc at jolt-lang.org Sat Jan 1 14:51:55 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 14:51:55 -0600 Subject: [llvm-commits] CVS: llvm/win32/llc/llc.vcproj Message-ID: <200501012051.OAA22543@zion.cs.uiuc.edu> Changes in directory llvm/win32/llc: llc.vcproj updated: 1.3 -> 1.4 --- Log message: Add llvm-as project to Visual Studio --- Diffs of the changes: (+0 -5) Index: llvm/win32/llc/llc.vcproj diff -u llvm/win32/llc/llc.vcproj:1.3 llvm/win32/llc/llc.vcproj:1.4 --- llvm/win32/llc/llc.vcproj:1.3 Sat Jan 1 13:37:14 2005 +++ llvm/win32/llc/llc.vcproj Sat Jan 1 14:51:41 2005 @@ -133,11 +133,6 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> - - From jeffc at jolt-lang.org Sat Jan 1 15:34:29 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 15:34:29 -0600 Subject: [llvm-commits] CVS: llvm/win32/Support/Support.vcproj Message-ID: <200501012134.PAA22752@zion.cs.uiuc.edu> Changes in directory llvm/win32/Support: Support.vcproj updated: 1.8 -> 1.9 --- Log message: Add missing file SystemUtils.cpp to Support project. --- Diffs of the changes: (+3 -0) Index: llvm/win32/Support/Support.vcproj diff -u llvm/win32/Support/Support.vcproj:1.8 llvm/win32/Support/Support.vcproj:1.9 --- llvm/win32/Support/Support.vcproj:1.8 Sun Dec 19 00:40:39 2004 +++ llvm/win32/Support/Support.vcproj Sat Jan 1 15:34:18 2005 @@ -171,6 +171,9 @@ RelativePath="..\..\lib\Support\StringExtras.cpp"> + + Changes in directory llvm/win32/TableGen: TableGen.vcproj updated: 1.9 -> 1.10 --- Log message: Add -v option to bison. --- Diffs of the changes: (+2 -2) Index: llvm/win32/TableGen/TableGen.vcproj diff -u llvm/win32/TableGen/TableGen.vcproj:1.9 llvm/win32/TableGen/TableGen.vcproj:1.10 --- llvm/win32/TableGen/TableGen.vcproj:1.9 Sat Jan 1 14:51:41 2005 +++ llvm/win32/TableGen/TableGen.vcproj Sat Jan 1 15:35:39 2005 @@ -160,7 +160,7 @@ @@ -170,7 +170,7 @@ From llvm at cs.uiuc.edu Sat Jan 1 15:59:58 2005 From: llvm at cs.uiuc.edu (LLVM) Date: Sat, 1 Jan 2005 15:59:58 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-ar/ Message-ID: <200501012159.PAA22904@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-ar: --- Log message: Directory /var/cvs/llvm/llvm/win32/llvm-ar added to the repository --- Diffs of the changes: (+0 -0) From jeffc at jolt-lang.org Sat Jan 1 16:00:39 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:00:39 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-ar/llvm-ar.vcproj Message-ID: <200501012200.QAA22957@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-ar: llvm-ar.vcproj added (r1.1) --- Log message: Add llvm-ar project to Visual Studio. --- Diffs of the changes: (+137 -0) Index: llvm/win32/llvm-ar/llvm-ar.vcproj diff -c /dev/null llvm/win32/llvm-ar/llvm-ar.vcproj:1.1 *** /dev/null Sat Jan 1 16:00:38 2005 --- llvm/win32/llvm-ar/llvm-ar.vcproj Sat Jan 1 16:00:28 2005 *************** *** 0 **** --- 1,137 ---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From jeffc at jolt-lang.org Sat Jan 1 16:00:39 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:00:39 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm.sln Message-ID: <200501012200.QAA22960@zion.cs.uiuc.edu> Changes in directory llvm/win32: llvm.sln updated: 1.8 -> 1.9 --- Log message: Add llvm-ar project to Visual Studio. --- Diffs of the changes: (+13 -0) Index: llvm/win32/llvm.sln diff -u llvm/win32/llvm.sln:1.8 llvm/win32/llvm.sln:1.9 --- llvm/win32/llvm.sln:1.8 Sat Jan 1 14:51:41 2005 +++ llvm/win32/llvm.sln Sat Jan 1 16:00:28 2005 @@ -120,6 +120,15 @@ {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ar", "llvm-ar\llvm-ar.vcproj", "{0FF2B75C-49C1-4B49-A44A-531C93000296}" + ProjectSection(ProjectDependencies) = postProject + {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} + {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} + {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} + {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -198,6 +207,10 @@ {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Debug.Build.0 = Debug|Win32 {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Release.ActiveCfg = Release|Win32 {3DC216F5-1DDD-478A-84F8-C124E5C31982}.Release.Build.0 = Release|Win32 + {0FF2B75C-49C1-4B49-A44A-531C93000296}.Debug.ActiveCfg = Debug|Win32 + {0FF2B75C-49C1-4B49-A44A-531C93000296}.Debug.Build.0 = Debug|Win32 + {0FF2B75C-49C1-4B49-A44A-531C93000296}.Release.ActiveCfg = Release|Win32 + {0FF2B75C-49C1-4B49-A44A-531C93000296}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection From llvm at cs.uiuc.edu Sat Jan 1 16:05:35 2005 From: llvm at cs.uiuc.edu (LLVM) Date: Sat, 1 Jan 2005 16:05:35 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-ranlib/ Message-ID: <200501012205.QAA23010@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-ranlib: --- Log message: Directory /var/cvs/llvm/llvm/win32/llvm-ranlib added to the repository --- Diffs of the changes: (+0 -0) From jeffc at jolt-lang.org Sat Jan 1 16:06:06 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:06:06 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm.sln Message-ID: <200501012206.QAA23030@zion.cs.uiuc.edu> Changes in directory llvm/win32: llvm.sln updated: 1.9 -> 1.10 --- Log message: Add llvm-ranlib project to Visual Studio. --- Diffs of the changes: (+13 -0) Index: llvm/win32/llvm.sln diff -u llvm/win32/llvm.sln:1.9 llvm/win32/llvm.sln:1.10 --- llvm/win32/llvm.sln:1.9 Sat Jan 1 16:00:28 2005 +++ llvm/win32/llvm.sln Sat Jan 1 16:05:56 2005 @@ -129,6 +129,15 @@ {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-ranlib", "llvm-ranlib\llvm-ranlib.vcproj", "{BB16C7EE-B4ED-4714-B5ED-B775C62A6612}" + ProjectSection(ProjectDependencies) = postProject + {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} + {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} + {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} + {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -211,6 +220,10 @@ {0FF2B75C-49C1-4B49-A44A-531C93000296}.Debug.Build.0 = Debug|Win32 {0FF2B75C-49C1-4B49-A44A-531C93000296}.Release.ActiveCfg = Release|Win32 {0FF2B75C-49C1-4B49-A44A-531C93000296}.Release.Build.0 = Release|Win32 + {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Debug.ActiveCfg = Debug|Win32 + {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Debug.Build.0 = Debug|Win32 + {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Release.ActiveCfg = Release|Win32 + {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection From jeffc at jolt-lang.org Sat Jan 1 16:06:07 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:06:07 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-ranlib/llvm-ranlib.vcproj Message-ID: <200501012206.QAA23033@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-ranlib: llvm-ranlib.vcproj added (r1.1) --- Log message: Add llvm-ranlib project to Visual Studio. --- Diffs of the changes: (+137 -0) Index: llvm/win32/llvm-ranlib/llvm-ranlib.vcproj diff -c /dev/null llvm/win32/llvm-ranlib/llvm-ranlib.vcproj:1.1 *** /dev/null Sat Jan 1 16:06:06 2005 --- llvm/win32/llvm-ranlib/llvm-ranlib.vcproj Sat Jan 1 16:05:56 2005 *************** *** 0 **** --- 1,137 ---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From jeffc at jolt-lang.org Sat Jan 1 16:10:43 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:10:43 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-link/llvm-link.cpp Message-ID: <200501012210.QAA23073@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-link: llvm-link.cpp updated: 1.53 -> 1.54 --- Log message: Fix typo 'ompress' => 'compress'. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-link/llvm-link.cpp diff -u llvm/tools/llvm-link/llvm-link.cpp:1.53 llvm/tools/llvm-link/llvm-link.cpp:1.54 --- llvm/tools/llvm-link/llvm-link.cpp:1.53 Wed Dec 29 23:36:07 2004 +++ llvm/tools/llvm-link/llvm-link.cpp Sat Jan 1 16:10:32 2005 @@ -43,7 +43,7 @@ DumpAsm("d", cl::desc("Print assembly as linked"), cl::Hidden); static cl::opt NoCompress("disable-compression", cl::init(false), - cl::desc("Don't ompress the generated bytecode")); + cl::desc("Don't compress the generated bytecode")); // LoadFile - Read the specified bytecode file in and return it. This routine // searches the link path for the specified file to try to find it... From jeffc at jolt-lang.org Sat Jan 1 16:10:43 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:10:43 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp Message-ID: <200501012210.QAA23079@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.39 -> 1.40 --- Log message: Fix typo 'ompress' => 'compress'. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.39 llvm/tools/llvm-as/llvm-as.cpp:1.40 --- llvm/tools/llvm-as/llvm-as.cpp:1.39 Wed Dec 29 23:36:07 2004 +++ llvm/tools/llvm-as/llvm-as.cpp Sat Jan 1 16:10:32 2005 @@ -42,7 +42,7 @@ static cl::opt NoCompress("disable-compression", cl::init(false), - cl::desc("Don't ompress the generated bytecode")); + cl::desc("Don't compress the generated bytecode")); static cl::opt DisableVerify("disable-verify", cl::Hidden, From jeffc at jolt-lang.org Sat Jan 1 16:10:43 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:10:43 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccas/gccas.cpp Message-ID: <200501012210.QAA23076@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccas: gccas.cpp updated: 1.106 -> 1.107 --- Log message: Fix typo 'ompress' => 'compress'. --- Diffs of the changes: (+1 -1) Index: llvm/tools/gccas/gccas.cpp diff -u llvm/tools/gccas/gccas.cpp:1.106 llvm/tools/gccas/gccas.cpp:1.107 --- llvm/tools/gccas/gccas.cpp:1.106 Wed Dec 29 23:36:07 2004 +++ llvm/tools/gccas/gccas.cpp Sat Jan 1 16:10:32 2005 @@ -53,7 +53,7 @@ cl::opt NoCompress("disable-compression", cl::init(false), - cl::desc("Don't ompress the generated bytecode")); + cl::desc("Don't compress the generated bytecode")); cl::opt TF("traditional-format", cl::Hidden, cl::desc("Compatibility option: ignored")); From reid at x10sys.com Sat Jan 1 16:29:38 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 16:29:38 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Process.cpp Message-ID: <200501012229.QAA23362@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Process.cpp updated: 1.7 -> 1.8 --- Log message: Add functions for determining if the stdin/out/err is connected to a console or not. --- Diffs of the changes: (+24 -0) Index: llvm/lib/System/Unix/Process.cpp diff -u llvm/lib/System/Unix/Process.cpp:1.7 llvm/lib/System/Unix/Process.cpp:1.8 --- llvm/lib/System/Unix/Process.cpp:1.7 Thu Dec 30 23:53:27 2004 +++ llvm/lib/System/Unix/Process.cpp Sat Jan 1 16:29:26 2005 @@ -122,5 +122,29 @@ #endif } +bool Process::StandardInIsUserInput() { +#if HAVE_ISATTY + return isatty(0); +#endif + // If we don't have isatty, just return false. + return false; +} + +bool Process::StandardOutIsDisplayed() { +#if HAVE_ISATTY + return isatty(1); +#endif + // If we don't have isatty, just return false. + return false; +} + +bool Process::StandardErrIsDisplayed() { +#if HAVE_ISATTY + return isatty(2); +#endif + // If we don't have isatty, just return false. + return false; +} + } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Sat Jan 1 16:29:38 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 16:29:38 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Process.h Message-ID: <200501012229.QAA23359@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Process.h updated: 1.3 -> 1.4 --- Log message: Add functions for determining if the stdin/out/err is connected to a console or not. --- Diffs of the changes: (+15 -0) Index: llvm/include/llvm/System/Process.h diff -u llvm/include/llvm/System/Process.h:1.3 llvm/include/llvm/System/Process.h:1.4 --- llvm/include/llvm/System/Process.h:1.3 Mon Dec 27 00:17:27 2004 +++ llvm/include/llvm/System/Process.h Sat Jan 1 16:29:26 2005 @@ -69,6 +69,21 @@ /// @brief Prevent core file generation. static void PreventCoreFiles(); + /// This function determines if the standard input is connected directly + /// to a user's input (keyboard probably), rather than coming from a file + /// or pipe. + static bool StandardInIsUserInput(); + + /// This function determines if the standard output is connected to a + /// "tty" or "console" window. That is, the output would be displayed to + /// the user rather than being put on a pipe or stored in a file. + static bool StandardOutIsDisplayed(); + + /// This function determines if the standard error is connected to a + /// "tty" or "console" window. That is, the output would be displayed to + /// the user rather than being put on a pipe or stored in a file. + static bool StandardErrIsDisplayed(); + /// @} }; } From jeffc at jolt-lang.org Sat Jan 1 16:30:29 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:30:29 -0600 Subject: [llvm-commits] CVS: llvm/win32/VMCore/VMCore.vcproj Message-ID: <200501012230.QAA23400@zion.cs.uiuc.edu> Changes in directory llvm/win32/VMCore: VMCore.vcproj updated: 1.7 -> 1.8 --- Log message: Add missing header files to projects. --- Diffs of the changes: (+12 -0) Index: llvm/win32/VMCore/VMCore.vcproj diff -u llvm/win32/VMCore/VMCore.vcproj:1.7 llvm/win32/VMCore/VMCore.vcproj:1.8 --- llvm/win32/VMCore/VMCore.vcproj:1.7 Sat Dec 18 20:29:00 2004 +++ llvm/win32/VMCore/VMCore.vcproj Sat Jan 1 16:30:19 2005 @@ -178,9 +178,15 @@ RelativePath="..\..\include\llvm\Argument.h"> + + + + + + + + From jeffc at jolt-lang.org Sat Jan 1 16:30:30 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:30:30 -0600 Subject: [llvm-commits] CVS: llvm/win32/AsmParser/AsmParser.vcproj Message-ID: <200501012230.QAA23403@zion.cs.uiuc.edu> Changes in directory llvm/win32/AsmParser: AsmParser.vcproj updated: 1.1 -> 1.2 --- Log message: Add missing header files to projects. --- Diffs of the changes: (+3 -0) Index: llvm/win32/AsmParser/AsmParser.vcproj diff -u llvm/win32/AsmParser/AsmParser.vcproj:1.1 llvm/win32/AsmParser/AsmParser.vcproj:1.2 --- llvm/win32/AsmParser/AsmParser.vcproj:1.1 Sat Jan 1 14:51:41 2005 +++ llvm/win32/AsmParser/AsmParser.vcproj Sat Jan 1 16:30:19 2005 @@ -158,6 +158,9 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + + From llvm at cs.uiuc.edu Sat Jan 1 16:30:46 2005 From: llvm at cs.uiuc.edu (LLVM) Date: Sat, 1 Jan 2005 16:30:46 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-link/ Message-ID: <200501012230.QAA23414@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-link: --- Log message: Directory /var/cvs/llvm/llvm/win32/llvm-link added to the repository --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Sat Jan 1 16:31:09 2005 From: llvm at cs.uiuc.edu (LLVM) Date: Sat, 1 Jan 2005 16:31:09 -0600 Subject: [llvm-commits] CVS: llvm/win32/Linker/ Message-ID: <200501012231.QAA23438@zion.cs.uiuc.edu> Changes in directory llvm/win32/Linker: --- Log message: Directory /var/cvs/llvm/llvm/win32/Linker added to the repository --- Diffs of the changes: (+0 -0) From jeffc at jolt-lang.org Sat Jan 1 16:32:38 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:32:38 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm-link/llvm-link.vcproj Message-ID: <200501012232.QAA23477@zion.cs.uiuc.edu> Changes in directory llvm/win32/llvm-link: llvm-link.vcproj added (r1.1) --- Log message: Add llvm-link, Linker projects to Visual Studio. --- Diffs of the changes: (+137 -0) Index: llvm/win32/llvm-link/llvm-link.vcproj diff -c /dev/null llvm/win32/llvm-link/llvm-link.vcproj:1.1 *** /dev/null Sat Jan 1 16:32:37 2005 --- llvm/win32/llvm-link/llvm-link.vcproj Sat Jan 1 16:32:26 2005 *************** *** 0 **** --- 1,137 ---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From jeffc at jolt-lang.org Sat Jan 1 16:32:38 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:32:38 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm.sln Message-ID: <200501012232.QAA23480@zion.cs.uiuc.edu> Changes in directory llvm/win32: llvm.sln updated: 1.10 -> 1.11 --- Log message: Add llvm-link, Linker projects to Visual Studio. --- Diffs of the changes: (+25 -0) Index: llvm/win32/llvm.sln diff -u llvm/win32/llvm.sln:1.10 llvm/win32/llvm.sln:1.11 --- llvm/win32/llvm.sln:1.10 Sat Jan 1 16:05:56 2005 +++ llvm/win32/llvm.sln Sat Jan 1 16:32:26 2005 @@ -138,6 +138,23 @@ {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-link", "llvm-link\llvm-link.vcproj", "{5E249789-49E1-4600-B12B-8AD2BB6439B2}" + ProjectSection(ProjectDependencies) = postProject + {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} + {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} + {342CF48F-760A-4040-A9A1-7D75AA2471CE} = {342CF48F-760A-4040-A9A1-7D75AA2471CE} + {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} + {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Linker", "Linker\Linker.vcproj", "{342CF48F-760A-4040-A9A1-7D75AA2471CE}" + ProjectSection(ProjectDependencies) = postProject + {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} + {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} + {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -224,6 +241,14 @@ {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Debug.Build.0 = Debug|Win32 {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Release.ActiveCfg = Release|Win32 {BB16C7EE-B4ED-4714-B5ED-B775C62A6612}.Release.Build.0 = Release|Win32 + {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Debug.ActiveCfg = Debug|Win32 + {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Debug.Build.0 = Debug|Win32 + {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Release.ActiveCfg = Release|Win32 + {5E249789-49E1-4600-B12B-8AD2BB6439B2}.Release.Build.0 = Release|Win32 + {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Debug.ActiveCfg = Debug|Win32 + {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Debug.Build.0 = Debug|Win32 + {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Release.ActiveCfg = Release|Win32 + {342CF48F-760A-4040-A9A1-7D75AA2471CE}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection From jeffc at jolt-lang.org Sat Jan 1 16:32:38 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:32:38 -0600 Subject: [llvm-commits] CVS: llvm/win32/Linker/Linker.vcproj Message-ID: <200501012232.QAA23483@zion.cs.uiuc.edu> Changes in directory llvm/win32/Linker: Linker.vcproj added (r1.1) --- Log message: Add llvm-link, Linker projects to Visual Studio. --- Diffs of the changes: (+139 -0) Index: llvm/win32/Linker/Linker.vcproj diff -c /dev/null llvm/win32/Linker/Linker.vcproj:1.1 *** /dev/null Sat Jan 1 16:32:36 2005 --- llvm/win32/Linker/Linker.vcproj Sat Jan 1 16:32:26 2005 *************** *** 0 **** --- 1,139 ---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From jeffc at jolt-lang.org Sat Jan 1 16:54:15 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 16:54:15 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Process.cpp Message-ID: <200501012254.QAA23663@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Process.cpp updated: 1.6 -> 1.7 --- Log message: Add functions for determining if the stdin/out/err is connected to a console or not. --- Diffs of the changes: (+13 -0) Index: llvm/lib/System/Win32/Process.cpp diff -u llvm/lib/System/Win32/Process.cpp:1.6 llvm/lib/System/Win32/Process.cpp:1.7 --- llvm/lib/System/Win32/Process.cpp:1.6 Mon Dec 27 00:17:26 2004 +++ llvm/lib/System/Win32/Process.cpp Sat Jan 1 16:54:05 2005 @@ -14,6 +14,7 @@ #include "Win32.h" #include #include +#include #pragma comment(lib, "psapi.lib") @@ -99,5 +100,17 @@ // dialog box from coming up. Or maybe not... } +bool Process::StandardInIsUserInput() { + return GetFileType((HANDLE)_get_osfhandle(0)) == FILE_TYPE_CHAR; +} + +bool Process::StandardOutIsDisplayed() { + return GetFileType((HANDLE)_get_osfhandle(1)) == FILE_TYPE_CHAR; +} + +bool Process::StandardErrIsDisplayed() { + return GetFileType((HANDLE)_get_osfhandle(2)) == FILE_TYPE_CHAR; +} + } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Sat Jan 1 17:56:31 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 17:56:31 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/SystemUtils.h Message-ID: <200501012356.RAA24090@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: SystemUtils.h updated: 1.17 -> 1.18 --- Log message: Implement a function to print a warning if bytecode output is to be sent to a terminal/console. --- Diffs of the changes: (+6 -3) Index: llvm/include/llvm/Support/SystemUtils.h diff -u llvm/include/llvm/Support/SystemUtils.h:1.17 llvm/include/llvm/Support/SystemUtils.h:1.18 --- llvm/include/llvm/Support/SystemUtils.h:1.17 Tue Dec 21 09:40:41 2004 +++ llvm/include/llvm/Support/SystemUtils.h Sat Jan 1 17:56:20 2005 @@ -19,9 +19,12 @@ namespace llvm { -/// isStandardOutAConsole - Return true if we can tell that the standard output -/// stream goes to a terminal window or console. -bool isStandardOutAConsole(); +/// Determine if the ostream provided is connected to the std::cout and +/// displayed or not (to a console window). If so, generate a warning message +/// advising against display of bytecode and return true. Otherwise just return +/// false +/// @brief Check for output written to a console +bool CheckBytecodeOutputToConsole(std::ostream* stream_to_check); /// FindExecutable - Find a named executable, giving the argv[0] of program /// being executed. This allows us to find another LLVM tool if it is built into From reid at x10sys.com Sat Jan 1 17:56:31 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 17:56:31 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/SystemUtils.cpp Message-ID: <200501012356.RAA24087@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SystemUtils.cpp updated: 1.38 -> 1.39 --- Log message: Implement a function to print a warning if bytecode output is to be sent to a terminal/console. --- Diffs of the changes: (+10 -8) Index: llvm/lib/Support/SystemUtils.cpp diff -u llvm/lib/Support/SystemUtils.cpp:1.38 llvm/lib/Support/SystemUtils.cpp:1.39 --- llvm/lib/Support/SystemUtils.cpp:1.38 Sun Dec 19 12:00:09 2004 +++ llvm/lib/Support/SystemUtils.cpp Sat Jan 1 17:56:20 2005 @@ -14,20 +14,22 @@ #include "llvm/Support/SystemUtils.h" #include "llvm/System/Program.h" +#include "llvm/System/Process.h" +#include using namespace llvm; -/// isStandardOutAConsole - Return true if we can tell that the standard output -/// stream goes to a terminal window or console. -bool llvm::isStandardOutAConsole() { -#if HAVE_ISATTY - return isatty(1); -#endif - // If we don't have isatty, just return false. +bool llvm::CheckBytecodeOutputToConsole(std::ostream* stream_to_check) { + if (stream_to_check == &std::cout && sys::Process::StandardOutIsDisplayed()) { + std::cerr << "WARNING: You're attempting to print out a bytecode file.\n"; + std::cerr << "This is inadvisable as it may cause display problems. If\n"; + std::cerr << "you REALLY want to taste LLVM bytecode first-hand, you can\n"; + std::cerr << "force output with the `-f' option.\n\n"; + return true; + } return false; } - /// FindExecutable - Find a named executable, giving the argv[0] of program /// being executed. This allows us to find another LLVM tool if it is built /// into the same directory, but that directory is neither the current From reid at x10sys.com Sat Jan 1 17:57:11 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 17:57:11 -0600 Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp Message-ID: <200501012357.RAA24101@zion.cs.uiuc.edu> Changes in directory llvm/tools/opt: opt.cpp updated: 1.100 -> 1.101 --- Log message: Move the code for printing out a warning about bytecode output to a console into lib/Support so it can be used with other tools. --- Diffs of the changes: (+1 -7) Index: llvm/tools/opt/opt.cpp diff -u llvm/tools/opt/opt.cpp:1.100 llvm/tools/opt/opt.cpp:1.101 --- llvm/tools/opt/opt.cpp:1.100 Wed Dec 29 23:36:08 2004 +++ llvm/tools/opt/opt.cpp Sat Jan 1 17:57:01 2005 @@ -118,13 +118,7 @@ // If the output is set to be emitted to standard out, and standard out is a // console, print out a warning message and refuse to do it. We don't impress // anyone by spewing tons of binary goo to a terminal. - if (Out == &std::cout && isStandardOutAConsole() && !Force && !NoOutput - && !Quiet) { - std::cerr << "WARNING: It looks like you're attempting to print out a " - << "bytecode file. I'm\ngoing to pretend you didn't ask me to do" - << " this (for your own good). If you\nREALLY want to taste LLVM" - << " bytecode first-hand, you can force output with the\n`-f'" - << " option.\n\n"; + if (!Force && !NoOutput && !Quiet && CheckBytecodeOutputToConsole(Out)) { NoOutput = true; } From reid at x10sys.com Sat Jan 1 18:08:57 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 18:08:57 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-as/llvm-as.cpp Message-ID: <200501020008.SAA24183@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-as: llvm-as.cpp updated: 1.40 -> 1.41 --- Log message: Prevent output of bytecode to std::cout unless the --force flag is given. This prevents bytecode splats with usage like: cat file.ll | llvm-as - --- Diffs of the changes: (+4 -1) Index: llvm/tools/llvm-as/llvm-as.cpp diff -u llvm/tools/llvm-as/llvm-as.cpp:1.40 llvm/tools/llvm-as/llvm-as.cpp:1.41 --- llvm/tools/llvm-as/llvm-as.cpp:1.40 Sat Jan 1 16:10:32 2005 +++ llvm/tools/llvm-as/llvm-as.cpp Sat Jan 1 18:08:46 2005 @@ -20,6 +20,7 @@ #include "llvm/Bytecode/Writer.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/SystemUtils.h" #include "llvm/System/Signals.h" #include #include @@ -124,7 +125,9 @@ return 1; } - WriteBytecodeToFile(M.get(), *Out, !NoCompress); + if (Force || !CheckBytecodeOutputToConsole(Out,true)) { + WriteBytecodeToFile(M.get(), *Out, !NoCompress); + } } catch (const ParseException &E) { std::cerr << argv[0] << ": " << E.getMessage() << "\n"; exitCode = 1; From reid at x10sys.com Sat Jan 1 18:10:14 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 18:10:14 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/SystemUtils.cpp Message-ID: <200501020010.SAA24208@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SystemUtils.cpp updated: 1.39 -> 1.40 --- Log message: Make printing a warning message optional in CheckBytecodeOutputToConsole. --- Diffs of the changes: (+8 -5) Index: llvm/lib/Support/SystemUtils.cpp diff -u llvm/lib/Support/SystemUtils.cpp:1.39 llvm/lib/Support/SystemUtils.cpp:1.40 --- llvm/lib/Support/SystemUtils.cpp:1.39 Sat Jan 1 17:56:20 2005 +++ llvm/lib/Support/SystemUtils.cpp Sat Jan 1 18:10:03 2005 @@ -19,12 +19,15 @@ using namespace llvm; -bool llvm::CheckBytecodeOutputToConsole(std::ostream* stream_to_check) { +bool llvm::CheckBytecodeOutputToConsole(std::ostream* stream_to_check, + bool print_warning) { if (stream_to_check == &std::cout && sys::Process::StandardOutIsDisplayed()) { - std::cerr << "WARNING: You're attempting to print out a bytecode file.\n"; - std::cerr << "This is inadvisable as it may cause display problems. If\n"; - std::cerr << "you REALLY want to taste LLVM bytecode first-hand, you can\n"; - std::cerr << "force output with the `-f' option.\n\n"; + if (print_warning) { + std::cerr << "WARNING: You're attempting to print out a bytecode file.\n"; + std::cerr << "This is inadvisable as it may cause display problems. If\n"; + std::cerr << "you REALLY want to taste LLVM bytecode first-hand, you\n"; + std::cerr << "can force output with the `-f' option.\n\n"; + } return true; } return false; From reid at x10sys.com Sat Jan 1 18:10:14 2005 From: reid at x10sys.com (Reid Spencer) Date: Sat, 1 Jan 2005 18:10:14 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/SystemUtils.h Message-ID: <200501020010.SAA24207@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: SystemUtils.h updated: 1.18 -> 1.19 --- Log message: Make printing a warning message optional in CheckBytecodeOutputToConsole. --- Diffs of the changes: (+4 -1) Index: llvm/include/llvm/Support/SystemUtils.h diff -u llvm/include/llvm/Support/SystemUtils.h:1.18 llvm/include/llvm/Support/SystemUtils.h:1.19 --- llvm/include/llvm/Support/SystemUtils.h:1.18 Sat Jan 1 17:56:20 2005 +++ llvm/include/llvm/Support/SystemUtils.h Sat Jan 1 18:10:03 2005 @@ -24,7 +24,10 @@ /// advising against display of bytecode and return true. Otherwise just return /// false /// @brief Check for output written to a console -bool CheckBytecodeOutputToConsole(std::ostream* stream_to_check); +bool CheckBytecodeOutputToConsole( + std::ostream* stream_to_check, ///< The stream to be checked + bool print_warning = true ///< Control whether warnings are printed +); /// FindExecutable - Find a named executable, giving the argv[0] of program /// being executed. This allows us to find another LLVM tool if it is built into From lattner at cs.uiuc.edu Sat Jan 1 20:28:03 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 20:28:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/Target.td Message-ID: <200501020228.j022S3ES028794@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target: Target.td updated: 1.42 -> 1.43 --- Log message: Add some bits that can be set for instructions. --- Diffs of the changes: (+2 -0) Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.42 llvm/lib/Target/Target.td:1.43 --- llvm/lib/Target/Target.td:1.42 Thu Oct 14 00:53:40 2004 +++ llvm/lib/Target/Target.td Sat Jan 1 20:27:48 2005 @@ -133,6 +133,8 @@ bit isLoad = 0; // Is this instruction a load instruction? bit isStore = 0; // Is this instruction a store instruction? bit isTwoAddress = 0; // Is this a two address instruction? + bit isConvertibleToThreeAddress = 0; // Can this 2-addr instruction promote? + bit isCommutable = 0; // Is this 3 operand instruction commutable? bit isTerminator = 0; // Is this part of the terminator for a basic block? bit hasDelaySlot = 0; // Does this instruction have an delay slot? } From lattner at cs.uiuc.edu Sat Jan 1 20:28:43 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 20:28:43 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h Message-ID: <200501020228.j022Sh24028902@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Target: TargetInstrInfo.h updated: 1.73 -> 1.74 --- Log message: Add some bits that can be set on instructions. Renumber existing bits so they are dense. Add a virtual method that targets can choose to implement. --- Diffs of the changes: (+30 -5) Index: llvm/include/llvm/Target/TargetInstrInfo.h diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.73 llvm/include/llvm/Target/TargetInstrInfo.h:1.74 --- llvm/include/llvm/Target/TargetInstrInfo.h:1.73 Wed Oct 27 11:14:51 2004 +++ llvm/include/llvm/Target/TargetInstrInfo.h Sat Jan 1 20:28:31 2005 @@ -50,16 +50,27 @@ const unsigned M_BARRIER_FLAG = 1 << 4; const unsigned M_DELAY_SLOT_FLAG = 1 << 5; const unsigned M_CC_FLAG = 1 << 6; -const unsigned M_LOAD_FLAG = 1 << 10; -const unsigned M_STORE_FLAG = 1 << 12; -// 3-addr instructions which really work like 2-addr ones, eg. X86 add/sub -const unsigned M_2_ADDR_FLAG = 1 << 15; +const unsigned M_LOAD_FLAG = 1 << 7; +const unsigned M_STORE_FLAG = 1 << 8; + +// M_2_ADDR_FLAG - 3-addr instructions which really work like 2-addr ones. +const unsigned M_2_ADDR_FLAG = 1 << 9; + +// M_CONVERTIBLE_TO_3_ADDR - This is a M_2_ADDR_FLAG instruction which can be +// changed into a 3-address instruction if the first two operands cannot be +// assigned to the same register. The target must implement the +// TargetInstrInfo::convertToThreeAddress method for this instruction. +const unsigned M_CONVERTIBLE_TO_3_ADDR = 1 << 10; + +// This M_COMMUTABLE - is a 2- or 3-address instruction (of the form X = op Y, +// Z), which produces the same result if Y and Z are exchanged. +const unsigned M_COMMUTABLE = 1 << 11; // M_TERMINATOR_FLAG - Is this instruction part of the terminator for a basic // block? Typically this is things like return and branch instructions. // Various passes use this to insert code into the bottom of a basic block, but // before control flow occurs. -const unsigned M_TERMINATOR_FLAG = 1 << 16; +const unsigned M_TERMINATOR_FLAG = 1 << 12; class TargetInstrDescriptor { public: @@ -152,6 +163,20 @@ return false; } + /// convertToThreeAddress - This method must be implemented by targets that + /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target + /// may be able to convert a two-address instruction into a true + /// three-address instruction on demand. This allows the X86 target (for + /// example) to convert ADD and SHL instructions into LEA instructions if they + /// would require register copies due to two-addressness. + /// + /// This method returns a null pointer if the transformation cannot be + /// performed, otherwise it returns the new instruction. + /// + virtual MachineInstr *convertToThreeAddress(MachineInstr *TA) const { + return 0; + } + /// Insert a goto (unconditional branch) sequence to TMBB, at the /// end of MBB virtual void insertGoto(MachineBasicBlock& MBB, From lattner at cs.uiuc.edu Sat Jan 1 20:29:16 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 20:29:16 -0600 Subject: [llvm-commits] CVS: llvm/utils/TableGen/CodeGenInstruction.h CodeGenTarget.cpp InstrInfoEmitter.cpp Message-ID: <200501020229.j022TG6a028921@apoc.cs.uiuc.edu> Changes in directory llvm/utils/TableGen: CodeGenInstruction.h updated: 1.6 -> 1.7 CodeGenTarget.cpp updated: 1.25 -> 1.26 InstrInfoEmitter.cpp updated: 1.15 -> 1.16 --- Log message: Expose isConvertibleToThreeAddress and isCommutable bits to the code generator. --- Diffs of the changes: (+6 -0) Index: llvm/utils/TableGen/CodeGenInstruction.h diff -u llvm/utils/TableGen/CodeGenInstruction.h:1.6 llvm/utils/TableGen/CodeGenInstruction.h:1.7 --- llvm/utils/TableGen/CodeGenInstruction.h:1.6 Tue Sep 28 16:01:45 2004 +++ llvm/utils/TableGen/CodeGenInstruction.h Sat Jan 1 20:29:04 2005 @@ -74,6 +74,8 @@ bool isLoad; bool isStore; bool isTwoAddress; + bool isConvertibleToThreeAddress; + bool isCommutable; bool isTerminator; bool hasDelaySlot; Index: llvm/utils/TableGen/CodeGenTarget.cpp diff -u llvm/utils/TableGen/CodeGenTarget.cpp:1.25 llvm/utils/TableGen/CodeGenTarget.cpp:1.26 --- llvm/utils/TableGen/CodeGenTarget.cpp:1.25 Thu Oct 14 00:50:43 2004 +++ llvm/utils/TableGen/CodeGenTarget.cpp Sat Jan 1 20:29:04 2005 @@ -217,6 +217,8 @@ isLoad = R->getValueAsBit("isLoad"); isStore = R->getValueAsBit("isStore"); isTwoAddress = R->getValueAsBit("isTwoAddress"); + isConvertibleToThreeAddress = R->getValueAsBit("isConvertibleToThreeAddress"); + isCommutable = R->getValueAsBit("isCommutable"); isTerminator = R->getValueAsBit("isTerminator"); hasDelaySlot = R->getValueAsBit("hasDelaySlot"); Index: llvm/utils/TableGen/InstrInfoEmitter.cpp diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.15 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.16 --- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.15 Tue Sep 28 16:01:45 2004 +++ llvm/utils/TableGen/InstrInfoEmitter.cpp Sat Jan 1 20:29:04 2005 @@ -116,6 +116,8 @@ if (Inst.isLoad) OS << "|M_LOAD_FLAG"; if (Inst.isStore) OS << "|M_STORE_FLAG"; if (Inst.isTwoAddress) OS << "|M_2_ADDR_FLAG"; + if (Inst.isConvertibleToThreeAddress) OS << "|M_CONVERTIBLE_TO_3_ADDR"; + if (Inst.isCommutable) OS << "|M_COMMUTABLE"; if (Inst.isTerminator) OS << "|M_TERMINATOR_FLAG"; OS << ", 0"; From lattner at cs.uiuc.edu Sat Jan 1 20:30:17 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 20:30:17 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/commute-two-addr.ll overlap-add.ll overlap-shift.ll Message-ID: <200501020230.j022UHxA029062@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: commute-two-addr.ll added (r1.1) overlap-add.ll added (r1.1) overlap-shift.ll added (r1.1) --- Log message: Add several testcases for new optimizations in the code generator. --- Diffs of the changes: (+62 -0) Index: llvm/test/Regression/CodeGen/X86/commute-two-addr.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/commute-two-addr.ll:1.1 *** /dev/null Sat Jan 1 20:30:15 2005 --- llvm/test/Regression/CodeGen/X86/commute-two-addr.ll Sat Jan 1 20:30:04 2005 *************** *** 0 **** --- 1,21 ---- + ; The register allocator can commute two-address instructions to avoid + ; insertion of register-register copies. + + ; Check that there are no register-register copies left. + ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | not grep 'mov %E.X, %E.X' + + %G = external global int + + declare void %ext(int) + + int %add_test(int %X, int %Y) { + %Z = add int %X, %Y ;; Last use of Y, but not of X. + store int %Z, int* %G + ret int %X + } + + int %xor_test(int %X, int %Y) { + %Z = xor int %X, %Y ;; Last use of Y, but not of X. + store int %Z, int* %G + ret int %X + } Index: llvm/test/Regression/CodeGen/X86/overlap-add.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/overlap-add.ll:1.1 *** /dev/null Sat Jan 1 20:30:17 2005 --- llvm/test/Regression/CodeGen/X86/overlap-add.ll Sat Jan 1 20:30:04 2005 *************** *** 0 **** --- 1,24 ---- + ;; X's live range extends beyond the shift, so the register allocator + ;; cannot coallesce it with Y. Because of this, a copy needs to be + ;; emitted before the shift to save the register value before it is + ;; clobbered. However, this copy is not needed if the register + ;; allocator turns the shift into an LEA. This also occurs for ADD. + + ; Check that the shift gets turned into an LEA. + + ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | not grep 'mov %E.X, %E.X' + + %G = external global int + + int %test1(int %X, int %Y) { + %Z = add int %X, %Y + volatile store int %Y, int* %G + volatile store int %Z, int* %G + ret int %X + } + + int %test2(int %X) { + %Z = add int %X, 1 ;; inc + volatile store int %Z, int* %G + ret int %X + } Index: llvm/test/Regression/CodeGen/X86/overlap-shift.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/overlap-shift.ll:1.1 *** /dev/null Sat Jan 1 20:30:17 2005 --- llvm/test/Regression/CodeGen/X86/overlap-shift.ll Sat Jan 1 20:30:04 2005 *************** *** 0 **** --- 1,17 ---- + ;; X's live range extends beyond the shift, so the register allocator + ;; cannot coallesce it with Y. Because of this, a copy needs to be + ;; emitted before the shift to save the register value before it is + ;; clobbered. However, this copy is not needed if the register + ;; allocator turns the shift into an LEA. This also occurs for ADD. + + ; Check that the shift gets turned into an LEA. + + ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | not grep 'mov %E.X, %E.X' + + %G = external global int + + int %test1(int %X) { + %Z = shl int %X, ubyte 2 + volatile store int %Z, int* %G + ret int %X + } From lattner at cs.uiuc.edu Sat Jan 1 20:34:24 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 20:34:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Message-ID: <200501020234.j022YOdG029484@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: TwoAddressInstructionPass.cpp updated: 1.27 -> 1.28 --- Log message: Make the 2-address instruction lowering pass smarter in two ways: 1. If we are two-addressing a commutable instruction and the LHS is not the last use of the variable, see if the instruction is the last use of the RHS. If so, commute the instruction, allowing us to avoid a register-register copy in many cases for common instructions like ADD, OR, AND, etc on X86. 2. If #1 doesn't hold, and if this is an instruction that also existing in 3-address form, promote the instruction to a 3-address instruction to avoid the register-register copy. We can do this for several common instructions in X86, including ADDrr, INC, DEC, etc. This patch implements test/Regression/CodeGen/X86/commute-two-addr.ll, overlap-add.ll, and overlap-shift.ll when I check in the X86 support for it. --- Diffs of the changes: (+62 -18) Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.27 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.28 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.27 Wed Sep 1 17:55:35 2004 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Sat Jan 1 20:34:12 2005 @@ -43,8 +43,12 @@ using namespace llvm; namespace { - Statistic<> numTwoAddressInstrs("twoaddressinstruction", + Statistic<> NumTwoAddressInstrs("twoaddressinstruction", "Number of two-address instructions"); + Statistic<> NumCommuted("twoaddressinstruction", + "Number of instructions commuted to coallesce"); + Statistic<> NumConvertedTo3Addr("twoaddressinstruction", + "Number of instructions promoted to 3-address"); struct TwoAddressInstructionPass : public MachineFunctionPass { virtual void getAnalysisUsage(AnalysisUsage &AU) const; @@ -60,6 +64,7 @@ const PassInfo *llvm::TwoAddressInstructionPassID = X.getPassInfo(); void TwoAddressInstructionPass::getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); AU.addPreserved(); AU.addPreservedID(PHIEliminationID); MachineFunctionPass::getAnalysisUsage(AU); @@ -73,7 +78,7 @@ const TargetMachine &TM = MF.getTarget(); const MRegisterInfo &MRI = *TM.getRegisterInfo(); const TargetInstrInfo &TII = *TM.getInstrInfo(); - LiveVariables* LV = getAnalysisToUpdate(); + LiveVariables &LV = getAnalysis(); bool MadeChange = false; @@ -91,7 +96,7 @@ if (!TII.isTwoAddrInstr(opcode)) continue; - ++numTwoAddressInstrs; + ++NumTwoAddressInstrs; DEBUG(std::cerr << '\t'; mi->print(std::cerr, &TM)); assert(mi->getOperand(1).isRegister() && mi->getOperand(1).getReg() && mi->getOperand(1).isUse() && "two address instruction invalid"); @@ -111,34 +116,73 @@ MRegisterInfo::isVirtualRegister(regB) && "cannot update physical register live information"); - // first make sure we do not have a use of a in the - // instruction (a = b + a for example) because our - // transformation will not work. This should never occur - // because we are in SSA form. #ifndef NDEBUG + // First, verify that we do not have a use of a in the instruction (a = + // b + a for example) because our transformation will not work. This + // should never occur because we are in SSA form. for (unsigned i = 1; i != mi->getNumOperands(); ++i) assert(!mi->getOperand(i).isRegister() || mi->getOperand(i).getReg() != regA); #endif + // If this instruction is not the killing user of B, see if we can + // rearrange the code to make it so. Making it the killing user will + // allow us to coallesce A and B together, eliminating the copy we are + // about to insert. + if (!LV.KillsRegister(mi, regB)) { + const TargetInstrDescriptor &TID = TII.get(opcode); + + // If this instruction is commutative, check to see if C dies. If so, + // swap the B and C operands. This makes the live ranges of A and C + // joinable. + if (TID.Flags & M_COMMUTABLE) { + assert(mi->getOperand(2).isRegister() && + "Not a proper commutative instruction!"); + unsigned regC = mi->getOperand(2).getReg(); + if (LV.KillsRegister(mi, regC)) { + DEBUG(std::cerr << "2addr: COMMUTING : " << *mi); + mi->SetMachineOperandReg(2, regB); + mi->SetMachineOperandReg(1, regC); + DEBUG(std::cerr << "2addr: COMMUTED TO: " << *mi); + ++NumCommuted; + regB = regC; + goto InstructionRearranged; + } + } + // If this instruction is potentially convertible to a true + // three-address instruction, + if (TID.Flags & M_CONVERTIBLE_TO_3_ADDR) + if (MachineInstr *New = TII.convertToThreeAddress(mi)) { + DEBUG(std::cerr << "2addr: CONVERTING 2-ADDR: " << *mi); + DEBUG(std::cerr << "2addr: TO 3-ADDR: " << *New); + LV.instructionChanged(mi, New); // Update live variables + mbbi->insert(mi, New); // Insert the new inst + mbbi->erase(mi); // Nuke the old inst. + mi = New; + ++NumConvertedTo3Addr; + assert(!TII.isTwoAddrInstr(New->getOpcode()) && + "convertToThreeAddress returned a 2-addr instruction??"); + // Done with this instruction. + continue; + } + } + InstructionRearranged: const TargetRegisterClass* rc = MF.getSSARegMap()->getRegClass(regA); MRI.copyRegToReg(*mbbi, mi, regA, regB, rc); MachineBasicBlock::iterator prevMi = prior(mi); DEBUG(std::cerr << "\t\tprepend:\t"; prevMi->print(std::cerr, &TM)); - if (LV) { - // update live variables for regA - LiveVariables::VarInfo& varInfo = LV->getVarInfo(regA); - varInfo.DefInst = prevMi; - - // update live variables for regB - if (LV->removeVirtualRegisterKilled(regB, mbbi, mi)) - LV->addVirtualRegisterKilled(regB, prevMi); + // Update live variables for regA + LiveVariables::VarInfo& varInfo = LV.getVarInfo(regA); + varInfo.DefInst = prevMi; + + // update live variables for regB + if (LV.removeVirtualRegisterKilled(regB, mbbi, mi)) + LV.addVirtualRegisterKilled(regB, prevMi); - if (LV->removeVirtualRegisterDead(regB, mbbi, mi)) - LV->addVirtualRegisterDead(regB, prevMi); - } + if (LV.removeVirtualRegisterDead(regB, mbbi, mi)) + LV.addVirtualRegisterDead(regB, prevMi); // replace all occurences of regB with regA for (unsigned i = 1, e = mi->getNumOperands(); i != e; ++i) { From lattner at cs.uiuc.edu Sat Jan 1 20:35:59 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 20:35:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.td Message-ID: <200501020235.j022ZxoF029758@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrInfo.td updated: 1.112 -> 1.113 --- Log message: Two changes here: 1. Add new instructions for checking parity flags: JP, JNP, SETP, SETNP. 2. Set the isCommutable and isPromotableTo3Address bits on several instructions. --- Diffs of the changes: (+30 -1) Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.112 llvm/lib/Target/X86/X86InstrInfo.td:1.113 --- llvm/lib/Target/X86/X86InstrInfo.td:1.112 Tue Nov 9 22:48:15 2004 +++ llvm/lib/Target/X86/X86InstrInfo.td Sat Jan 1 20:35:46 2005 @@ -170,6 +170,8 @@ def JA : IBr<0x87, (ops i32imm:$dst), "ja $dst">, TB; def JS : IBr<0x88, (ops i32imm:$dst), "js $dst">, TB; def JNS : IBr<0x89, (ops i32imm:$dst), "jns $dst">, TB; +def JP : IBr<0x8A, (ops i32imm:$dst), "jp $dst">, TB; +def JNP : IBr<0x8B, (ops i32imm:$dst), "jnp $dst">, TB; def JL : IBr<0x8C, (ops i32imm:$dst), "jl $dst">, TB; def JGE : IBr<0x8D, (ops i32imm:$dst), "jge $dst">, TB; def JLE : IBr<0x8E, (ops i32imm:$dst), "jle $dst">, TB; @@ -556,8 +558,10 @@ } def INC8r : I<0xFE, MRM0r, (ops R8 :$dst, R8 :$src), "inc{b} $dst">; +let isConvertibleToThreeAddress = 1 in { // Can transform into LEA. def INC16r : I<0xFF, MRM0r, (ops R16:$dst, R16:$src), "inc{w} $dst">, OpSize; def INC32r : I<0xFF, MRM0r, (ops R32:$dst, R32:$src), "inc{l} $dst">; +} let isTwoAddress = 0 in { def INC8m : I<0xFE, MRM0m, (ops i8mem :$dst), "inc{b} $dst">; def INC16m : I<0xFF, MRM0m, (ops i16mem:$dst), "inc{w} $dst">, OpSize; @@ -565,8 +569,10 @@ } def DEC8r : I<0xFE, MRM1r, (ops R8 :$dst, R8 :$src), "dec{b} $dst">; +let isConvertibleToThreeAddress = 1 in { // Can transform into LEA. def DEC16r : I<0xFF, MRM1r, (ops R16:$dst, R16:$src), "dec{w} $dst">, OpSize; def DEC32r : I<0xFF, MRM1r, (ops R32:$dst, R32:$src), "dec{l} $dst">; +} let isTwoAddress = 0 in { def DEC8m : I<0xFE, MRM1m, (ops i8mem :$dst), "dec{b} $dst">; @@ -575,6 +581,7 @@ } // Logical operators... +let isCommutable = 1 in { // X = AND Y, Z --> X = AND Z, Y def AND8rr : I<0x20, MRMDestReg, (ops R8 :$dst, R8 :$src1, R8 :$src2), "and{b} {$src2, $dst|$dst, $src2}">; @@ -584,6 +591,7 @@ def AND32rr : I<0x21, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2), "and{l} {$src2, $dst|$dst, $src2}">; +} def AND8rm : I<0x22, MRMSrcMem, (ops R8 :$dst, R8 :$src1, i8mem :$src2), @@ -639,12 +647,14 @@ } +let isCommutable = 1 in { // X = OR Y, Z --> X = OR Z, Y def OR8rr : I<0x08, MRMDestReg, (ops R8 :$dst, R8 :$src1, R8 :$src2), "or{b} {$src2, $dst|$dst, $src2}">; def OR16rr : I<0x09, MRMDestReg, (ops R16:$dst, R16:$src1, R16:$src2), "or{w} {$src2, $dst|$dst, $src2}">, OpSize; def OR32rr : I<0x09, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2), "or{l} {$src2, $dst|$dst, $src2}">; +} def OR8rm : I<0x0A, MRMSrcMem , (ops R8 :$dst, R8 :$src1, i8mem :$src2), "or{b} {$src2, $dst|$dst, $src2}">; def OR16rm : I<0x0B, MRMSrcMem , (ops R16:$dst, R16:$src1, i16mem:$src2), @@ -683,6 +693,7 @@ } +let isCommutable = 1 in { // X = XOR Y, Z --> X = XOR Z, Y def XOR8rr : I<0x30, MRMDestReg, (ops R8 :$dst, R8 :$src1, R8 :$src2), "xor{b} {$src2, $dst|$dst, $src2}">; @@ -692,6 +703,8 @@ def XOR32rr : I<0x31, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2), "xor{l} {$src2, $dst|$dst, $src2}">; +} + def XOR8rm : I<0x32, MRMSrcMem , (ops R8 :$dst, R8:$src1, i8mem :$src2), "xor{b} {$src2, $dst|$dst, $src2}">; @@ -752,12 +765,15 @@ "shl{w} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>, OpSize; def SHL32rCL : I<0xD3, MRM4r, (ops R32:$dst, R32:$src), "shl{l} {%cl, $dst|$dst, %CL}">, Imp<[CL],[]>; + def SHL8ri : Ii8<0xC0, MRM4r, (ops R8 :$dst, R8 :$src1, i8imm:$src2), "shl{b} {$src2, $dst|$dst, $src2}">; +let isConvertibleToThreeAddress = 1 in { // Can transform into LEA. def SHL16ri : Ii8<0xC1, MRM4r, (ops R16:$dst, R16:$src1, i8imm:$src2), "shl{w} {$src2, $dst|$dst, $src2}">, OpSize; def SHL32ri : Ii8<0xC1, MRM4r, (ops R32:$dst, R32:$src1, i8imm:$src2), "shl{l} {$src2, $dst|$dst, $src2}">; +} let isTwoAddress = 0 in { def SHL8mCL : I<0xD2, MRM4m, (ops i8mem :$dst), @@ -860,13 +876,17 @@ } -// Arithmetic... +// Arithmetic. +let isCommutable = 1 in { // X = ADD Y, Z --> X = ADD Z, Y def ADD8rr : I<0x00, MRMDestReg, (ops R8 :$dst, R8 :$src1, R8 :$src2), "add{b} {$src2, $dst|$dst, $src2}">; +let isConvertibleToThreeAddress = 1 in { // Can transform into LEA. def ADD16rr : I<0x01, MRMDestReg, (ops R16:$dst, R16:$src1, R16:$src2), "add{w} {$src2, $dst|$dst, $src2}">, OpSize; def ADD32rr : I<0x01, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2), "add{l} {$src2, $dst|$dst, $src2}">; +} // end isConvertibleToThreeAddress +} // end isCommutable def ADD8rm : I<0x02, MRMSrcMem, (ops R8 :$dst, R8 :$src1, i8mem :$src2), "add{b} {$src2, $dst|$dst, $src2}">; def ADD16rm : I<0x03, MRMSrcMem, (ops R16:$dst, R16:$src1, i16mem:$src2), @@ -876,10 +896,13 @@ def ADD8ri : Ii8<0x80, MRM0r, (ops R8:$dst, R8:$src1, i8imm:$src2), "add{b} {$src2, $dst|$dst, $src2}">; + +let isConvertibleToThreeAddress = 1 in { // Can transform into LEA. def ADD16ri : Ii16<0x81, MRM0r, (ops R16:$dst, R16:$src1, i16imm:$src2), "add{w} {$src2, $dst|$dst, $src2}">, OpSize; def ADD32ri : Ii32<0x81, MRM0r, (ops R32:$dst, R32:$src1, i32imm:$src2), "add{l} {$src2, $dst|$dst, $src2}">; +} def ADD16ri8 : Ii8<0x83, MRM0r, (ops R16:$dst, R16:$src1, i8imm:$src2), "add{w} {$src2, $dst|$dst, $src2}">, OpSize; @@ -1039,12 +1062,14 @@ //===----------------------------------------------------------------------===// // Test instructions are just like AND, except they don't generate a result. // +let isCommutable = 1 in { // TEST X, Y --> TEST Y, X def TEST8rr : I<0x84, MRMDestReg, (ops R8:$src1, R8:$src2), "test{b} {$src2, $src1|$src1, $src2}">; def TEST16rr : I<0x85, MRMDestReg, (ops R16:$src1, R16:$src2), "test{w} {$src2, $src1|$src1, $src2}">, OpSize; def TEST32rr : I<0x85, MRMDestReg, (ops R32:$src1, R32:$src2), "test{l} {$src2, $src1|$src1, $src2}">; +} def TEST8mr : I<0x84, MRMDestMem, (ops i8mem :$src1, R8 :$src2), "test{b} {$src2, $src1|$src1, $src2}">; def TEST16mr : I<0x85, MRMDestMem, (ops i16mem:$src1, R16:$src2), @@ -1119,6 +1144,10 @@ (ops R8 :$dst), "setp $dst">, TB; // R8 = parity def SETPm : I<0x9A, MRM0m, (ops i8mem:$dst), "setp $dst">, TB; // [mem8] = parity +def SETNPr : I<0x9B, MRM0r, + (ops R8 :$dst), "setnp $dst">, TB; // R8 = not parity +def SETNPm : I<0x9B, MRM0m, + (ops i8mem:$dst), "setnp $dst">, TB; // [mem8] = not parity def SETLr : I<0x9C, MRM0r, (ops R8 :$dst), "setl $dst">, TB; // R8 = < signed def SETLm : I<0x9C, MRM0m, From lattner at cs.uiuc.edu Sat Jan 1 20:37:19 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 20:37:19 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.h X86InstrInfo.cpp Message-ID: <200501020237.j022bJAc030040@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrInfo.h updated: 1.43 -> 1.44 X86InstrInfo.cpp updated: 1.32 -> 1.33 --- Log message: Implement the convertToThreeAddress method, add support for inverting JP/JNP branches. --- Diffs of the changes: (+93 -0) Index: llvm/lib/Target/X86/X86InstrInfo.h diff -u llvm/lib/Target/X86/X86InstrInfo.h:1.43 llvm/lib/Target/X86/X86InstrInfo.h:1.44 --- llvm/lib/Target/X86/X86InstrInfo.h:1.43 Wed Aug 11 02:12:04 2004 +++ llvm/lib/Target/X86/X86InstrInfo.h Sat Jan 1 20:37:07 2005 @@ -179,6 +179,18 @@ unsigned& sourceReg, unsigned& destReg) const; + /// convertToThreeAddress - This method must be implemented by targets that + /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target + /// may be able to convert a two-address instruction into a true + /// three-address instruction on demand. This allows the X86 target (for + /// example) to convert ADD and SHL instructions into LEA instructions if they + /// would require register copies due to two-addressness. + /// + /// This method returns a null pointer if the transformation cannot be + /// performed, otherwise it returns the new instruction. + /// + virtual MachineInstr *convertToThreeAddress(MachineInstr *TA) const; + /// Insert a goto (unconditional branch) sequence to TMBB, at the /// end of MBB virtual void insertGoto(MachineBasicBlock& MBB, Index: llvm/lib/Target/X86/X86InstrInfo.cpp diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.32 llvm/lib/Target/X86/X86InstrInfo.cpp:1.33 --- llvm/lib/Target/X86/X86InstrInfo.cpp:1.32 Sun Aug 1 14:31:30 2004 +++ llvm/lib/Target/X86/X86InstrInfo.cpp Sat Jan 1 20:37:07 2005 @@ -13,6 +13,7 @@ #include "X86InstrInfo.h" #include "X86.h" +#include "X86InstrBuilder.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "X86GenInstrInfo.inc" using namespace llvm; @@ -39,6 +40,83 @@ return false; } +/// convertToThreeAddress - This method must be implemented by targets that +/// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target +/// may be able to convert a two-address instruction into a true +/// three-address instruction on demand. This allows the X86 target (for +/// example) to convert ADD and SHL instructions into LEA instructions if they +/// would require register copies due to two-addressness. +/// +/// This method returns a null pointer if the transformation cannot be +/// performed, otherwise it returns the new instruction. +/// +MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr *MI) const { + // All instructions input are two-addr instructions. Get the known operands. + unsigned Dest = MI->getOperand(0).getReg(); + unsigned Src = MI->getOperand(1).getReg(); + + // FIXME: 16-bit LEA's are really slow on Athlons, but not bad on P4's. When + // we have subtarget support, enable the 16-bit LEA generation here. + bool DisableLEA16 = true; + + switch (MI->getOpcode()) { + case X86::INC32r: + assert(MI->getNumOperands() == 2 && "Unknown inc instruction!"); + return addRegOffset(BuildMI(X86::LEA32r, 5, Dest), Src, 1); + case X86::INC16r: + if (DisableLEA16) return 0; + assert(MI->getNumOperands() == 2 && "Unknown inc instruction!"); + return addRegOffset(BuildMI(X86::LEA16r, 5, Dest), Src, 1); + case X86::DEC32r: + assert(MI->getNumOperands() == 2 && "Unknown dec instruction!"); + return addRegOffset(BuildMI(X86::LEA32r, 5, Dest), Src, -1); + case X86::DEC16r: + if (DisableLEA16) return 0; + assert(MI->getNumOperands() == 2 && "Unknown dec instruction!"); + return addRegOffset(BuildMI(X86::LEA16r, 5, Dest), Src, -1); + case X86::ADD32rr: + assert(MI->getNumOperands() == 3 && "Unknown add instruction!"); + return addRegReg(BuildMI(X86::LEA32r, 5, Dest), Src, + MI->getOperand(2).getReg()); + case X86::ADD16rr: + if (DisableLEA16) return 0; + assert(MI->getNumOperands() == 3 && "Unknown add instruction!"); + return addRegReg(BuildMI(X86::LEA16r, 5, Dest), Src, + MI->getOperand(2).getReg()); + case X86::ADD32ri: + assert(MI->getNumOperands() == 3 && "Unknown add instruction!"); + if (MI->getOperand(2).isImmediate()) + return addRegOffset(BuildMI(X86::LEA32r, 5, Dest), Src, + MI->getOperand(2).getImmedValue()); + return 0; + case X86::ADD16ri: + if (DisableLEA16) return 0; + assert(MI->getNumOperands() == 3 && "Unknown add instruction!"); + if (MI->getOperand(2).isImmediate()) + return addRegOffset(BuildMI(X86::LEA16r, 5, Dest), Src, + MI->getOperand(2).getImmedValue()); + break; + + case X86::SHL16ri: + if (DisableLEA16) return 0; + case X86::SHL32ri: + assert(MI->getNumOperands() == 3 && MI->getOperand(2).isImmediate() && + "Unknown shl instruction!"); + unsigned ShAmt = MI->getOperand(2).getImmedValue(); + if (ShAmt == 1 || ShAmt == 2 || ShAmt == 3) { + X86AddressMode AM; + AM.Scale = 1 << ShAmt; + AM.IndexReg = Src; + unsigned Opc = MI->getOpcode() == X86::SHL32ri ? X86::LEA32r :X86::LEA16r; + return addFullAddress(BuildMI(Opc, 5, Dest), AM); + } + break; + } + + return 0; +} + + void X86InstrInfo::insertGoto(MachineBasicBlock& MBB, MachineBasicBlock& TMBB) const { BuildMI(MBB, MBB.end(), X86::JMP, 1).addMBB(&TMBB); @@ -59,6 +137,8 @@ case X86::JA: ROpcode = X86::JBE; break; case X86::JS: ROpcode = X86::JNS; break; case X86::JNS: ROpcode = X86::JS; break; + case X86::JP: ROpcode = X86::JNP; break; + case X86::JNP: ROpcode = X86::JP; break; case X86::JL: ROpcode = X86::JGE; break; case X86::JGE: ROpcode = X86::JL; break; case X86::JLE: ROpcode = X86::JG; break; @@ -68,3 +148,4 @@ MachineBasicBlock* TMBB = MI->getOperand(0).getMachineBasicBlock(); return BuildMI(*MBB, MBB->erase(MI), ROpcode, 1).addMBB(TMBB); } + From lattner at cs.uiuc.edu Sat Jan 1 20:37:59 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 20:37:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86RegisterInfo.cpp Message-ID: <200501020237.j022bx7e030064@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86RegisterInfo.cpp updated: 1.95 -> 1.96 --- Log message: Add support for SETNPr to lower to memory form. --- Diffs of the changes: (+1 -0) Index: llvm/lib/Target/X86/X86RegisterInfo.cpp diff -u llvm/lib/Target/X86/X86RegisterInfo.cpp:1.95 llvm/lib/Target/X86/X86RegisterInfo.cpp:1.96 --- llvm/lib/Target/X86/X86RegisterInfo.cpp:1.95 Thu Dec 2 12:17:31 2004 +++ llvm/lib/Target/X86/X86RegisterInfo.cpp Sat Jan 1 20:37:46 2005 @@ -234,6 +234,7 @@ case X86::SETSr: return MakeMInst( X86::SETSm, FrameIndex, MI); case X86::SETNSr: return MakeMInst( X86::SETNSm, FrameIndex, MI); case X86::SETPr: return MakeMInst( X86::SETPm, FrameIndex, MI); + case X86::SETNPr: return MakeMInst( X86::SETNPm, FrameIndex, MI); case X86::SETLr: return MakeMInst( X86::SETLm, FrameIndex, MI); case X86::SETGEr: return MakeMInst( X86::SETGEm, FrameIndex, MI); case X86::SETLEr: return MakeMInst( X86::SETLEm, FrameIndex, MI); From lattner at cs.uiuc.edu Sat Jan 1 20:38:30 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 20:38:30 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrBuilder.h Message-ID: <200501020238.j022cUcm030078@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrBuilder.h updated: 1.14 -> 1.15 --- Log message: Add a new method. --- Diffs of the changes: (+10 -1) Index: llvm/lib/Target/X86/X86InstrBuilder.h diff -u llvm/lib/Target/X86/X86InstrBuilder.h:1.14 llvm/lib/Target/X86/X86InstrBuilder.h:1.15 --- llvm/lib/Target/X86/X86InstrBuilder.h:1.14 Fri Dec 17 16:41:46 2004 +++ llvm/lib/Target/X86/X86InstrBuilder.h Sat Jan 1 20:38:18 2005 @@ -49,7 +49,9 @@ GlobalValue *GV; X86AddressMode() : BaseType(RegBase), Scale(1), IndexReg(0), Disp(0), - GV(NULL) {} + GV(NULL) { + Base.Reg = 0; + } }; /// addDirectMem - This function is used to add a direct memory reference to the @@ -73,6 +75,13 @@ return MIB.addReg(Reg).addZImm(1).addReg(0).addSImm(Offset); } +/// addRegReg - This function is used to add a memory reference of the form: +/// [Reg + Reg]. +inline const MachineInstrBuilder &addRegReg(const MachineInstrBuilder &MIB, + unsigned Reg1, unsigned Reg2) { + return MIB.addReg(Reg1).addZImm(1).addReg(Reg2).addSImm(0); +} + inline const MachineInstrBuilder &addFullAddress(const MachineInstrBuilder &MIB, const X86AddressMode &AM) { assert (AM.Scale == 1 || AM.Scale == 2 || AM.Scale == 4 || AM.Scale == 8); From lattner at cs.uiuc.edu Sat Jan 1 20:46:41 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 20:46:41 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Linker/2004-12-03-DisagreeingType.ll Message-ID: <200501020246.j022kf9h030475@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Linker: 2004-12-03-DisagreeingType.ll added (r1.1) --- Log message: Check in an old test that never made it into CVS --- Diffs of the changes: (+8 -0) Index: llvm/test/Regression/Linker/2004-12-03-DisagreeingType.ll diff -c /dev/null llvm/test/Regression/Linker/2004-12-03-DisagreeingType.ll:1.1 *** /dev/null Sat Jan 1 20:46:39 2005 --- llvm/test/Regression/Linker/2004-12-03-DisagreeingType.ll Sat Jan 1 20:46:29 2005 *************** *** 0 **** --- 1,8 ---- + ; RUN: echo "%G = weak global {{{{double}}}} zeroinitializer" | llvm-as > %t.out2.bc + ; RUN: llvm-as < %s > %t.out1.bc + ; RUN: llvm-link %t.out[12].bc | llvm-dis | not grep '\}' + + ; When linked, the global above should be eliminated, being merged with the + ; global below. + + %G = global double 1.0 From lattner at cs.uiuc.edu Sat Jan 1 22:18:32 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sat, 1 Jan 2005 22:18:32 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.cpp Message-ID: <200501020418.j024IWVk007308@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrInfo.cpp updated: 1.33 -> 1.34 --- Log message: Disable 2->3 address promotion of add and inc instructions to LEA's. In addition to being three address, LEA's don't set the flags. This fixes 186.crafty. --- Diffs of the changes: (+5 -0) Index: llvm/lib/Target/X86/X86InstrInfo.cpp diff -u llvm/lib/Target/X86/X86InstrInfo.cpp:1.33 llvm/lib/Target/X86/X86InstrInfo.cpp:1.34 --- llvm/lib/Target/X86/X86InstrInfo.cpp:1.33 Sat Jan 1 20:37:07 2005 +++ llvm/lib/Target/X86/X86InstrInfo.cpp Sat Jan 1 22:18:17 2005 @@ -55,6 +55,11 @@ unsigned Dest = MI->getOperand(0).getReg(); unsigned Src = MI->getOperand(1).getReg(); + // FIXME: None of these instructions are promotable to LEAs without + // additional information. In particular, LEA doesn't set the flags that + // add and inc do. :( + return 0; + // FIXME: 16-bit LEA's are really slow on Athlons, but not bad on P4's. When // we have subtarget support, enable the 16-bit LEA generation here. bool DisableLEA16 = true; From jeffc at jolt-lang.org Sat Jan 1 22:23:23 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 22:23:23 -0600 Subject: [llvm-commits] CVS: llvm/win32/Fibonacci/Fibonacci.vcproj Message-ID: <200501020423.WAA25357@zion.cs.uiuc.edu> Changes in directory llvm/win32/Fibonacci: Fibonacci.vcproj updated: 1.7 -> 1.8 --- Log message: Eliminate the use of the global variable hack in the X86 target that was used to get Visual Studio to link in X86.lib to the executables that need it. There is another way of doing it. --- Diffs of the changes: (+2 -2) Index: llvm/win32/Fibonacci/Fibonacci.vcproj diff -u llvm/win32/Fibonacci/Fibonacci.vcproj:1.7 llvm/win32/Fibonacci/Fibonacci.vcproj:1.8 --- llvm/win32/Fibonacci/Fibonacci.vcproj:1.7 Sat Jan 1 13:37:14 2005 +++ llvm/win32/Fibonacci/Fibonacci.vcproj Sat Jan 1 22:23:12 2005 @@ -37,9 +37,9 @@ Name="VCCustomBuildTool"/> Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.72 -> 1.73 --- Log message: Eliminate the use of the global variable hack in the X86 target that was used to get Visual Studio to link in X86.lib to the executables that need it. There is another way of doing it. --- Diffs of the changes: (+0 -7) Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.72 llvm/lib/Target/X86/X86TargetMachine.cpp:1.73 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.72 Sun Dec 12 11:40:06 2004 +++ llvm/lib/Target/X86/X86TargetMachine.cpp Sat Jan 1 22:23:12 2005 @@ -27,13 +27,6 @@ X86VectorEnum llvm::X86Vector = NoSSE; -/// X86TargetMachineModule - Note that this is used on hosts that cannot link -/// in a library unless there are references into the library. In particular, -/// it seems that it is not possible to get things to work on Win32 without -/// this. Though it is unused, do not remove it. -extern "C" int X86TargetMachineModule; -int X86TargetMachineModule = 0; - namespace { cl::opt NoSSAPeephole("disable-ssa-peephole", cl::init(true), cl::desc("Disable the ssa-based peephole optimizer " From jeffc at jolt-lang.org Sat Jan 1 22:23:24 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 22:23:24 -0600 Subject: [llvm-commits] CVS: llvm/win32/lli/lli.vcproj Message-ID: <200501020423.WAA25363@zion.cs.uiuc.edu> Changes in directory llvm/win32/lli: lli.vcproj updated: 1.4 -> 1.5 --- Log message: Eliminate the use of the global variable hack in the X86 target that was used to get Visual Studio to link in X86.lib to the executables that need it. There is another way of doing it. --- Diffs of the changes: (+2 -2) Index: llvm/win32/lli/lli.vcproj diff -u llvm/win32/lli/lli.vcproj:1.4 llvm/win32/lli/lli.vcproj:1.5 --- llvm/win32/lli/lli.vcproj:1.4 Sat Jan 1 14:51:41 2005 +++ llvm/win32/lli/lli.vcproj Sat Jan 1 22:23:12 2005 @@ -36,9 +36,9 @@ Name="VCCustomBuildTool"/> Changes in directory llvm/win32/llc: llc.vcproj updated: 1.4 -> 1.5 --- Log message: Eliminate the use of the global variable hack in the X86 target that was used to get Visual Studio to link in X86.lib to the executables that need it. There is another way of doing it. --- Diffs of the changes: (+2 -2) Index: llvm/win32/llc/llc.vcproj diff -u llvm/win32/llc/llc.vcproj:1.4 llvm/win32/llc/llc.vcproj:1.5 --- llvm/win32/llc/llc.vcproj:1.4 Sat Jan 1 14:51:41 2005 +++ llvm/win32/llc/llc.vcproj Sat Jan 1 22:23:12 2005 @@ -36,9 +36,9 @@ Name="VCCustomBuildTool"/> Changes in directory llvm/win32: llvm.sln updated: 1.11 -> 1.12 --- Log message: Eliminate the use of the global variable hack in the X86 target that was used to get Visual Studio to link in X86.lib to the executables that need it. There is another way of doing it. --- Diffs of the changes: (+1 -0) Index: llvm/win32/llvm.sln diff -u llvm/win32/llvm.sln:1.11 llvm/win32/llvm.sln:1.12 --- llvm/win32/llvm.sln:1.11 Sat Jan 1 16:32:26 2005 +++ llvm/win32/llvm.sln Sat Jan 1 22:23:12 2005 @@ -20,6 +20,7 @@ {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {76295AE8-A083-460E-9F80-6F2B8923264A} = {76295AE8-A083-460E-9F80-6F2B8923264A} {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} + {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExecutionEngine", "ExecutionEngine\ExecutionEngine.vcproj", "{76295AE8-A083-460E-9F80-6F2B8923264A}" From jeffc at jolt-lang.org Sat Jan 1 22:44:47 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 1 Jan 2005 22:44:47 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm.sln Message-ID: <200501020444.WAA25475@zion.cs.uiuc.edu> Changes in directory llvm/win32: llvm.sln updated: 1.12 -> 1.13 --- Log message: Cleanup some Visual Studio project dependencies. --- Diffs of the changes: (+2 -1) Index: llvm/win32/llvm.sln diff -u llvm/win32/llvm.sln:1.12 llvm/win32/llvm.sln:1.13 --- llvm/win32/llvm.sln:1.12 Sat Jan 1 22:23:12 2005 +++ llvm/win32/llvm.sln Sat Jan 1 22:44:36 2005 @@ -36,7 +36,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Target", "Target\Target.vcproj", "{059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4}" ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} - {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CodeGen", "CodeGen\CodeGen.vcproj", "{08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897}" @@ -80,6 +79,7 @@ {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {76295AE8-A083-460E-9F80-6F2B8923264A} = {76295AE8-A083-460E-9F80-6F2B8923264A} {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} + {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bytecode", "Bytecode\Bytecode.vcproj", "{F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}" @@ -95,6 +95,7 @@ {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} = {45CD78D7-C5D9-47FE-AD12-F3251EEDAFFB} {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} = {0F8407F3-FA23-4CF1-83A9-DCBE0B361489} + {144EEBF6-8C9B-4473-B715-2C821666AF6C} = {144EEBF6-8C9B-4473-B715-2C821666AF6C} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llvm-dis", "llvm-dis\llvm-dis.vcproj", "{B13476BC-30AB-4EA0-BC1E-212C0A459405}" From reid at x10sys.com Sun Jan 2 03:45:15 2005 From: reid at x10sys.com (Reid Spencer) Date: Sun, 2 Jan 2005 03:45:15 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/DynamicLibrary.cpp Message-ID: <200501020945.DAA11930@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: DynamicLibrary.cpp updated: 1.8 -> 1.9 --- Log message: Correct the case of a #include directory name, just in case. --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/DynamicLibrary.cpp diff -u llvm/lib/System/DynamicLibrary.cpp:1.8 llvm/lib/System/DynamicLibrary.cpp:1.9 --- llvm/lib/System/DynamicLibrary.cpp:1.8 Fri Dec 24 10:26:47 2004 +++ llvm/lib/System/DynamicLibrary.cpp Sun Jan 2 03:45:04 2005 @@ -22,7 +22,7 @@ #ifdef LLVM_ON_WIN32 -#include "win32/DynamicLibrary.cpp" +#include "Win32/DynamicLibrary.cpp" #else From reid at x10sys.com Sun Jan 2 03:46:06 2005 From: reid at x10sys.com (Reid Spencer) Date: Sun, 2 Jan 2005 03:46:06 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200501020946.DAA11963@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.281 -> 1.282 --- Log message: Quote the PATH variable value just in case it has spaces in it (like on Cygwin). --- Diffs of the changes: (+2 -2) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.281 llvm/Makefile.rules:1.282 --- llvm/Makefile.rules:1.281 Tue Dec 28 01:59:22 2004 +++ llvm/Makefile.rules Sun Jan 2 03:45:54 2005 @@ -252,8 +252,8 @@ ifndef LOPT LOPT := $(LLVMToolDir)/opt$(EXEEXT) endif -LLVMGCCWITHPATH := PATH=$(LLVMToolDir):$(PATH) $(LLVMGCC) -LLVMGXXWITHPATH := PATH=$(LLVMToolDir):$(PATH) $(LLVMGXX) +LLVMGCCWITHPATH := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGCC) +LLVMGXXWITHPATH := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGXX) #-------------------------------------------------------------------- # Adjust to user's request From reid at x10sys.com Sun Jan 2 11:43:32 2005 From: reid at x10sys.com (Reid Spencer) Date: Sun, 2 Jan 2005 11:43:32 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200501021743.LAA27392@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.282 -> 1.283 --- Log message: Avoid use of -fomit-frame-pointer on FreeBSD platforms. It causes thrown exceptions to abort() in cases where it should not. Many thanks to Duraid Madina for doing the heavy lifting on the analysis of this problem. --- Diffs of the changes: (+8 -3) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.282 llvm/Makefile.rules:1.283 --- llvm/Makefile.rules:1.282 Sun Jan 2 03:45:54 2005 +++ llvm/Makefile.rules Sun Jan 2 11:43:20 2005 @@ -180,6 +180,7 @@ # Variables derived from configuration we are building #-------------------------------------------------------------------- + ifdef ENABLE_PROFILING BuildMode := Profile CXX.Flags := -O3 -DNDEBUG -felide-constructors -finline-functions -pg @@ -188,9 +189,13 @@ else ifdef ENABLE_OPTIMIZED BuildMode := Release - CXX.Flags := -O3 -DNDEBUG -finline-functions \ - -felide-constructors -fomit-frame-pointer - C.Flags := -O3 -DNDEBUG -fomit-frame-pointer + # Don't use -fomit-frame-pointer on FreeBSD + ifneq ($(OS),FreeBSD) + OmitFramePointer := -fomit-frame-pointer + endif + CXX.Flags := -O3 -DNDEBUG -finline-functions -felide-constructors \ + $(OmitFramePointer) + C.Flags := -O3 -DNDEBUG $(OmitFramePointer) LD.Flags := -O3 -DNDEBUG else BuildMode := Debug From lattner at cs.uiuc.edu Sun Jan 2 13:01:48 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 13:01:48 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/overlap-add.ll overlap-shift.ll Message-ID: <200501021901.j02J1mca022794@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/X86: overlap-add.ll updated: 1.1 -> 1.2 overlap-shift.ll updated: 1.1 -> 1.2 --- Log message: xfail these tests, whcih require more info in the code generator to implement correctly. --- Diffs of the changes: (+6 -0) Index: llvm/test/Regression/CodeGen/X86/overlap-add.ll diff -u llvm/test/Regression/CodeGen/X86/overlap-add.ll:1.1 llvm/test/Regression/CodeGen/X86/overlap-add.ll:1.2 --- llvm/test/Regression/CodeGen/X86/overlap-add.ll:1.1 Sat Jan 1 20:30:04 2005 +++ llvm/test/Regression/CodeGen/X86/overlap-add.ll Sun Jan 2 13:01:33 2005 @@ -8,6 +8,9 @@ ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | not grep 'mov %E.X, %E.X' +; FIXME: We need live variable information about flags to do this xform safely. :( +; XFAIL: * + %G = external global int int %test1(int %X, int %Y) { Index: llvm/test/Regression/CodeGen/X86/overlap-shift.ll diff -u llvm/test/Regression/CodeGen/X86/overlap-shift.ll:1.1 llvm/test/Regression/CodeGen/X86/overlap-shift.ll:1.2 --- llvm/test/Regression/CodeGen/X86/overlap-shift.ll:1.1 Sat Jan 1 20:30:04 2005 +++ llvm/test/Regression/CodeGen/X86/overlap-shift.ll Sun Jan 2 13:01:33 2005 @@ -8,6 +8,9 @@ ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | not grep 'mov %E.X, %E.X' +; FIXME: We need live variable information about flags to do this xform safely. :( +; XFAIL: * + %G = external global int int %test1(int %X) { From lattner at cs.uiuc.edu Sun Jan 2 15:08:49 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 15:08:49 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200501022108.j02L8nBA018016@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.74 -> 1.75 --- Log message: Implement the majority of PR494: http://llvm.cs.uiuc.edu/PR494 . For pointer subtractions of objects that are a power of two, we emit a signed SHR instead of a signed divide. This gives us the performance we want in the common case. Anything more will require extensions to the LLVM IR. --- Diffs of the changes: (+25 -0) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.74 llvm-gcc/gcc/llvm-expand.c:1.75 --- llvm-gcc/gcc/llvm-expand.c:1.74 Wed Dec 1 01:17:10 2004 +++ llvm-gcc/gcc/llvm-expand.c Sun Jan 2 15:08:34 2005 @@ -6314,6 +6314,31 @@ case UNORDERED_EXPR: break; + case EXACT_DIV_EXPR: + /* If this is a signed EXACT_DIV_EXPR by a constant, and we know that + * the RHS is a multiple of two, we strength reduce the result to use + * a signed SHR here. We have no way in LLVM to represent EXACT_DIV_EXPR + * precisely, so this transform can't currently be performed at the LLVM + * level. + */ + if (llvm_type_is_signed(op0->Ty) && op1->VTy == Constant) { + llvm_constant *C = V2C(op1); + if (C->Repr[0] > '0' && C->Repr[0] <= '9') { + unsigned Divisor = llvm_constant_get_integer_val(C); + + /* If the divisor is a power of two, we can do the xform. */ + if (Divisor && (Divisor & (Divisor-1)) == 0) { + Opcode = O_Shr; /* Perform a signed SHR */ + + unsigned ShAmt = 0; + for (; Divisor > 1; Divisor >>= 1) + ++ShAmt; + op1 = llvm_constant_new_integral(UByteTy, ShAmt); + } + } + } + break; + default: if (Opcode < O_SetEQ && (op0->Ty->ID == PointerTyID || op1->Ty->ID == PointerTyID)) { From lattner at cs.uiuc.edu Sun Jan 2 15:11:26 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 15:11:26 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2005-01-02-PointerDifference.c.tr Message-ID: <200501022111.j02LBQf1018150@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2005-01-02-PointerDifference.c.tr added (r1.1) --- Log message: Testcase for PR494: http://llvm.cs.uiuc.edu/PR494 --- Diffs of the changes: (+3 -0) Index: llvm/test/Regression/CFrontend/2005-01-02-PointerDifference.c.tr diff -c /dev/null llvm/test/Regression/CFrontend/2005-01-02-PointerDifference.c.tr:1.1 *** /dev/null Sun Jan 2 15:11:22 2005 --- llvm/test/Regression/CFrontend/2005-01-02-PointerDifference.c.tr Sun Jan 2 15:11:11 2005 *************** *** 0 **** --- 1,3 ---- + // RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep -v div + + int Diff(int *P, int *Q) { return P-Q; } From lattner at persephone.cs.uiuc.edu Sun Jan 2 16:50:20 2005 From: lattner at persephone.cs.uiuc.edu (lattner at persephone.cs.uiuc.edu) Date: Sun, 2 Jan 2005 16:50:20 -0600 (CST) Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libutempter/Makefile dummy.c Message-ID: <20050102225020.EABC48F8170@persephone.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libutempter: Makefile (r1.7) removed dummy.c (r1.1) removed --- Log message: This is no longer needed. --- Diffs of the changes: (+0 -0) From lattner at persephone.cs.uiuc.edu Sun Jan 2 16:52:43 2005 From: lattner at persephone.cs.uiuc.edu (lattner at persephone.cs.uiuc.edu) Date: Sun, 2 Jan 2005 16:52:43 -0600 (CST) Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libpthread/Makefile pthread.c Message-ID: <20050102225243.337D88F81DE@persephone.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libpthread: Makefile (r1.5) removed pthread.c (r1.2) removed --- Log message: Remove a bunch of useless empty libraries --- Diffs of the changes: (+0 -0) From lattner at persephone.cs.uiuc.edu Sun Jan 2 16:52:51 2005 From: lattner at persephone.cs.uiuc.edu (lattner at persephone.cs.uiuc.edu) Date: Sun, 2 Jan 2005 16:52:51 -0600 (CST) Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libgdbm/Makefile temp.c Message-ID: <20050102225251.8E5568F81E1@persephone.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libgdbm: Makefile (r1.5) removed temp.c (r1.1) removed --- Log message: Remove a bunch of useless empty libraries --- Diffs of the changes: (+0 -0) From lattner at persephone.cs.uiuc.edu Sun Jan 2 16:52:43 2005 From: lattner at persephone.cs.uiuc.edu (lattner at persephone.cs.uiuc.edu) Date: Sun, 2 Jan 2005 16:52:43 -0600 (CST) Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libcurses/Makefile dummy.c Message-ID: <20050102225243.999848F81E2@persephone.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libcurses: Makefile (r1.6) removed dummy.c (r1.1) removed --- Log message: Remove a bunch of useless empty libraries --- Diffs of the changes: (+0 -0) From lattner at persephone.cs.uiuc.edu Sun Jan 2 16:52:51 2005 From: lattner at persephone.cs.uiuc.edu (lattner at persephone.cs.uiuc.edu) Date: Sun, 2 Jan 2005 16:52:51 -0600 (CST) Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libtermcap/Makefile dummy.c Message-ID: <20050102225251.378C58F81E6@persephone.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libtermcap: Makefile (r1.6) removed dummy.c (r1.1) removed --- Log message: Remove a bunch of useless empty libraries --- Diffs of the changes: (+0 -0) From lattner at persephone.cs.uiuc.edu Sun Jan 2 16:52:52 2005 From: lattner at persephone.cs.uiuc.edu (lattner at persephone.cs.uiuc.edu) Date: Sun, 2 Jan 2005 16:52:52 -0600 (CST) Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libucb/Makefile dummy.c Message-ID: <20050102225252.362438F81E5@persephone.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libucb: Makefile (r1.8) removed dummy.c (r1.1) removed --- Log message: Remove a bunch of useless empty libraries --- Diffs of the changes: (+0 -0) From lattner at persephone.cs.uiuc.edu Sun Jan 2 16:52:54 2005 From: lattner at persephone.cs.uiuc.edu (lattner at persephone.cs.uiuc.edu) Date: Sun, 2 Jan 2005 16:52:54 -0600 (CST) Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libg/Makefile README.txt temp.c Message-ID: <20050102225254.0F1138F81E9@persephone.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libg: Makefile (r1.8) removed README.txt (r1.1) removed temp.c (r1.1) removed --- Log message: Remove a bunch of useless empty libraries --- Diffs of the changes: (+0 -0) From lattner at persephone.cs.uiuc.edu Sun Jan 2 16:52:52 2005 From: lattner at persephone.cs.uiuc.edu (lattner at persephone.cs.uiuc.edu) Date: Sun, 2 Jan 2005 16:52:52 -0600 (CST) Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libmalloc/Makefile dummy.c Message-ID: <20050102225252.14C348F81EA@persephone.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libmalloc: Makefile (r1.7) removed dummy.c (r1.1) removed --- Log message: Remove a bunch of useless empty libraries --- Diffs of the changes: (+0 -0) From lattner at persephone.cs.uiuc.edu Sun Jan 2 16:54:07 2005 From: lattner at persephone.cs.uiuc.edu (lattner at persephone.cs.uiuc.edu) Date: Sun, 2 Jan 2005 16:54:07 -0600 (CST) Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libutil/Makefile dummy.c Message-ID: <20050102225407.1A4ED8F821A@persephone.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libutil: Makefile (r1.6) removed dummy.c (r1.1) removed --- Log message: This lib is dead --- Diffs of the changes: (+0 -0) From lattner at persephone.cs.uiuc.edu Sun Jan 2 16:55:34 2005 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 16:55:34 -0600 (CST) Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/Makefile Message-ID: <20050102225534.BE06E8F8276@persephone.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries: Makefile updated: 1.7 -> 1.8 --- Log message: Remove dead directories --- Diffs of the changes: (+1 -2) Index: llvm/runtime/GCCLibraries/Makefile diff -u llvm/runtime/GCCLibraries/Makefile:1.7 llvm/runtime/GCCLibraries/Makefile:1.8 --- llvm/runtime/GCCLibraries/Makefile:1.7 Thu Dec 2 03:58:08 2004 +++ llvm/runtime/GCCLibraries/Makefile Sun Jan 2 16:55:16 2005 @@ -8,6 +8,5 @@ ##===----------------------------------------------------------------------===## LEVEL := ../.. -PARALLEL_DIRS := crtend libc libcurses libg libgcc libgdbm libm libmalloc \ - libtermcap libucb libutempter libutil +PARALLEL_DIRS := crtend libc libgcc libm include $(LEVEL)/Makefile.common From lattner at persephone.cs.uiuc.edu Sun Jan 2 17:07:49 2005 From: lattner at persephone.cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 17:07:49 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Message-ID: <20050102230749.AA3FB8F8389@persephone.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32ISelSimple.cpp updated: 1.118 -> 1.119 --- Log message: This hunk: - unsigned TrueValue = getReg(TrueVal, BB, BB->begin()); + unsigned TrueValue = getReg(TrueVal); Fixes the PPC regressions from last night. The other hunk is just a clarity improvement. --- Diffs of the changes: (+2 -2) Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.118 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.119 --- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.118 Sat Jan 1 10:10:12 2005 +++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp Sun Jan 2 17:07:31 2005 @@ -1435,7 +1435,7 @@ // fallthrough --> copy0MBB MachineBasicBlock *copy0MBB = new MachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB); - unsigned TrueValue = getReg(TrueVal, BB, BB->begin()); + unsigned TrueValue = getReg(TrueVal); BuildMI(BB, Opcode, 2).addReg(PPC::CR0).addMBB(sinkMBB); F->getBasicBlockList().insert(It, copy0MBB); F->getBasicBlockList().insert(It, sinkMBB); @@ -1447,7 +1447,7 @@ // %FalseValue = ... // # fallthrough to sinkMBB BB = copy0MBB; - unsigned FalseValue = getReg(FalseVal, BB, BB->begin()); + unsigned FalseValue = getReg(FalseVal); // Update machine-CFG edges BB->addSuccessor(sinkMBB); From lattner at cs.uiuc.edu Sun Jan 2 19:28:14 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 19:28:14 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrInfo.td Message-ID: <200501030128.j031SEeK025296@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrInfo.td updated: 1.113 -> 1.114 --- Log message: ADC and IMUL are also commutable. --- Diffs of the changes: (+4 -0) Index: llvm/lib/Target/X86/X86InstrInfo.td diff -u llvm/lib/Target/X86/X86InstrInfo.td:1.113 llvm/lib/Target/X86/X86InstrInfo.td:1.114 --- llvm/lib/Target/X86/X86InstrInfo.td:1.113 Sat Jan 1 20:35:46 2005 +++ llvm/lib/Target/X86/X86InstrInfo.td Sun Jan 2 19:27:59 2005 @@ -928,8 +928,10 @@ "add{l} {$src2, $dst|$dst, $src2}">; } +let isCommutable = 1 in { // X = ADC Y, Z --> X = ADC Z, Y def ADC32rr : I<0x11, MRMDestReg, (ops R32:$dst, R32:$src1, R32:$src2), "adc{l} {$src2, $dst|$dst, $src2}">; +} def ADC32rm : I<0x13, MRMSrcMem , (ops R32:$dst, R32:$src1, i32mem:$src2), "adc{l} {$src2, $dst|$dst, $src2}">; def ADC32ri : Ii32<0x81, MRM2r, (ops R32:$dst, R32:$src1, i32imm:$src2), @@ -1020,10 +1022,12 @@ def SBB32ri8 : Ii8<0x83, MRM3r, (ops R32:$dst, R32:$src1, i8imm:$src2), "sbb{l} {$src2, $dst|$dst, $src2}">; +let isCommutable = 1 in { // X = IMUL Y, Z --> X = IMUL Z, Y def IMUL16rr : I<0xAF, MRMSrcReg, (ops R16:$dst, R16:$src1, R16:$src2), "imul{w} {$src2, $dst|$dst, $src2}">, TB, OpSize; def IMUL32rr : I<0xAF, MRMSrcReg, (ops R32:$dst, R32:$src1, R32:$src2), "imul{l} {$src2, $dst|$dst, $src2}">, TB; +} def IMUL16rm : I<0xAF, MRMSrcMem, (ops R16:$dst, R16:$src1, i16mem:$src2), "imul{w} {$src2, $dst|$dst, $src2}">, TB, OpSize; def IMUL32rm : I<0xAF, MRMSrcMem, (ops R32:$dst, R32:$src1, i32mem:$src2), From jeffc at jolt-lang.org Sun Jan 2 20:45:05 2005 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sun, 2 Jan 2005 20:45:05 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200501030245.UAA32138@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.283 -> 1.284 --- Log message: Don't quote the PATH variable value just in case it has spaces in it, as it breaks "gmake check". --- Diffs of the changes: (+2 -2) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.283 llvm/Makefile.rules:1.284 --- llvm/Makefile.rules:1.283 Sun Jan 2 11:43:20 2005 +++ llvm/Makefile.rules Sun Jan 2 20:44:54 2005 @@ -257,8 +257,8 @@ ifndef LOPT LOPT := $(LLVMToolDir)/opt$(EXEEXT) endif -LLVMGCCWITHPATH := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGCC) -LLVMGXXWITHPATH := PATH="$(LLVMToolDir):$(PATH)" $(LLVMGXX) +LLVMGCCWITHPATH := PATH=$(LLVMToolDir):$(PATH) $(LLVMGCC) +LLVMGXXWITHPATH := PATH=$(LLVMToolDir):$(PATH) $(LLVMGXX) #-------------------------------------------------------------------- # Adjust to user's request From reid at x10sys.com Sun Jan 2 22:05:05 2005 From: reid at x10sys.com (Reid Spencer) Date: Sun, 2 Jan 2005 22:05:05 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200501030405.WAA00407@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.284 -> 1.285 --- Log message: Re-apply last (reverted) patch. Reverting doesn't solve the actual problem and creates issues on other platforms like Cygwin and MingW. --- Diffs of the changes: (+2 -2) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.284 llvm/Makefile.rules:1.285 --- llvm/Makefile.rules:1.284 Sun Jan 2 20:44:54 2005 +++ llvm/Makefile.rules Sun Jan 2 22:04:54 2005 @@ -257,8 +257,8 @@ ifndef LOPT LOPT := $(LLVMToolDir)/opt$(EXEEXT) endif -LLVMGCCWITHPATH := PATH=$(LLVMToolDir):$(PATH) $(LLVMGCC) -LLVMGXXWITHPATH := PATH=$(LLVMToolDir):$(PATH) $(LLVMGXX) +LLVMGCCWITHPATH := "PATH=$(LLVMToolDir):$(PATH)" $(LLVMGCC) +LLVMGXXWITHPATH := "PATH=$(LLVMToolDir):$(PATH)" $(LLVMGXX) #-------------------------------------------------------------------- # Adjust to user's request From reid at x10sys.com Sun Jan 2 22:05:42 2005 From: reid at x10sys.com (Reid Spencer) Date: Sun, 2 Jan 2005 22:05:42 -0600 Subject: [llvm-commits] CVS: llvm/test/Makefile Message-ID: <200501030405.WAA00421@zion.cs.uiuc.edu> Changes in directory llvm/test: Makefile updated: 1.79 -> 1.80 --- Log message: Make sure the path is properly set in the llvmgcc and llvmgxx variables. --- Diffs of the changes: (+2 -2) Index: llvm/test/Makefile diff -u llvm/test/Makefile:1.79 llvm/test/Makefile:1.80 --- llvm/test/Makefile:1.79 Thu Dec 23 21:38:01 2004 +++ llvm/test/Makefile Sun Jan 2 22:05:32 2005 @@ -44,8 +44,8 @@ @echo 'set prcontext "$(TCLSH) $(LLVM_SRC_ROOT)/test/Scripts/prcontext.tcl"' >> site.tmp @echo 'set srcdir $(LLVM_SRC_ROOT)/test' >>site.tmp @echo "set objdir $(LLVM_OBJ_ROOT)/test" >>site.tmp - @echo 'set llvmgcc "$(LLVMGCCWITHPATH)"' >> site.tmp - @echo 'set llvmgxx "$(LLVMGXXWITHPATH)"' >> site.tmp + @echo 'set llvmgcc "PATH=$(LLVMToolDir):$(PATH) $(LLVMGCC)"' >> site.tmp + @echo 'set llvmgxx "PATH=$(LLVMToolDir):$(PATH) $(LLVMGCC)"' >> site.tmp @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp @test ! -f site.exp || \ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp From lattner at cs.uiuc.edu Sun Jan 2 22:15:26 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 22:15:26 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2005-01-02-ConstantInits.c Message-ID: <200501030415.j034FQUb003750@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2005-01-02-ConstantInits.c added (r1.1) --- Log message: New testcase for PR487: http://llvm.cs.uiuc.edu/PR487 --- Diffs of the changes: (+24 -0) Index: llvm/test/Regression/CFrontend/2005-01-02-ConstantInits.c diff -c /dev/null llvm/test/Regression/CFrontend/2005-01-02-ConstantInits.c:1.1 *** /dev/null Sun Jan 2 22:15:21 2005 --- llvm/test/Regression/CFrontend/2005-01-02-ConstantInits.c Sun Jan 2 22:15:11 2005 *************** *** 0 **** --- 1,24 ---- + // RUN: %llvmgcc %s -S -o - + + // This tests all kinds of hard cases with initializers and + // array subscripts. This corresponds to PR487. + + struct X { int a[2]; }; + + int test() { + static int i23 = (int) &(((struct X *)0)->a[1]); + return i23; + } + + int i = (int) &( ((struct X *)0) -> a[1]); + + int Arr[100]; + + int foo(int i) { return bar(&Arr[49])+bar(&Arr[i]); } + int foo2(int i) { + static const int *X = &Arr[49]; + static int i23 = (int) &( ((struct X *)0) -> a[0]); + int *P = Arr; + ++P; + return bar(Arr+i); + } From lattner at cs.uiuc.edu Sun Jan 2 22:17:33 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 22:17:33 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/c-typeck.c Message-ID: <200501030417.j034HX0B003768@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: c-typeck.c updated: 1.3 -> 1.4 --- Log message: Fix PR487: http://llvm.cs.uiuc.edu/PR487 and testcase Regression/CFrontend/2005-01-02-ConstantInits.c --- Diffs of the changes: (+14 -8) Index: llvm-gcc/gcc/c-typeck.c diff -u llvm-gcc/gcc/c-typeck.c:1.3 llvm-gcc/gcc/c-typeck.c:1.4 --- llvm-gcc/gcc/c-typeck.c:1.3 Thu Feb 5 10:05:44 2004 +++ llvm-gcc/gcc/c-typeck.c Sun Jan 2 22:17:21 2005 @@ -46,6 +46,9 @@ #include "target.h" #include "llvm-out.h" +struct initializer_stack; +extern struct initializer_stack *initializer_stack; + /* Nonzero if we've already printed a "missing braces around initializer" message within this initializer. */ static int missing_braces_mentioned; @@ -2408,10 +2411,14 @@ } /* For &x[y], return x+y */ - if (TREE_CODE (arg) == ARRAY_REF && !EMIT_LLVM) + if (TREE_CODE (arg) == ARRAY_REF) { if (!c_mark_addressable (TREE_OPERAND (arg, 0))) return error_mark_node; + /* DON'T fold this, unless its a constant expression which might + * initialize a global. + */ + if (!EMIT_LLVM || initializer_stack) return build_binary_op (PLUS_EXPR, TREE_OPERAND (arg, 0), TREE_OPERAND (arg, 1), 1); } @@ -2462,17 +2469,16 @@ return error_mark_node; } - addr = fold (build (PLUS_EXPR, argtype, - convert (argtype, addr), - convert (argtype, byte_position (field)))); - if (EMIT_LLVM) { + if (EMIT_LLVM && !initializer_stack) { /* For LLVM, don't fold pointer arithmetic unless doing so * produces a constant! */ - tree addr2 = build1 (code, argtype, arg); - if (!TREE_CONSTANT(addr) || TREE_CONSTANT(addr2)) - addr = addr2; + addr = build1 (code, argtype, arg); } + else + addr = fold (build (PLUS_EXPR, argtype, + convert (argtype, addr), + convert (argtype, byte_position (field)))); } else addr = build1 (code, argtype, arg); From lattner at cs.uiuc.edu Sun Jan 2 22:20:36 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 22:20:36 -0600 Subject: [llvm-commits] CVS: llvm/docs/ReleaseNotes.html Message-ID: <200501030420.j034Ka7u003850@apoc.cs.uiuc.edu> Changes in directory llvm/docs: ReleaseNotes.html updated: 1.286 -> 1.287 --- Log message: Bug fixed --- Diffs of the changes: (+4 -2) Index: llvm/docs/ReleaseNotes.html diff -u llvm/docs/ReleaseNotes.html:1.286 llvm/docs/ReleaseNotes.html:1.287 --- llvm/docs/ReleaseNotes.html:1.286 Tue Dec 28 22:39:50 2004 +++ llvm/docs/ReleaseNotes.html Sun Jan 2 22:20:21 2005 @@ -141,7 +141,9 @@

      Bugs in the C/C++ front-end:

        -
      1. +
      2. [llvmgcc] llvm-gcc incorrectly + rejects some constant initializers involving the addresses of array + elements
      @@ -563,7 +565,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
      - Last modified: $Date: 2004/12/29 04:39:50 $ + Last modified: $Date: 2005/01/03 04:20:21 $ From lattner at cs.uiuc.edu Sun Jan 2 22:21:50 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 22:21:50 -0600 Subject: [llvm-commits] CVS: llvm-www/releases/1.4/docs/ReleaseNotes.html Message-ID: <200501030421.j034Lohg003890@apoc.cs.uiuc.edu> Changes in directory llvm-www/releases/1.4/docs: ReleaseNotes.html updated: 1.8 -> 1.9 --- Log message: Bug found --- Diffs of the changes: (+7 -1) Index: llvm-www/releases/1.4/docs/ReleaseNotes.html diff -u llvm-www/releases/1.4/docs/ReleaseNotes.html:1.8 llvm-www/releases/1.4/docs/ReleaseNotes.html:1.9 --- llvm-www/releases/1.4/docs/ReleaseNotes.html:1.8 Tue Dec 28 22:40:47 2004 +++ llvm-www/releases/1.4/docs/ReleaseNotes.html Sun Jan 2 22:21:38 2005 @@ -596,6 +596,12 @@ LLVM with C++ objects compiled by other C++ compilers.
    +

    Fixed in LLVM 1.5:

    + @@ -733,7 +739,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /> The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/29 04:40:47 $ + Last modified: $Date: 2005/01/03 04:21:38 $ From lattner at cs.uiuc.edu Sun Jan 2 22:34:43 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 22:34:43 -0600 Subject: [llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c Message-ID: <200501030434.j034Yhvg006019@apoc.cs.uiuc.edu> Changes in directory llvm-gcc/gcc: llvm-expand.c updated: 1.75 -> 1.76 --- Log message: Fix PR481: http://llvm.cs.uiuc.edu/PR481 --- Diffs of the changes: (+2 -0) Index: llvm-gcc/gcc/llvm-expand.c diff -u llvm-gcc/gcc/llvm-expand.c:1.75 llvm-gcc/gcc/llvm-expand.c:1.76 --- llvm-gcc/gcc/llvm-expand.c:1.75 Sun Jan 2 15:08:34 2005 +++ llvm-gcc/gcc/llvm-expand.c Sun Jan 2 22:34:28 2005 @@ -5292,6 +5292,8 @@ case FUNCTION_DECL: case RESULT_DECL: if (DECL_LLVM(exp) == 0) { + if (errorcount || sorrycount) + return llvm_constant_get_null(Ty); debug_tree(exp); DECL_LLVM(exp); abort(); From lattner at cs.uiuc.edu Sun Jan 2 22:39:31 2005 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun, 2 Jan 2005 22:39:31 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2005-01-02-VAArgError-ICE.c Message-ID: <200501030439.j034dVTa007261@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2005-01-02-VAArgError-ICE.c added (r1.1) --- Log message: new testcase for PR481: http://llvm.cs.uiuc.edu/PR481 --- Diffs of the changes: (+10 -0) Index: llvm/test/Regression/CFrontend/2005-01-02-VAArgError-ICE.c diff -c /dev/null llvm/test/Regression/CFrontend/2005-01-02-VAArgError-ICE.c:1.1 *** /dev/null Sun Jan 2 22:39:26 2005 --- llvm/test/Regression/CFrontend/2005-01-02-VAArgError-ICE.c Sun Jan 2 22:39:16 2005 *************** *** 0 **** --- 1,10 ---- + // This file is erroneous, but should not cause the compiler to ICE. + // PR481 + // RUN: %llvmgcc %s -S -o /dev/null 2>&1 | not grep 'internal compiler error' + + #include + int flags(int a, int b, ...) { + va_list args; + va_start(args,a); // not the last named arg + foo(args); + } From reid at x10sys.com Sun Jan 2 23:31:10 2005 From: reid at x10sys.com (Reid Spencer) Date: Sun, 2 Jan 2005 23:31:10 -0600 Subject: [llvm-commits] CVS: llvm/docs/img/libdeps.gif objdeps.gif Message-ID: <200501030531.XAA01295@zion.cs.uiuc.edu> Changes in directory llvm/docs/img: libdeps.gif added (r1.1) objdeps.gif added (r1.1) --- Log message: Add library dependency and object dependency graphs. --- Diffs of the changes: (+0 -0) Index: llvm/docs/img/libdeps.gif Index: llvm/docs/img/objdeps.gif From reid at x10sys.com Sun Jan 2 23:46:57 2005 From: reid at x10sys.com (Reid Spencer) Date: Sun, 2 Jan 2005 23:46:57 -0600 Subject: [llvm-commits] CVS: llvm/docs/UsingLibraries.html Message-ID: <200501030546.XAA01459@zion.cs.uiuc.edu> Changes in directory llvm/docs: UsingLibraries.html updated: 1.16 -> 1.17 --- Log message: Integrate dependency graphs. Make it HTML 4.01 Strict compliant Provide better explanations of the dependency information. --- Diffs of the changes: (+25 -13) Index: llvm/docs/UsingLibraries.html diff -u llvm/docs/UsingLibraries.html:1.16 llvm/docs/UsingLibraries.html:1.17 --- llvm/docs/UsingLibraries.html:1.16 Thu Dec 30 18:13:14 2004 +++ llvm/docs/UsingLibraries.html Sun Jan 2 23:46:46 2005 @@ -158,14 +158,29 @@
    Library Dependencies
    -

    The following list shows the dependency relationships between libraries. - This information can be automatically generated with the - GenLibDeps.pl utility in the llvm/utils directory.

    +

    Below are two dependency graphs and a list that show the relationships + between the various LLVM archive libraries and object files. This information + can be automatically generated with the GenLibDeps.pl utility found + in the llvm/utils directory.

    - - - + + + + +

    Dependency Relationships Of Libraries

    +

    This graph shows the dependency of archive libraries on other archive + libraries or objects. Where a library has both archive and object forms, only + the archive form is shown.

    + Library Dependencies +

    Dependency Relationships Of Object Files

    +

    This graph shows the dependency of object files on archive libraries or + other objects. Where a library has both object and archive forms, only the + dependency to the archive form is shown.

    + Object File Dependencies +

    The following list shows the dependency relationships between libraries in + textual form. The information is the same as shown on the graphs but arranged + alphabetically.

    libLLVMAnalysis.a
    • libLLVMScalarOpts.a
    • @@ -216,8 +231,7 @@
    • libLLVMSystem.a
    • LLVMbzip2.o
    -
    libLLVMSystem.a
      -
    +
    libLLVMSystem.a
    libLLVMTarget.a
    • libLLVMSupport.a
    • LLVMCore.o
    • @@ -404,8 +418,7 @@
    • libLLVMSystem.a
    • LLVMbzip2.o
    -
    LLVMSystem.o
      -
    +
    LLVMSystem.o
    LLVMTarget.o
    • libLLVMSupport.a
    • LLVMCore.o
    • @@ -430,8 +443,7 @@
    • LLVMCodeGen.o
    • LLVMCore.o
    -
    LLVMbzip2.o
      -
    +
    LLVMbzip2.o
    LLVMipa.o
    +
    Last modified: $Date: 2005/01/03 05:46:46 $