From jeffc at jolt-lang.org Mon Dec 13 00:26:46 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 13 Dec 2004 00:26:46 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/MappedFile.cpp Path.cpp Message-ID: <200412130626.AAA11819@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: MappedFile.cpp updated: 1.4 -> 1.5 Path.cpp updated: 1.8 -> 1.9 --- Log message: Fix recent breakage of win32 build --- Diffs of the changes: (+1 -9) Index: llvm/lib/System/Win32/MappedFile.cpp diff -u llvm/lib/System/Win32/MappedFile.cpp:1.4 llvm/lib/System/Win32/MappedFile.cpp:1.5 --- llvm/lib/System/Win32/MappedFile.cpp:1.4 Sat Dec 11 11:37:01 2004 +++ llvm/lib/System/Win32/MappedFile.cpp Mon Dec 13 00:26:35 2004 @@ -97,7 +97,7 @@ return base_; } -size_t MappedFile::size() { +size_t MappedFile::size() const { assert(info_ && "MappedFile not initialized"); return info_->size; } Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.8 llvm/lib/System/Win32/Path.cpp:1.9 --- llvm/lib/System/Win32/Path.cpp:1.8 Sun Dec 12 21:03:42 2004 +++ llvm/lib/System/Win32/Path.cpp Mon Dec 13 00:26:35 2004 @@ -244,14 +244,6 @@ } bool -Path::isArchive() const { - if (readable()) { - return hasMagicNumber("!\012"); - } - return false; -} - -bool Path::exists() const { DWORD attr = GetFileAttributes(path.c_str()); return attr != INVALID_FILE_ATTRIBUTES; From reid at x10sys.com Mon Dec 13 00:57:26 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 00:57:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412130657.AAA12194@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.9 -> 1.10 --- Log message: * Add a std::ostream inserter for sys::Path * Correct the std::string constructor to take a const reference. --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.9 llvm/lib/System/Win32/Path.cpp:1.10 --- llvm/lib/System/Win32/Path.cpp:1.9 Mon Dec 13 00:26:35 2004 +++ llvm/lib/System/Win32/Path.cpp Mon Dec 13 00:57:15 2004 @@ -97,7 +97,7 @@ return *TempDirectory; } -Path::Path(std::string unverified_path) +Path::Path(const std::string& unverified_path) : path(unverified_path) { FlipBackSlashes(path); From reid at x10sys.com Mon Dec 13 00:57:26 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 00:57:26 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200412130657.AAA12191@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.13 -> 1.14 --- Log message: * Add a std::ostream inserter for sys::Path * Correct the std::string constructor to take a const reference. --- Diffs of the changes: (+7 -1) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.13 llvm/include/llvm/System/Path.h:1.14 --- llvm/include/llvm/System/Path.h:1.13 Sun Dec 12 20:57:53 2004 +++ llvm/include/llvm/System/Path.h Mon Dec 13 00:57:15 2004 @@ -18,6 +18,7 @@ #include #include #include +#include namespace llvm { namespace sys { @@ -161,7 +162,7 @@ /// @throws std::string if the path string is not legal. /// @param unverified_path The path to verify and assign. /// @brief Construct a Path from a string. - explicit Path(std::string unverified_path); + explicit Path(const std::string& unverified_path); /// @} /// @name Operators @@ -547,6 +548,11 @@ LLVMFileType IdentifyFileType(const char*magic, unsigned length); } +inline std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath) { + strm << aPath.toString(); + return strm; +} + } // vim: sw=2 From reid at x10sys.com Mon Dec 13 00:57:26 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 00:57:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200412130657.AAA12197@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.17 -> 1.18 --- Log message: * Add a std::ostream inserter for sys::Path * Correct the std::string constructor to take a const reference. --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.17 llvm/lib/System/Unix/Path.cpp:1.18 --- llvm/lib/System/Unix/Path.cpp:1.17 Sun Dec 12 21:00:51 2004 +++ llvm/lib/System/Unix/Path.cpp Mon Dec 13 00:57:15 2004 @@ -27,7 +27,7 @@ namespace llvm { using namespace sys; -Path::Path(std::string unverified_path) +Path::Path(const std::string& unverified_path) : path(unverified_path) { if (unverified_path.empty()) From alkis at cs.uiuc.edu Mon Dec 13 01:15:11 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 01:15:11 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/ClassFile/ClassFile.cpp Message-ID: <200412130715.BAA12417@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/ClassFile: ClassFile.cpp updated: 1.31 -> 1.32 --- Log message: Make this compile again after the recent changes to FileUtilities.h. --- Diffs of the changes: (+11 -9) Index: llvm-java/lib/ClassFile/ClassFile.cpp diff -u llvm-java/lib/ClassFile/ClassFile.cpp:1.31 llvm-java/lib/ClassFile/ClassFile.cpp:1.32 --- llvm-java/lib/ClassFile/ClassFile.cpp:1.31 Sat Dec 11 17:27:38 2004 +++ llvm-java/lib/ClassFile/ClassFile.cpp Mon Dec 13 01:15:00 2004 @@ -18,7 +18,6 @@ #include #include #include -#include #include #include @@ -174,24 +173,26 @@ return new ClassFile(is); } -std::vector ClassFile::getClassPath() +std::vector ClassFile::getClassPath() { DEBUG(std::cerr << "CLASSPATH=" << ClassPath << '\n'); - std::vector result; + std::vector result; + sys::Path path; unsigned b = 0, e = 0; do { e = ClassPath.find(':', b); - result.push_back(ClassPath.substr(b, e - b)); + if (path.setDirectory(ClassPath.substr(b, e - b))) + result.push_back(path); b = e + 1; } while (e != std::string::npos); return result; } -std::string ClassFile::getFileForClass(const std::string& classname) +sys::Path ClassFile::getFileForClass(const std::string& classname) { - static const std::vector classpath = getClassPath(); + static const std::vector classpath = getClassPath(); DEBUG(std::cerr << "Looking up class: " << classname << '\n'); std::string clazz = classname; @@ -202,9 +203,10 @@ clazz += ".class"; for (unsigned i = 0, e = classpath.size(); i != e; ++i) { - std::string filename = classpath[i] + '/' + clazz; - DEBUG(std::cerr << "Trying file: " << filename << '\n'); - if (FileOpenable(filename)) + sys::Path filename = classpath[i]; + filename.appendFile(clazz); + DEBUG(std::cerr << "Trying file: " << filename.toString() << '\n'); + if (filename.isFile()) return filename; } From alkis at cs.uiuc.edu Mon Dec 13 01:15:10 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 01:15:10 -0600 Subject: [llvm-commits] CVS: llvm-java/include/llvm/Java/ClassFile.h Message-ID: <200412130715.BAA12414@zion.cs.uiuc.edu> Changes in directory llvm-java/include/llvm/Java: ClassFile.h updated: 1.26 -> 1.27 --- Log message: Make this compile again after the recent changes to FileUtilities.h. --- Diffs of the changes: (+4 -2) Index: llvm-java/include/llvm/Java/ClassFile.h diff -u llvm-java/include/llvm/Java/ClassFile.h:1.26 llvm-java/include/llvm/Java/ClassFile.h:1.27 --- llvm-java/include/llvm/Java/ClassFile.h:1.26 Sat Dec 11 17:27:38 2004 +++ llvm-java/include/llvm/Java/ClassFile.h Mon Dec 13 01:15:00 2004 @@ -15,6 +15,8 @@ #ifndef LLVM_JAVA_CLASSFILE_H #define LLVM_JAVA_CLASSFILE_H +#include + #include #include #include @@ -67,8 +69,8 @@ class ClassFile { static ClassFile* readClassFile(std::istream& is); - static std::vector getClassPath(); - static std::string getFileForClass(const std::string& classname); + static std::vector getClassPath(); + static sys::Path getFileForClass(const std::string& classname); typedef std::map Name2MethodMap; From reid at x10sys.com Mon Dec 13 01:28:32 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:28:32 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412130728.BAA12594@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.259 -> 1.260 --- Log message: Implement a new feature, BYTECODE_DESTINATION, to allow a user makefile to specify where the bytecode library is to be installed. This allows the default location ($prefix/lib) to be overridden, for special case runtime libraries like the cfe runtime libs. --- Diffs of the changes: (+8 -2) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.259 llvm/Makefile.rules:1.260 --- llvm/Makefile.rules:1.259 Sun Dec 12 21:59:35 2004 +++ llvm/Makefile.rules Mon Dec 13 01:28:21 2004 @@ -594,13 +594,19 @@ -$(Verb) $(RM) -f $(LibName.BCA) endif -DestBytecodeLib = $(bytecode_libdir)/lib$(LIBRARYNAME).a +ifdef BYTECODE_DESTINATION +BytecodeDestDir := $(BYTECODE_DESTINATION) +else +BytecodeDestDir := $(libdir) +endif + +DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).a install-bytecode-local:: $(DestBytecodeLib) install-local:: $(DestBytecodeLib) -$(DestBytecodeLib): $(bytecode_libdir) $(LibName.BCA) +$(DestBytecodeLib): $(BytecodeDestDir) $(LibName.BCA) $(Echo) Installing $(BuildMode) Bytecode Archive $(DestBytecodeLib) $(Verb) $(INSTALL) $(LibName.BCA) $@ From reid at x10sys.com Mon Dec 13 01:38:18 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:38:18 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412130738.BAA12640@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.260 -> 1.261 --- Log message: Finish the implementation of the BYTECODE_DESTINATION feature for modules too and getting rid of the last remnants of bytecode_libdir. --- Diffs of the changes: (+11 -5) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.260 llvm/Makefile.rules:1.261 --- llvm/Makefile.rules:1.260 Mon Dec 13 01:28:21 2004 +++ llvm/Makefile.rules Mon Dec 13 01:38:07 2004 @@ -342,8 +342,8 @@ $(libdir): $(Verb) $(MKDIR) $(libdir) -$(bytecode_libdir): - $(Verb) $(MKDIR) $(bytecode_libdir) +$(includedir): + $(Verb) $(MKDIR) $(includedir) $(sysconfdir): $(Verb) $(MKDIR) $(sysconfdir) @@ -498,11 +498,18 @@ -$(Verb) $(RM) -f $(Module) endif -DestModule := $(bytecode_libdir)/$(MODULE_NAME).bc +ifdef BYTECODE_DESTINATION +ModuleDestDir := $(BYTECODE_DESTINATION) +else +ModuleDestDir := $(BYTECODE_DESTINATION) +endif + +DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc +install-module:: $(DestModule) install-local:: $(DestModule) -$(DestModule): $(bytecode_libdir) $(Module) +$(DestModule): $(ModuleDestDir) $(Module) $(Echo) Installing $(BuildMode) Bytecode Module $(DestModule) $(Verb) $(INSTALL) $(Module) $@ @@ -1362,7 +1369,6 @@ $(Echo) "libdir : " '$(libdir)' $(Echo) "bindir : " '$(bindir)' $(Echo) "sysconfdir : " '$(sysconfdir)' - $(Echo) "bytecode_libdir: " '$(bytecode_libdir)' $(Echo) "UserTargets : " '$(UserTargets)' $(Echo) "ObjMakefiles : " '$(ObjMakefiles)' $(Echo) "SrcMakefiles : " '$(SrcMakefiles)' From reid at x10sys.com Mon Dec 13 01:39:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:39:05 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.config.in Message-ID: <200412130739.BAA12653@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.config.in updated: 1.42 -> 1.43 --- Log message: More properly name bytecode_libdir cferuntime_libdir. This is only the libdir for the CFE runtime libraries, not "all bytecode". --- Diffs of the changes: (+1 -1) Index: llvm/Makefile.config.in diff -u llvm/Makefile.config.in:1.42 llvm/Makefile.config.in:1.43 --- llvm/Makefile.config.in:1.42 Wed Dec 8 17:07:27 2004 +++ llvm/Makefile.config.in Mon Dec 13 01:38:55 2004 @@ -201,7 +201,7 @@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ -bytecode_libdir = $(LLVMGCCDIR)/bytecode-libs +cferuntime_libdir = $(LLVMGCCDIR)/lib includedir = @includedir@ infodir = @infodir@ mandir = @mandir@ From reid at x10sys.com Mon Dec 13 01:41:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:04 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libgdbm/Makefile Message-ID: <200412130741.BAA12772@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libgdbm: Makefile updated: 1.3 -> 1.4 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libgdbm/Makefile diff -u llvm/runtime/GCCLibraries/libgdbm/Makefile:1.3 llvm/runtime/GCCLibraries/libgdbm/Makefile:1.4 --- llvm/runtime/GCCLibraries/libgdbm/Makefile:1.3 Thu Dec 2 03:58:08 2004 +++ llvm/runtime/GCCLibraries/libgdbm/Makefile Mon Dec 13 01:40:50 2004 @@ -11,6 +11,7 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = gdbm +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/libprofile/Makefile Message-ID: <200412130741.BAA12773@zion.cs.uiuc.edu> Changes in directory llvm/runtime/libprofile: Makefile updated: 1.4 -> 1.5 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/libprofile/Makefile diff -u llvm/runtime/libprofile/Makefile:1.4 llvm/runtime/libprofile/Makefile:1.5 --- llvm/runtime/libprofile/Makefile:1.4 Thu Dec 2 03:58:09 2004 +++ llvm/runtime/libprofile/Makefile Mon Dec 13 01:40:50 2004 @@ -13,5 +13,6 @@ LIBRARYNAME = profile_rt EXTRA_DIST = exported_symbols.lst EXPORTED_SYMBOL_FILE = $(BUILD_SRC_DIR)/exported_symbols.lst +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/libtrace/Makefile Message-ID: <200412130741.BAA12774@zion.cs.uiuc.edu> Changes in directory llvm/runtime/libtrace: Makefile updated: 1.11 -> 1.12 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/libtrace/Makefile diff -u llvm/runtime/libtrace/Makefile:1.11 llvm/runtime/libtrace/Makefile:1.12 --- llvm/runtime/libtrace/Makefile:1.11 Thu Dec 2 03:58:09 2004 +++ llvm/runtime/libtrace/Makefile Mon Dec 13 01:40:50 2004 @@ -10,6 +10,7 @@ LEVEL = ../.. BYTECODE_LIBRARY = 1 LIBRARYNAME = trace +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libutil/Makefile Message-ID: <200412130741.BAA12781@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libutil: Makefile updated: 1.4 -> 1.5 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libutil/Makefile diff -u llvm/runtime/GCCLibraries/libutil/Makefile:1.4 llvm/runtime/GCCLibraries/libutil/Makefile:1.5 --- llvm/runtime/GCCLibraries/libutil/Makefile:1.4 Thu Dec 2 03:58:09 2004 +++ llvm/runtime/GCCLibraries/libutil/Makefile Mon Dec 13 01:40:50 2004 @@ -11,5 +11,6 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = util +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GC/SemiSpace/Makefile Message-ID: <200412130741.BAA12784@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GC/SemiSpace: Makefile updated: 1.3 -> 1.4 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -1) Index: llvm/runtime/GC/SemiSpace/Makefile diff -u llvm/runtime/GC/SemiSpace/Makefile:1.3 llvm/runtime/GC/SemiSpace/Makefile:1.4 --- llvm/runtime/GC/SemiSpace/Makefile:1.3 Thu Dec 2 03:58:08 2004 +++ llvm/runtime/GC/SemiSpace/Makefile Mon Dec 13 01:40:50 2004 @@ -10,7 +10,7 @@ LEVEL = ../../.. BYTECODE_LIBRARY = 1 LIBRARYNAME = gcsemispace - +BYTECODE_DESTINATION = $(cferuntime_libdir) EXPORTED_SYMBOL_FILE = $(BUILD_SRC_DIR)/../gc_exported_symbols.lst include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libcurses/Makefile Message-ID: <200412130741.BAA12788@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libcurses: Makefile updated: 1.4 -> 1.5 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libcurses/Makefile diff -u llvm/runtime/GCCLibraries/libcurses/Makefile:1.4 llvm/runtime/GCCLibraries/libcurses/Makefile:1.5 --- llvm/runtime/GCCLibraries/libcurses/Makefile:1.4 Thu Dec 2 03:58:08 2004 +++ llvm/runtime/GCCLibraries/libcurses/Makefile Mon Dec 13 01:40:50 2004 @@ -11,5 +11,6 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = curses +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From alkis at cs.uiuc.edu Mon Dec 13 01:41:45 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 01:41:45 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200412130741.BAA12839@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.18 -> 1.19 --- Log message: Fix a bug where directory names of length one or less where not set properly (examples: "", ".", "a"). --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.18 llvm/lib/System/Unix/Path.cpp:1.19 --- llvm/lib/System/Unix/Path.cpp:1.18 Mon Dec 13 00:57:15 2004 +++ llvm/lib/System/Unix/Path.cpp Mon Dec 13 01:41:35 2004 @@ -290,7 +290,7 @@ Path save(*this); path = a_path; size_t last = a_path.size() -1; - if (last != 0 && a_path[last] != '/') + if (a_path.size() == 0 || a_path[last] != '/') path += '/'; if (!isValid()) { path = save.path; From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/libdummy/Makefile Message-ID: <200412130741.BAA12790@zion.cs.uiuc.edu> Changes in directory llvm/runtime/libdummy: Makefile updated: 1.5 -> 1.6 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+2 -0) Index: llvm/runtime/libdummy/Makefile diff -u llvm/runtime/libdummy/Makefile:1.5 llvm/runtime/libdummy/Makefile:1.6 --- llvm/runtime/libdummy/Makefile:1.5 Thu Dec 2 03:58:09 2004 +++ llvm/runtime/libdummy/Makefile Mon Dec 13 01:40:50 2004 @@ -11,5 +11,7 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = dummy +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common + From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libmalloc/Makefile Message-ID: <200412130741.BAA12787@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libmalloc: Makefile updated: 1.5 -> 1.6 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libmalloc/Makefile diff -u llvm/runtime/GCCLibraries/libmalloc/Makefile:1.5 llvm/runtime/GCCLibraries/libmalloc/Makefile:1.6 --- llvm/runtime/GCCLibraries/libmalloc/Makefile:1.5 Thu Dec 2 03:58:09 2004 +++ llvm/runtime/GCCLibraries/libmalloc/Makefile Mon Dec 13 01:40:50 2004 @@ -11,5 +11,6 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = malloc +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libutempter/Makefile Message-ID: <200412130741.BAA12792@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libutempter: Makefile updated: 1.5 -> 1.6 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libutempter/Makefile diff -u llvm/runtime/GCCLibraries/libutempter/Makefile:1.5 llvm/runtime/GCCLibraries/libutempter/Makefile:1.6 --- llvm/runtime/GCCLibraries/libutempter/Makefile:1.5 Thu Dec 2 03:58:09 2004 +++ llvm/runtime/GCCLibraries/libutempter/Makefile Mon Dec 13 01:40:50 2004 @@ -11,5 +11,6 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = utempter +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libgcc/Makefile Message-ID: <200412130741.BAA12791@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libgcc: Makefile updated: 1.6 -> 1.7 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libgcc/Makefile diff -u llvm/runtime/GCCLibraries/libgcc/Makefile:1.6 llvm/runtime/GCCLibraries/libgcc/Makefile:1.7 --- llvm/runtime/GCCLibraries/libgcc/Makefile:1.6 Thu Dec 2 03:58:08 2004 +++ llvm/runtime/GCCLibraries/libgcc/Makefile Mon Dec 13 01:40:50 2004 @@ -11,5 +11,6 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = gcc +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libm/Makefile Message-ID: <200412130741.BAA12789@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libm: Makefile updated: 1.7 -> 1.8 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libm/Makefile diff -u llvm/runtime/GCCLibraries/libm/Makefile:1.7 llvm/runtime/GCCLibraries/libm/Makefile:1.8 --- llvm/runtime/GCCLibraries/libm/Makefile:1.7 Thu Dec 2 03:58:09 2004 +++ llvm/runtime/GCCLibraries/libm/Makefile Mon Dec 13 01:40:50 2004 @@ -11,6 +11,7 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = m +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libucb/Makefile Message-ID: <200412130741.BAA12794@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libucb: Makefile updated: 1.6 -> 1.7 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libucb/Makefile diff -u llvm/runtime/GCCLibraries/libucb/Makefile:1.6 llvm/runtime/GCCLibraries/libucb/Makefile:1.7 --- llvm/runtime/GCCLibraries/libucb/Makefile:1.6 Thu Dec 2 03:58:09 2004 +++ llvm/runtime/GCCLibraries/libucb/Makefile Mon Dec 13 01:40:50 2004 @@ -11,5 +11,6 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = ucb +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libtermcap/Makefile Message-ID: <200412130741.BAA12793@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libtermcap: Makefile updated: 1.4 -> 1.5 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libtermcap/Makefile diff -u llvm/runtime/GCCLibraries/libtermcap/Makefile:1.4 llvm/runtime/GCCLibraries/libtermcap/Makefile:1.5 --- llvm/runtime/GCCLibraries/libtermcap/Makefile:1.4 Thu Dec 2 03:58:09 2004 +++ llvm/runtime/GCCLibraries/libtermcap/Makefile Mon Dec 13 01:40:50 2004 @@ -11,5 +11,6 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = termcap +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libg/Makefile Message-ID: <200412130741.BAA12796@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libg: Makefile updated: 1.6 -> 1.7 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libg/Makefile diff -u llvm/runtime/GCCLibraries/libg/Makefile:1.6 llvm/runtime/GCCLibraries/libg/Makefile:1.7 --- llvm/runtime/GCCLibraries/libg/Makefile:1.6 Thu Dec 2 03:58:08 2004 +++ llvm/runtime/GCCLibraries/libg/Makefile Mon Dec 13 01:40:50 2004 @@ -11,5 +11,6 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = g +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libpthread/Makefile Message-ID: <200412130741.BAA12795@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libpthread: Makefile updated: 1.3 -> 1.4 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libpthread/Makefile diff -u llvm/runtime/GCCLibraries/libpthread/Makefile:1.3 llvm/runtime/GCCLibraries/libpthread/Makefile:1.4 --- llvm/runtime/GCCLibraries/libpthread/Makefile:1.3 Thu Dec 2 03:58:09 2004 +++ llvm/runtime/GCCLibraries/libpthread/Makefile Mon Dec 13 01:40:50 2004 @@ -11,5 +11,6 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = pthread +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/libc/Makefile Message-ID: <200412130741.BAA12809@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/libc: Makefile updated: 1.5 -> 1.6 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/libc/Makefile diff -u llvm/runtime/GCCLibraries/libc/Makefile:1.5 llvm/runtime/GCCLibraries/libc/Makefile:1.6 --- llvm/runtime/GCCLibraries/libc/Makefile:1.5 Thu Dec 2 03:58:08 2004 +++ llvm/runtime/GCCLibraries/libc/Makefile Mon Dec 13 01:40:50 2004 @@ -11,6 +11,7 @@ BYTECODE_LIBRARY = 1 DONT_BUILD_RELINKED = 1 LIBRARYNAME = c +BYTECODE_DESTINATION = $(cferuntime_libdir) include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 01:41:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:41:05 -0600 Subject: [llvm-commits] CVS: llvm/runtime/GCCLibraries/crtend/Makefile Message-ID: <200412130741.BAA12814@zion.cs.uiuc.edu> Changes in directory llvm/runtime/GCCLibraries/crtend: Makefile updated: 1.25 -> 1.26 --- Log message: Use the new BYTECODE_DESTINATION to override the default bytecode install destination for this library so that it goes to $(cferuntime_libdir) rather than just $(libdir). Normal bytecode libraries should be installed in the $(libdir), but these ones are "special" because they're part of the the C/C++ front end. --- Diffs of the changes: (+1 -0) Index: llvm/runtime/GCCLibraries/crtend/Makefile diff -u llvm/runtime/GCCLibraries/crtend/Makefile:1.25 llvm/runtime/GCCLibraries/crtend/Makefile:1.26 --- llvm/runtime/GCCLibraries/crtend/Makefile:1.25 Tue Dec 7 22:22:47 2004 +++ llvm/runtime/GCCLibraries/crtend/Makefile Mon Dec 13 01:40:50 2004 @@ -19,6 +19,7 @@ DONT_BUILD_RELINKED = 1 BYTECODE_LIBRARY = 1 LIBRARYNAME = crtend +BYTECODE_DESTINATION = $(cferuntime_libdir) # Note: We're using FAKE_SOURCES because the comp_*.c don't really exists. # However this makefile builds comp_*.bc and that's what we want in the library. From alkis at cs.uiuc.edu Mon Dec 13 01:43:57 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 01:43:57 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/ClassFile/ClassFile.cpp Message-ID: <200412130743.BAA12897@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/ClassFile: ClassFile.cpp updated: 1.32 -> 1.33 --- Log message: Use Path::exists() to check for file existance and not isFile(). --- Diffs of the changes: (+5 -2) Index: llvm-java/lib/ClassFile/ClassFile.cpp diff -u llvm-java/lib/ClassFile/ClassFile.cpp:1.32 llvm-java/lib/ClassFile/ClassFile.cpp:1.33 --- llvm-java/lib/ClassFile/ClassFile.cpp:1.32 Mon Dec 13 01:15:00 2004 +++ llvm-java/lib/ClassFile/ClassFile.cpp Mon Dec 13 01:43:46 2004 @@ -182,8 +182,10 @@ unsigned b = 0, e = 0; do { e = ClassPath.find(':', b); - if (path.setDirectory(ClassPath.substr(b, e - b))) + if (path.setDirectory(ClassPath.substr(b, e - b))) { result.push_back(path); + DEBUG(std::cerr << "Adding: " << path.toString() << " to CLASSPATH\nx"); + } b = e + 1; } while (e != std::string::npos); @@ -204,9 +206,10 @@ for (unsigned i = 0, e = classpath.size(); i != e; ++i) { sys::Path filename = classpath[i]; + assert(filename.isDirectory() && "CLASSPATH element not a directory!"); filename.appendFile(clazz); DEBUG(std::cerr << "Trying file: " << filename.toString() << '\n'); - if (filename.isFile()) + if (filename.exists()) return filename; } From reid at x10sys.com Mon Dec 13 01:51:17 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:51:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200412130751.BAA13073@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.19 -> 1.20 --- Log message: Remove an always false clause from an if statement. --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.19 llvm/lib/System/Unix/Path.cpp:1.20 --- llvm/lib/System/Unix/Path.cpp:1.19 Mon Dec 13 01:41:35 2004 +++ llvm/lib/System/Unix/Path.cpp Mon Dec 13 01:51:07 2004 @@ -290,7 +290,7 @@ Path save(*this); path = a_path; size_t last = a_path.size() -1; - if (a_path.size() == 0 || a_path[last] != '/') + if (a_path[last] != '/') path += '/'; if (!isValid()) { path = save.path; From reid at x10sys.com Mon Dec 13 01:52:02 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 01:52:02 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412130752.BAA13103@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.10 -> 1.11 --- Log message: Fix a bug where "." or any single character file name doesn't get the terminating / when setDirectory is called. --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.10 llvm/lib/System/Win32/Path.cpp:1.11 --- llvm/lib/System/Win32/Path.cpp:1.10 Mon Dec 13 00:57:15 2004 +++ llvm/lib/System/Win32/Path.cpp Mon Dec 13 01:51:52 2004 @@ -300,7 +300,7 @@ path = a_path; FlipBackSlashes(path); size_t last = a_path.size() -1; - if (last != 0 && a_path[last] != '/') + if (a_path[last] != '/') path += '/'; if (!isValid()) { path = save.path; From reid at x10sys.com Mon Dec 13 02:53:47 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 02:53:47 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.cpp Message-ID: <200412130853.CAA13498@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: CompilerDriver.cpp updated: 1.21 -> 1.22 --- Log message: Make use of the new Path inserter function. --- Diffs of the changes: (+3 -3) Index: llvm/tools/llvmc/CompilerDriver.cpp diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.21 llvm/tools/llvmc/CompilerDriver.cpp:1.22 --- llvm/tools/llvmc/CompilerDriver.cpp:1.21 Sun Dec 12 21:01:26 2004 +++ llvm/tools/llvmc/CompilerDriver.cpp Mon Dec 13 02:53:36 2004 @@ -190,7 +190,7 @@ if (TempDir.isDirectory() && TempDir.writable()) TempDir.destroyDirectory(/*remove_contents=*/true); } else { - std::cout << "Temporary files are in " << TempDir.toString() << "\n"; + std::cout << "Temporary files are in " << TempDir << "\n"; } } @@ -530,11 +530,11 @@ std::cerr << "OutputMachine = " << machine << "\n"; InputList::const_iterator I = InpList.begin(); while ( I != InpList.end() ) { - std::cerr << "Input: " << I->first.toString() << "(" << I->second + std::cerr << "Input: " << I->first << "(" << I->second << ")\n"; ++I; } - std::cerr << "Output: " << Output.toString() << "\n"; + std::cerr << "Output: " << Output << "\n"; } // If there's no input, we're done. From reid at x10sys.com Mon Dec 13 03:37:52 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 03:37:52 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/m4/bison.m4 Message-ID: <200412130937.DAA31096@zion.cs.uiuc.edu> Changes in directory llvm/autoconf/m4: bison.m4 updated: 1.3 -> 1.4 --- Log message: Minor syntactical change to make this a little easier to comprehend. --- Diffs of the changes: (+2 -5) Index: llvm/autoconf/m4/bison.m4 diff -u llvm/autoconf/m4/bison.m4:1.3 llvm/autoconf/m4/bison.m4:1.4 --- llvm/autoconf/m4/bison.m4:1.3 Wed Nov 24 22:42:25 2004 +++ llvm/autoconf/m4/bison.m4 Mon Dec 13 03:37:41 2004 @@ -6,12 +6,9 @@ # 2) BISON is set to bison # AC_DEFUN([AC_PROG_BISON], -[AC_CACHE_CHECK([],[llvm_cv_has_bison], -[AC_PROG_YACC() -]) +[AC_CACHE_CHECK([],[llvm_cv_has_bison],[AC_PROG_YACC()]) if test "$YACC" != "bison -y"; then AC_MSG_ERROR([bison not found but required]) else AC_SUBST(BISON,[bison],[location of bison]) -fi -]) +fi]) From reid at x10sys.com Mon Dec 13 10:04:16 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 10:04:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200412131604.KAA06702@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.33 -> 1.34 --- Log message: Get rid of some leaks found by VC leak detector. Patch contributed by Morten Ofsted. --- Diffs of the changes: (+3 -5) Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.33 llvm/lib/Support/Timer.cpp:1.34 --- llvm/lib/Support/Timer.cpp:1.33 Thu Nov 18 22:59:07 2004 +++ llvm/lib/Support/Timer.cpp Mon Dec 13 10:04:04 2004 @@ -33,12 +33,10 @@ // problem is that a Statistic<> object gets destroyed, which ends up calling // 'GetLibSupportInfoOutputFile()' (below), which calls this function. // LibSupportInfoOutputFilename used to be a global variable, but sometimes it -// would get destroyed before the Statistic, causing havoc to ensue. We "fix" -// this by creating the string the first time it is needed and never destroying -// it. +// would get destroyed before the Statistic, causing havoc to ensue. static std::string &getLibSupportInfoOutputFilename() { - static std::string *LibSupportInfoOutputFilename = new std::string(); - return *LibSupportInfoOutputFilename; + static std::string LibSupportInfoOutputFilename; + return LibSupportInfoOutputFilename; } namespace { From reid at x10sys.com Mon Dec 13 10:04:16 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 10:04:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Message-ID: <200412131604.KAA06699@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: JITEmitter.cpp updated: 1.59 -> 1.60 --- Log message: Get rid of some leaks found by VC leak detector. Patch contributed by Morten Ofsted. --- Diffs of the changes: (+5 -0) Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.59 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.60 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.59 Sun Dec 5 01:19:16 2004 +++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Mon Dec 13 10:04:04 2004 @@ -51,6 +51,7 @@ unsigned char *CurStubPtr, *CurFunctionPtr; public: JITMemoryManager(); + ~JITMemoryManager(); inline unsigned char *allocateStub(unsigned StubSize); inline unsigned char *startFunctionBody(); @@ -69,6 +70,10 @@ CurStubPtr = CurFunctionPtr = FunctionBase; } +JITMemoryManager::~JITMemoryManager() { + sys::Memory::ReleaseRWX(MemBlock); +} + unsigned char *JITMemoryManager::allocateStub(unsigned StubSize) { CurStubPtr -= StubSize; if (CurStubPtr < MemBase) { From reid at x10sys.com Mon Dec 13 10:22:43 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 10:22:43 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Message-ID: <200412131622.KAA06784@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ExecutionEngine: ExecutionEngine.h updated: 1.30 -> 1.31 --- Log message: Add a convenience function for clearing the two global areas. Patch contributed by Morten Ofsted. --- Diffs of the changes: (+7 -0) Index: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h diff -u llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.30 llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.31 --- llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.30 Mon Nov 22 10:54:54 2004 +++ llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Mon Dec 13 10:22:32 2004 @@ -93,6 +93,13 @@ } } + /// clearAllGlobalMappings - Clear all global mappings and start over again + /// use in dynamic compilation scenarios when you want to move globals + void clearAllGlobalMappings() { + GlobalAddressMap.clear(); + GlobalAddressReverseMap.clear(); + } + /// updateGlobalMapping - Replace an existing mapping for GV with a new /// address. This updates both maps as required. void updateGlobalMapping(const GlobalValue *GV, void *Addr) { From reid at x10sys.com Mon Dec 13 10:29:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 10:29:04 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Type.h Value.h Message-ID: <200412131629.KAA06836@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Type.h updated: 1.67 -> 1.68 Value.h updated: 1.66 -> 1.67 --- Log message: Added a size_type typedef to LLVM containers to make Visual Studio shut up (and possibly to make LLVM more x86 64bit friendly). --- Diffs of the changes: (+4 -2) Index: llvm/include/llvm/Type.h diff -u llvm/include/llvm/Type.h:1.67 llvm/include/llvm/Type.h:1.68 --- llvm/include/llvm/Type.h:1.67 Fri Nov 19 10:39:04 2004 +++ llvm/include/llvm/Type.h Mon Dec 13 10:28:53 2004 @@ -246,7 +246,8 @@ /// getNumContainedTypes - Return the number of types in the derived type. /// - unsigned getNumContainedTypes() const { return ContainedTys.size(); } + typedef std::vector::size_type size_type; + size_type getNumContainedTypes() const { return ContainedTys.size(); } //===--------------------------------------------------------------------===// // Static members exported by the Type class itself. Useful for getting Index: llvm/include/llvm/Value.h diff -u llvm/include/llvm/Value.h:1.66 llvm/include/llvm/Value.h:1.67 --- llvm/include/llvm/Value.h:1.66 Wed Oct 27 11:14:47 2004 +++ llvm/include/llvm/Value.h Mon Dec 13 10:28:53 2004 @@ -89,8 +89,9 @@ // typedef UseListIteratorWrapper use_iterator; typedef UseListConstIteratorWrapper use_const_iterator; + typedef iplist::size_type size_type; - unsigned use_size() const { return Uses.size(); } + size_type use_size() const { return Uses.size(); } bool use_empty() const { return Uses.empty(); } use_iterator use_begin() { return Uses.begin(); } use_const_iterator use_begin() const { return Uses.begin(); } From reid at x10sys.com Mon Dec 13 10:29:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 10:29:04 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/CommandLine.h Message-ID: <200412131629.KAA06831@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: CommandLine.h updated: 1.40 -> 1.41 --- Log message: Added a size_type typedef to LLVM containers to make Visual Studio shut up (and possibly to make LLVM more x86 64bit friendly). --- Diffs of the changes: (+1 -1) Index: llvm/include/llvm/Support/CommandLine.h diff -u llvm/include/llvm/Support/CommandLine.h:1.40 llvm/include/llvm/Support/CommandLine.h:1.41 --- llvm/include/llvm/Support/CommandLine.h:1.40 Sat Dec 4 23:17:34 2004 +++ llvm/include/llvm/Support/CommandLine.h Mon Dec 13 10:28:53 2004 @@ -435,7 +435,7 @@ typedef DataType parser_data_type; // Implement virtual functions needed by generic_parser_base - unsigned getNumOptions() const { return Values.size(); } + unsigned getNumOptions() const { return (unsigned)Values.size(); } const char *getOption(unsigned N) const { return Values[N].first; } const char *getDescription(unsigned N) const { return Values[N].second.second; From reid at x10sys.com Mon Dec 13 11:02:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 11:02:07 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/Commands.cpp Message-ID: <200412131702.LAA07133@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: Commands.cpp updated: 1.7 -> 1.8 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : \ The getFileTimestamp and getFileSize functions have been removed from \ FileUtilities.{h,cpp}. They are replaced by Path::getTimestamp and \ Path::getSize,respectively. --- Diffs of the changes: (+3 -3) Index: llvm/tools/llvm-db/Commands.cpp diff -u llvm/tools/llvm-db/Commands.cpp:1.7 llvm/tools/llvm-db/Commands.cpp:1.8 --- llvm/tools/llvm-db/Commands.cpp:1.7 Fri Nov 19 13:45:44 2004 +++ llvm/tools/llvm-db/Commands.cpp Mon Dec 13 11:01:53 2004 @@ -49,8 +49,8 @@ eliminateRunInfo(); // If the program has been modified, reload it! - std::string Program = Dbg.getProgramPath(); - if (TheProgramInfo->getProgramTimeStamp() != getFileTimestamp(Program)) { + sys::Path Program (Dbg.getProgramPath()); + if (TheProgramInfo->getProgramTimeStamp() != Program.getTimestamp()) { std::cout << "'" << Program << "' has changed; re-reading program.\n"; // Unload an existing program. This kills the program if necessary. @@ -59,7 +59,7 @@ TheProgramInfo = 0; CurrentFile = 0; - Dbg.loadProgram(Program); + Dbg.loadProgram(Program.toString()); TheProgramInfo = new ProgramInfo(Dbg.getProgram()); } From reid at x10sys.com Mon Dec 13 11:02:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 11:02:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/Debugger/ProgramInfo.cpp Message-ID: <200412131702.LAA07131@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: ProgramInfo.cpp updated: 1.7 -> 1.8 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : \ The getFileTimestamp and getFileSize functions have been removed from \ FileUtilities.{h,cpp}. They are replaced by Path::getTimestamp and \ Path::getSize,respectively. --- Diffs of the changes: (+3 -2) Index: llvm/lib/Debugger/ProgramInfo.cpp diff -u llvm/lib/Debugger/ProgramInfo.cpp:1.7 llvm/lib/Debugger/ProgramInfo.cpp:1.8 --- llvm/lib/Debugger/ProgramInfo.cpp:1.7 Sun Dec 12 20:59:15 2004 +++ llvm/lib/Debugger/ProgramInfo.cpp Mon Dec 13 11:01:53 2004 @@ -236,9 +236,10 @@ // ProgramInfo implementation // -ProgramInfo::ProgramInfo(Module *m) : M(m) { +ProgramInfo::ProgramInfo(Module *m) : M(m), ProgramTimeStamp(0,0) { assert(M && "Cannot create program information with a null module!"); - ProgramTimeStamp = getFileTimestamp(M->getModuleIdentifier()); + sys::Path modulePath(M->getModuleIdentifier()); + ProgramTimeStamp = modulePath.getTimestamp(); SourceFilesIsComplete = false; SourceFunctionsIsComplete = false; From reid at x10sys.com Mon Dec 13 11:02:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 11:02:07 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Debugger/ProgramInfo.h Message-ID: <200412131702.LAA07130@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Debugger: ProgramInfo.h updated: 1.2 -> 1.3 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : \ The getFileTimestamp and getFileSize functions have been removed from \ FileUtilities.{h,cpp}. They are replaced by Path::getTimestamp and \ Path::getSize,respectively. --- Diffs of the changes: (+3 -2) Index: llvm/include/llvm/Debugger/ProgramInfo.h diff -u llvm/include/llvm/Debugger/ProgramInfo.h:1.2 llvm/include/llvm/Debugger/ProgramInfo.h:1.3 --- llvm/include/llvm/Debugger/ProgramInfo.h:1.2 Thu Apr 15 10:24:55 2004 +++ llvm/include/llvm/Debugger/ProgramInfo.h Mon Dec 13 11:01:53 2004 @@ -21,6 +21,7 @@ #ifndef LLVM_DEBUGGER_PROGRAMINFO_H #define LLVM_DEBUGGER_PROGRAMINFO_H +#include "llvm/System/TimeValue.h" #include #include #include @@ -133,7 +134,7 @@ /// ProgramTimeStamp - This is the timestamp of the executable file that we /// currently have loaded into the debugger. - unsigned long long ProgramTimeStamp; + sys::TimeValue ProgramTimeStamp; /// SourceFiles - This map is used to transform source file descriptors into /// their corresponding SourceFileInfo objects. This mapping owns the @@ -170,7 +171,7 @@ /// getProgramTimeStamp - Return the time-stamp of the program when it was /// loaded. - unsigned long long getProgramTimeStamp() const { return ProgramTimeStamp; } + sys::TimeValue getProgramTimeStamp() const { return ProgramTimeStamp; } //===------------------------------------------------------------------===// // Interfaces to the source code files that make up the program. From reid at x10sys.com Mon Dec 13 11:02:18 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 11:02:18 -0600 Subject: [llvm-commits] CVS: llvm/utils/fpcmp/Makefile Message-ID: <200412131702.LAA07155@zion.cs.uiuc.edu> Changes in directory llvm/utils/fpcmp: Makefile updated: 1.2 -> 1.3 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : libLLVMSupport now depends on libLLVMSystem --- Diffs of the changes: (+1 -1) Index: llvm/utils/fpcmp/Makefile diff -u llvm/utils/fpcmp/Makefile:1.2 llvm/utils/fpcmp/Makefile:1.3 --- llvm/utils/fpcmp/Makefile:1.2 Wed Oct 27 18:18:45 2004 +++ llvm/utils/fpcmp/Makefile Mon Dec 13 11:02:08 2004 @@ -9,7 +9,7 @@ LEVEL = ../.. TOOLNAME = fpcmp -USEDLIBS = LLVMSupport.a +USEDLIBS = LLVMSupport.a LLVMSystem.a include $(LEVEL)/Makefile.common From reid at x10sys.com Mon Dec 13 11:02:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 11:02:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200412131702.LAA07132@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.28 -> 1.29 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : \ The getFileTimestamp and getFileSize functions have been removed from \ FileUtilities.{h,cpp}. They are replaced by Path::getTimestamp and \ Path::getSize,respectively. --- Diffs of the changes: (+3 -21) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.28 llvm/lib/Support/FileUtilities.cpp:1.29 --- llvm/lib/Support/FileUtilities.cpp:1.28 Sun Dec 12 20:57:41 2004 +++ llvm/lib/Support/FileUtilities.cpp Mon Dec 13 11:01:53 2004 @@ -14,6 +14,7 @@ #include "llvm/Support/FileUtilities.h" #include "llvm/Support/DataTypes.h" +#include "llvm/System/Path.h" #include "llvm/Config/unistd.h" #include "llvm/Config/fcntl.h" #include "llvm/Config/sys/types.h" @@ -195,26 +196,6 @@ return AddPermissionsBits(Filename, 0444); } -/// getFileSize - Return the size of the specified file in bytes, or -1 if the -/// file cannot be read or does not exist. -long long llvm::getFileSize(const std::string &Filename) { - struct stat StatBuf; - if (stat(Filename.c_str(), &StatBuf) == -1) - return -1; - return StatBuf.st_size; -} - -/// getFileTimestamp - Get the last modified time for the specified file in an -/// unspecified format. This is useful to allow checking to see if a file was -/// updated since that last time the timestampt was aquired. If the file does -/// not exist or there is an error getting the time-stamp, zero is returned. -unsigned long long llvm::getFileTimestamp(const std::string &Filename) { - struct stat StatBuf; - if (stat(Filename.c_str(), &StatBuf) == -1) - return 0; - return StatBuf.st_mtime; -} - /// ReadFileIntoAddressSpace - Attempt to map the specific file into the /// address space of the current process for reading. If this succeeds, /// return the address of the buffer and the length of the file mapped. On @@ -222,7 +203,8 @@ void *llvm::ReadFileIntoAddressSpace(const std::string &Filename, unsigned &Length) { #if defined(HAVE_MMAP_FILE) && !defined(_MSC_VER) - Length = (unsigned)getFileSize(Filename); + sys::Path File(Filename); + Length = (unsigned)File.getSize(); if ((int)Length == -1) return 0; FDHandle FD(open(Filename.c_str(), O_RDONLY)); From reid at x10sys.com Mon Dec 13 11:02:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 11:02:07 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200412131702.LAA07129@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.14 -> 1.15 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : \ The getFileTimestamp and getFileSize functions have been removed from \ FileUtilities.{h,cpp}. They are replaced by Path::getTimestamp and \ Path::getSize,respectively. --- Diffs of the changes: (+15 -0) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.14 llvm/include/llvm/System/Path.h:1.15 --- llvm/include/llvm/System/Path.h:1.14 Mon Dec 13 00:57:15 2004 +++ llvm/include/llvm/System/Path.h Mon Dec 13 11:01:53 2004 @@ -376,6 +376,21 @@ /// @brief Get file status. void getStatusInfo(StatusInfo& info) const; + /// This function returns the last modified time stamp for the file + /// referenced by this path. The Path may reference a file or a directory. + /// If the file does not exist, a ZeroTime timestamp is returned. + /// @returns last modified timestamp of the file/directory or ZeroTime + /// @brief Get file timestamp. + inline TimeValue getTimestamp() const { + StatusInfo info; getStatusInfo(info); return info.modTime; + } + + /// This function returns the size of the file referenced by this path. + /// @brief Get file size. + inline size_t getSize() const { + StatusInfo info; getStatusInfo(info); return info.fileSize; + } + /// This method attempts to set the Path object to \p unverified_path /// and interpret the name as a directory name. The \p unverified_path /// is verified. If verification succeeds then \p unverified_path From reid at x10sys.com Mon Dec 13 11:02:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 11:02:07 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/FileUtilities.h Message-ID: <200412131702.LAA07134@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: FileUtilities.h updated: 1.21 -> 1.22 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : \ The getFileTimestamp and getFileSize functions have been removed from \ FileUtilities.{h,cpp}. They are replaced by Path::getTimestamp and \ Path::getSize,respectively. --- Diffs of the changes: (+0 -11) Index: llvm/include/llvm/Support/FileUtilities.h diff -u llvm/include/llvm/Support/FileUtilities.h:1.21 llvm/include/llvm/Support/FileUtilities.h:1.22 --- llvm/include/llvm/Support/FileUtilities.h:1.21 Sun Dec 12 21:15:47 2004 +++ llvm/include/llvm/Support/FileUtilities.h Mon Dec 13 11:01:53 2004 @@ -61,17 +61,6 @@ /// bool MakeFileReadable(const std::string &Filename); -/// getFileSize - Return the size of the specified file in bytes, or -1 if the -/// file cannot be read or does not exist. -long long getFileSize(const std::string &Filename); - - -/// getFileTimestamp - Get the last modified time for the specified file in an -/// unspecified format. This is useful to allow checking to see if a file was -/// updated since that last time the timestampt was aquired. If the file does -/// not exist or there is an error getting the time-stamp, zero is returned. -unsigned long long getFileTimestamp(const std::string &Filename); - /// ReadFileIntoAddressSpace - Attempt to map the specific file into the /// address space of the current process for reading. If this succeeds, /// return the address of the buffer and the length of the file mapped. On From reid at x10sys.com Mon Dec 13 11:18:30 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 11:18:30 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200412131718.LAA07244@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.86 -> 1.87 --- Log message: Make the loop termination condition clear when building the set of items to pass to the Linker::LinkInItems function. --- Diffs of the changes: (+2 -3) Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.86 llvm/tools/gccld/gccld.cpp:1.87 --- llvm/tools/gccld/gccld.cpp:1.86 Sun Dec 12 21:01:14 2004 +++ llvm/tools/gccld/gccld.cpp Mon Dec 13 11:18:19 2004 @@ -173,7 +173,7 @@ cl::list::const_iterator libIt = Libraries.begin(); int libPos = -1, filePos = -1; - while ( 1 ) { + while ( libIt != Libraries.end() || fileIt != Files.end() ) { if (libIt != Libraries.end()) libPos = Libraries.getPosition(libIt - Libraries.begin()); else @@ -189,11 +189,10 @@ } else if (libPos != -1 && (filePos == -1 || libPos < filePos)) { // Add a library Items.push_back(std::make_pair(*libIt++, true)); - } else { - break; // we're done with the list } } } + int main(int argc, char **argv, char **envp) { cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n"); sys::PrintStackTraceOnErrorSignal(); From reid at x10sys.com Mon Dec 13 11:18:30 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 11:18:30 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200412131718.LAA07241@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.8 -> 1.9 --- Log message: Make the loop termination condition clear when building the set of items to pass to the Linker::LinkInItems function. --- Diffs of the changes: (+1 -3) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.8 llvm/tools/llvm-ld/llvm-ld.cpp:1.9 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.8 Sun Dec 12 21:01:14 2004 +++ llvm/tools/llvm-ld/llvm-ld.cpp Mon Dec 13 11:18:19 2004 @@ -390,7 +390,7 @@ cl::list::const_iterator libIt = Libraries.begin(); int libPos = -1, filePos = -1; - while ( 1 ) { + while ( libIt != Libraries.end() || fileIt != Files.end() ) { if (libIt != Libraries.end()) libPos = Libraries.getPosition(libIt - Libraries.begin()); else @@ -406,8 +406,6 @@ } else if (libPos != -1 && (filePos == -1 || libPos < filePos)) { // Add a library Items.push_back(std::make_pair(*libIt++, true)); - } else { - break; // we're done with the list } } } From lattner at cs.uiuc.edu Mon Dec 13 11:23:26 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Dec 2004 11:23:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelSimple.cpp Message-ID: <200412131723.iBDHNQ7l003817@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelSimple.cpp updated: 1.300 -> 1.301 --- Log message: Set the rounding mode for the X86 FPU to 64-bits instead of 80-bits. We don't support long double anyway, and this gives us FP results closer to other targets. This also speeds up 179.art from 41.4s to 18.32s, by eliminating a problem with extra precision that causes an FP == comparison to fail (leading to extra loop iterations). --- Diffs of the changes: (+22 -0) Index: llvm/lib/Target/X86/X86ISelSimple.cpp diff -u llvm/lib/Target/X86/X86ISelSimple.cpp:1.300 llvm/lib/Target/X86/X86ISelSimple.cpp:1.301 --- llvm/lib/Target/X86/X86ISelSimple.cpp:1.300 Thu Dec 2 23:13:15 2004 +++ llvm/lib/Target/X86/X86ISelSimple.cpp Mon Dec 13 11:23:11 2004 @@ -115,6 +115,10 @@ // Copy incoming arguments off of the stack... LoadArgumentsToVirtualRegs(Fn); + // If this is main, emit special code. + if (Fn.hasExternalLinkage() && Fn.getName() == "main") + EmitSpecialCodeForMain(); + // Instruction select everything except PHI nodes visit(Fn); @@ -136,6 +140,10 @@ return "X86 Simple Instruction Selection"; } + /// EmitSpecialCodeForMain - Emit any code that needs to be executed only in + /// the main function. + void EmitSpecialCodeForMain(); + /// visitBasicBlock - This method is called when we are visiting a new basic /// block. This simply creates a new MachineBasicBlock to emit code into /// and adds it to the current MachineFunction. Subsequent visit* for @@ -650,6 +658,20 @@ VarArgsFrameIndex = MFI->CreateFixedObject(1, ArgOffset); } +/// EmitSpecialCodeForMain - Emit any code that needs to be executed only in +/// the main function. +void X86ISel::EmitSpecialCodeForMain() { + // Switch the FPU to 64-bit precision mode for better compatibility and speed. + int CWFrameIdx = F->getFrameInfo()->CreateStackObject(2, 2); + addFrameReference(BuildMI(BB, X86::FNSTCW16m, 4), CWFrameIdx); + + // Set the high part to be 64-bit precision. + addFrameReference(BuildMI(BB, X86::MOV8mi, 5), + CWFrameIdx, 1).addImm(2); + + // Reload the modified control word now. + addFrameReference(BuildMI(BB, X86::FLDCW16m, 4), CWFrameIdx); +} /// SelectPHINodes - Insert machine code to generate phis. This is tricky /// because we have to generate our sources into the source basic blocks, not From reid at x10sys.com Mon Dec 13 11:41:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 11:41:24 -0600 Subject: [llvm-commits] CVS: llvm/utils/fpcmp/fpcmp.cpp Message-ID: <200412131741.LAA07403@zion.cs.uiuc.edu> Changes in directory llvm/utils/fpcmp: fpcmp.cpp updated: 1.10 -> 1.11 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Change use of ReadFileIntoAddressSpace to sys::MappedFile use. * Shorten a line > 80 chars. --- Diffs of the changes: (+58 -59) Index: llvm/utils/fpcmp/fpcmp.cpp diff -u llvm/utils/fpcmp/fpcmp.cpp:1.10 llvm/utils/fpcmp/fpcmp.cpp:1.11 --- llvm/utils/fpcmp/fpcmp.cpp:1.10 Wed Sep 1 17:55:40 2004 +++ llvm/utils/fpcmp/fpcmp.cpp Mon Dec 13 11:41:13 2004 @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/CommandLine.h" -#include "llvm/Support/FileUtilities.h" +#include "llvm/System/MappedFile.h" #include #include @@ -31,17 +31,6 @@ AbsTolerance("a", cl::desc("Absolute error tolerated"), cl::init(0)); } - -/// OpenFile - mmap the specified file into the address space for reading, and -/// return the length and address of the buffer. -static void OpenFile(const std::string &Filename, unsigned &Len, char* &BufPtr){ - BufPtr = (char*)ReadFileIntoAddressSpace(Filename, Len); - if (BufPtr == 0) { - std::cerr << "Error: cannot open file '" << Filename << "'\n"; - exit(2); - } -} - static bool isNumberChar(char C) { switch (C) { case '0': case '1': case '2': case '3': case '4': @@ -125,65 +114,75 @@ int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv); - // mmap in the files. - unsigned File1Len, File2Len; - char *File1Start, *File2Start; - OpenFile(File1, File1Len, File1Start); - OpenFile(File2, File2Len, File2Start); - - // Okay, now that we opened the files, scan them for the first difference. - char *File1End = File1Start+File1Len; - char *File2End = File2Start+File2Len; - char *F1P = File1Start; - char *F2P = File2Start; - - // Scan for the end of file or first difference. - while (F1P < File1End && F2P < File2End && *F1P == *F2P) - ++F1P, ++F2P; - - // Common case: identifical files. - if (F1P == File1End && F2P == File2End) return 0; - - // If the files need padding, do so now. - PadFileIfNeeded(File1Start, File1End, F1P); - PadFileIfNeeded(File2Start, File2End, F2P); - - while (1) { - // Scan for the end of file or next difference. + try { + // map in the files into memory + sys::Path F1Path(File1); + sys::Path F2Path(File2); + sys::MappedFile F1 ( F1Path ); + sys::MappedFile F2 ( F2Path ); + F1.map(); + F2.map(); + + // Okay, now that we opened the files, scan them for the first difference. + char *File1Start = F1.charBase(); + char *File2Start = F2.charBase(); + char *File1End = File1Start+F1.size(); + char *File2End = File2Start+F2.size(); + char *F1P = File1Start; + char *F2P = File2Start; + + // Scan for the end of file or first difference. while (F1P < File1End && F2P < File2End && *F1P == *F2P) ++F1P, ++F2P; - if (F1P >= File1End || F2P >= File2End) break; + // Common case: identifical files. + if (F1P == File1End && F2P == File2End) return 0; - // Okay, we must have found a difference. Backup to the start of the - // current number each stream is at so that we can compare from the - // beginning. + // If the files need padding, do so now. + PadFileIfNeeded(File1Start, File1End, F1P); + PadFileIfNeeded(File2Start, File2End, F2P); + + while (1) { + // Scan for the end of file or next difference. + while (F1P < File1End && F2P < File2End && *F1P == *F2P) + ++F1P, ++F2P; + + if (F1P >= File1End || F2P >= File2End) break; + + // Okay, we must have found a difference. Backup to the start of the + // current number each stream is at so that we can compare from the + // beginning. + F1P = BackupNumber(F1P, File1Start); + F2P = BackupNumber(F2P, File2Start); + + // Now that we are at the start of the numbers, compare them, exiting if + // they don't match. + CompareNumbers(F1P, F2P, File1End, File2End); + } + + // Okay, we reached the end of file. If both files are at the end, we + // succeeded. + bool F1AtEnd = F1P >= File1End; + bool F2AtEnd = F2P >= File2End; + if (F1AtEnd & F2AtEnd) return 0; + + // Else, we might have run off the end due to a number: backup and retry. + if (F1AtEnd && isNumberChar(F1P[-1])) --F1P; + if (F2AtEnd && isNumberChar(F2P[-1])) --F2P; F1P = BackupNumber(F1P, File1Start); F2P = BackupNumber(F2P, File2Start); // Now that we are at the start of the numbers, compare them, exiting if // they don't match. CompareNumbers(F1P, F2P, File1End, File2End); - } - // Okay, we reached the end of file. If both files are at the end, we - // succeeded. - bool F1AtEnd = F1P >= File1End; - bool F2AtEnd = F2P >= File2End; - if (F1AtEnd & F2AtEnd) return 0; - - // Otherwise, we might have run off the end due to a number: backup and retry. - if (F1AtEnd && isNumberChar(F1P[-1])) --F1P; - if (F2AtEnd && isNumberChar(F2P[-1])) --F2P; - F1P = BackupNumber(F1P, File1Start); - F2P = BackupNumber(F2P, File2Start); - - // Now that we are at the start of the numbers, compare them, exiting if - // they don't match. - CompareNumbers(F1P, F2P, File1End, File2End); + // If we found the end, we succeeded. + if (F1P >= File1End && F2P >= File2End) return 0; - // If we found the end, we succeeded. - if (F1P >= File1End && F2P >= File2End) return 0; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": error: " << msg << "\n"; + return 2; + } return 1; } From alkis at cs.uiuc.edu Mon Dec 13 11:44:29 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 11:44:29 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412131744.LAA07535@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.261 -> 1.262 --- Log message: Add llvm tool variables. --- Diffs of the changes: (+9 -0) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.261 llvm/Makefile.rules:1.262 --- llvm/Makefile.rules:1.261 Mon Dec 13 01:38:07 2004 +++ llvm/Makefile.rules Mon Dec 13 11:44:14 2004 @@ -214,6 +214,15 @@ ifndef LLVMGXX LLVMGXX := PATH=$(LLVMToolDir):$(PATH) $(LLVMGCCDIR)/bin/g++ endif +ifndef LDIS +LLVMDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT) +endif +ifndef LLI +LLI := $(LLVMToolDir)/lli$(EXEEXT) +endif +ifndef LOPT +LOPT := $(LLVMToolDir)/lopt$(EXEEXT) +endif #-------------------------------------------------------------------- # Adjust to user's request From alkis at cs.uiuc.edu Mon Dec 13 11:45:07 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 11:45:07 -0600 Subject: [llvm-commits] CVS: llvm-java/Makefile.rules Message-ID: <200412131745.LAA07572@zion.cs.uiuc.edu> Changes in directory llvm-java: Makefile.rules updated: 1.16 -> 1.17 --- Log message: Remove llvm tool definitions as these are now provided by the LLVM Makefile.rules. --- Diffs of the changes: (+0 -4) Index: llvm-java/Makefile.rules diff -u llvm-java/Makefile.rules:1.16 llvm-java/Makefile.rules:1.17 --- llvm-java/Makefile.rules:1.16 Thu Dec 2 17:23:56 2004 +++ llvm-java/Makefile.rules Mon Dec 13 11:44:56 2004 @@ -7,10 +7,6 @@ # ##===----------------------------------------------------------------------===## -LDIS := $(LLVMToolDir)/llvm-dis$(EXEEXT) -LLI := $(LLVMToolDir)/lli$(EXEEXT) -LOPT := $(LLVMToolDir)/opt$(EXEEXT) - CLASS2LLVM := $(ToolDir)/class2llvm$(EXEEXT) CLASSDUMP := $(ToolDir)/classdump$(EXEEXT) From alkis at cs.uiuc.edu Mon Dec 13 11:45:50 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 11:45:50 -0600 Subject: [llvm-commits] CVS: llvm-java/Makefile.rules Message-ID: <200412131745.LAA07620@zion.cs.uiuc.edu> Changes in directory llvm-java: Makefile.rules updated: 1.17 -> 1.18 --- Log message: Remove unneeded rule. --- Diffs of the changes: (+0 -5) Index: llvm-java/Makefile.rules diff -u llvm-java/Makefile.rules:1.17 llvm-java/Makefile.rules:1.18 --- llvm-java/Makefile.rules:1.17 Mon Dec 13 11:44:56 2004 +++ llvm-java/Makefile.rules Mon Dec 13 11:45:39 2004 @@ -9,8 +9,3 @@ CLASS2LLVM := $(ToolDir)/class2llvm$(EXEEXT) CLASSDUMP := $(ToolDir)/classdump$(EXEEXT) - -# rule to make bytecode from assembly -%.bc: %.ll - $(Echo) Assembling $< to bytecode - $(Verb)$(LLVMAS) < $< > $@ || rm -f $@ From lattner at cs.uiuc.edu Mon Dec 13 11:53:26 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Dec 2004 11:53:26 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Transforms/SCCP/ipsccp-conditional.ll Message-ID: <200412131753.iBDHrQjb005531@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Transforms/SCCP: ipsccp-conditional.ll updated: 1.1 -> 1.2 --- Log message: Fix this test --- Diffs of the changes: (+1 -1) Index: llvm/test/Regression/Transforms/SCCP/ipsccp-conditional.ll diff -u llvm/test/Regression/Transforms/SCCP/ipsccp-conditional.ll:1.1 llvm/test/Regression/Transforms/SCCP/ipsccp-conditional.ll:1.2 --- llvm/test/Regression/Transforms/SCCP/ipsccp-conditional.ll:1.1 Fri Dec 10 16:28:49 2004 +++ llvm/test/Regression/Transforms/SCCP/ipsccp-conditional.ll Mon Dec 13 11:53:11 2004 @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep -v 'ret int 0' | not grep ret +; RUN: llvm-as < %s | opt -ipsccp | llvm-dis | grep -v 'ret int 0' | grep -v 'ret int undef' | not grep ret implementation From alkis at cs.uiuc.edu Mon Dec 13 12:08:40 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 12:08:40 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412131808.MAA07824@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.262 -> 1.263 --- Log message: Fix typo. --- Diffs of the changes: (+1 -1) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.262 llvm/Makefile.rules:1.263 --- llvm/Makefile.rules:1.262 Mon Dec 13 11:44:14 2004 +++ llvm/Makefile.rules Mon Dec 13 12:08:29 2004 @@ -221,7 +221,7 @@ LLI := $(LLVMToolDir)/lli$(EXEEXT) endif ifndef LOPT -LOPT := $(LLVMToolDir)/lopt$(EXEEXT) +LOPT := $(LLVMToolDir)/opt$(EXEEXT) endif #-------------------------------------------------------------------- From reid at x10sys.com Mon Dec 13 12:25:37 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:25:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Message-ID: <200412131825.MAA07986@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReaderWrappers.cpp updated: 1.38 -> 1.39 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Use sys::MappedFile instead of ReadFileIntoAddressSpace and UnmapFileFromAddressSpace. sys::MappedFile has the nice property that it cleans up after itself so exception handling can be removed. --- Diffs of the changes: (+6 -20) Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.38 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.39 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.38 Fri Dec 10 18:14:15 2004 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Mon Dec 13 12:25:27 2004 @@ -17,9 +17,9 @@ #include "Reader.h" #include "llvm/Module.h" #include "llvm/Instructions.h" -#include "llvm/Support/FileUtilities.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Config/unistd.h" +#include "llvm/System/MappedFile.h" #include using namespace llvm; @@ -32,15 +32,13 @@ /// class BytecodeFileReader : public BytecodeReader { private: - unsigned char *Buffer; - unsigned Length; + sys::MappedFile mapFile; BytecodeFileReader(const BytecodeFileReader&); // Do not implement void operator=(const BytecodeFileReader &BFR); // Do not implement public: BytecodeFileReader(const std::string &Filename, llvm::BytecodeHandler* H=0); - ~BytecodeFileReader(); }; } @@ -51,23 +49,11 @@ BytecodeFileReader::BytecodeFileReader(const std::string &Filename, llvm::BytecodeHandler* H ) : BytecodeReader(H) + , mapFile( sys::Path(Filename)) { - Buffer = (unsigned char*)ReadFileIntoAddressSpace(Filename, Length); - if (Buffer == 0) - throw "Error reading file '" + Filename + "'."; - - try { - // Parse the bytecode we mmapped in - ParseBytecode(Buffer, Length, Filename); - } catch (...) { - UnmapFileFromAddressSpace(Buffer, Length); - throw; - } -} - -BytecodeFileReader::~BytecodeFileReader() { - // Unmmap the bytecode... - UnmapFileFromAddressSpace(Buffer, Length); + mapFile.map(); + unsigned char* buffer = reinterpret_cast(mapFile.base()); + ParseBytecode(buffer, mapFile.size(), Filename); } //===----------------------------------------------------------------------===// From reid at x10sys.com Mon Dec 13 12:29:10 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:29:10 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/FileUtilities.h Message-ID: <200412131829.MAA08049@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: FileUtilities.h updated: 1.22 -> 1.23 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : The ReadFileIntoAddressSpace and UnmapFileFromAddressSpace functions are no longer used by LLVM. Remove them. Replacement functionality for both functions is now encapsulated in the sys::MappedFile class. --- Diffs of the changes: (+0 -11) Index: llvm/include/llvm/Support/FileUtilities.h diff -u llvm/include/llvm/Support/FileUtilities.h:1.22 llvm/include/llvm/Support/FileUtilities.h:1.23 --- llvm/include/llvm/Support/FileUtilities.h:1.22 Mon Dec 13 11:01:53 2004 +++ llvm/include/llvm/Support/FileUtilities.h Mon Dec 13 12:28:59 2004 @@ -61,17 +61,6 @@ /// bool MakeFileReadable(const std::string &Filename); -/// ReadFileIntoAddressSpace - Attempt to map the specific file into the -/// address space of the current process for reading. If this succeeds, -/// return the address of the buffer and the length of the file mapped. On -/// failure, return null. -void *ReadFileIntoAddressSpace(const std::string &Filename, unsigned &Length); - -/// UnmapFileFromAddressSpace - Remove the specified file from the current -/// address space. -void UnmapFileFromAddressSpace(void *Buffer, unsigned Length); - - /// FDHandle - Simple handle class to make sure a file descriptor gets closed /// when the object is destroyed. This handle acts similarly to an /// std::auto_ptr, in that the copy constructor and assignment operators From reid at x10sys.com Mon Dec 13 12:29:09 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:29:09 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200412131829.MAA08046@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.29 -> 1.30 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : The ReadFileIntoAddressSpace and UnmapFileFromAddressSpace functions are no longer used by LLVM. Remove them. Replacement functionality for both functions is now encapsulated in the sys::MappedFile class. --- Diffs of the changes: (+0 -46) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.29 llvm/lib/Support/FileUtilities.cpp:1.30 --- llvm/lib/Support/FileUtilities.cpp:1.29 Mon Dec 13 11:01:53 2004 +++ llvm/lib/Support/FileUtilities.cpp Mon Dec 13 12:28:59 2004 @@ -196,52 +196,6 @@ return AddPermissionsBits(Filename, 0444); } -/// ReadFileIntoAddressSpace - Attempt to map the specific file into the -/// address space of the current process for reading. If this succeeds, -/// return the address of the buffer and the length of the file mapped. On -/// failure, return null. -void *llvm::ReadFileIntoAddressSpace(const std::string &Filename, - unsigned &Length) { -#if defined(HAVE_MMAP_FILE) && !defined(_MSC_VER) - sys::Path File(Filename); - Length = (unsigned)File.getSize(); - if ((int)Length == -1) return 0; - - FDHandle FD(open(Filename.c_str(), O_RDONLY)); - if (FD == -1) return 0; - - // If the file has a length of zero, mmap might return a null pointer. In - // this case, allocate a single byte of memory and return it instead. - if (Length == 0) - return malloc(1); - - // mmap in the file all at once... - void *Buffer = (void*)mmap(0, Length, PROT_READ, MAP_PRIVATE, FD, 0); - - if (Buffer == (void*)MAP_FAILED) - return 0; - - return Buffer; -#else - // FIXME: implement with read/write -#error Unimplemented ReadFileIntoAddressSpace - need to use read/write. - return 0; -#endif -} - -/// UnmapFileFromAddressSpace - Remove the specified file from the current -/// address space. -void llvm::UnmapFileFromAddressSpace(void *Buffer, unsigned Length) { -#if defined(HAVE_MMAP_FILE) && !defined(_MSC_VER) - if (Length) - munmap((char*)Buffer, Length); - else - free(Buffer); // Zero byte files are malloc(1)'s. -#else - free(Buffer); -#endif -} - //===----------------------------------------------------------------------===// // FDHandle class implementation // From reid at x10sys.com Mon Dec 13 12:41:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:41:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/FreeBSD/Path.cpp Message-ID: <200412131841.MAA08279@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/FreeBSD: Path.cpp updated: 1.4 -> 1.5 --- Log message: Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT available. --- Diffs of the changes: (+0 -5) Index: llvm/lib/System/FreeBSD/Path.cpp diff -u llvm/lib/System/FreeBSD/Path.cpp:1.4 llvm/lib/System/FreeBSD/Path.cpp:1.5 --- llvm/lib/System/FreeBSD/Path.cpp:1.4 Mon Nov 8 02:27:51 2004 +++ llvm/lib/System/FreeBSD/Path.cpp Mon Dec 13 12:41:28 2004 @@ -45,11 +45,6 @@ return result; } -std::string -Path::GetDLLSuffix() { - return "so"; -} - } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Mon Dec 13 12:41:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:41:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/AIX/Path.cpp Message-ID: <200412131841.MAA08281@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/AIX: Path.cpp updated: 1.6 -> 1.7 --- Log message: Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT available. --- Diffs of the changes: (+0 -5) Index: llvm/lib/System/AIX/Path.cpp diff -u llvm/lib/System/AIX/Path.cpp:1.6 llvm/lib/System/AIX/Path.cpp:1.7 --- llvm/lib/System/AIX/Path.cpp:1.6 Fri Nov 5 16:15:35 2004 +++ llvm/lib/System/AIX/Path.cpp Mon Dec 13 12:41:28 2004 @@ -48,11 +48,6 @@ return result; } -std::string -Path::GetDLLSuffix() { - return "so"; -} - } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Mon Dec 13 12:41:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:41:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Darwin/Path.cpp Message-ID: <200412131841.MAA08278@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Darwin: Path.cpp updated: 1.5 -> 1.6 --- Log message: Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT available. --- Diffs of the changes: (+0 -5) Index: llvm/lib/System/Darwin/Path.cpp diff -u llvm/lib/System/Darwin/Path.cpp:1.5 llvm/lib/System/Darwin/Path.cpp:1.6 --- llvm/lib/System/Darwin/Path.cpp:1.5 Fri Nov 5 16:15:35 2004 +++ llvm/lib/System/Darwin/Path.cpp Mon Dec 13 12:41:28 2004 @@ -43,11 +43,6 @@ return result; } -std::string -Path::GetDLLSuffix() { - return "dylib"; -} - } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Mon Dec 13 12:41:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:41:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/SunOS/Path.cpp Message-ID: <200412131841.MAA08272@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/SunOS: Path.cpp updated: 1.5 -> 1.6 --- Log message: Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT available. --- Diffs of the changes: (+0 -5) Index: llvm/lib/System/SunOS/Path.cpp diff -u llvm/lib/System/SunOS/Path.cpp:1.5 llvm/lib/System/SunOS/Path.cpp:1.6 --- llvm/lib/System/SunOS/Path.cpp:1.5 Sat Dec 11 11:37:01 2004 +++ llvm/lib/System/SunOS/Path.cpp Mon Dec 13 12:41:28 2004 @@ -47,11 +47,6 @@ return result; } -std::string -Path::GetDLLSuffix() { - return "so"; -} - } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Mon Dec 13 12:41:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:41:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/Path.cpp Message-ID: <200412131841.MAA08286@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: Path.cpp updated: 1.5 -> 1.6 --- Log message: Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT available. --- Diffs of the changes: (+0 -5) Index: llvm/lib/System/Linux/Path.cpp diff -u llvm/lib/System/Linux/Path.cpp:1.5 llvm/lib/System/Linux/Path.cpp:1.6 --- llvm/lib/System/Linux/Path.cpp:1.5 Fri Nov 5 16:15:35 2004 +++ llvm/lib/System/Linux/Path.cpp Mon Dec 13 12:41:28 2004 @@ -45,11 +45,6 @@ return result; } -std::string -Path::GetDLLSuffix() { - return "so"; -} - } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Mon Dec 13 12:41:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:41:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Interix/Path.cpp Message-ID: <200412131841.MAA08275@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Interix: Path.cpp updated: 1.3 -> 1.4 --- Log message: Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT available. --- Diffs of the changes: (+0 -5) Index: llvm/lib/System/Interix/Path.cpp diff -u llvm/lib/System/Interix/Path.cpp:1.3 llvm/lib/System/Interix/Path.cpp:1.4 --- llvm/lib/System/Interix/Path.cpp:1.3 Fri Nov 5 16:15:35 2004 +++ llvm/lib/System/Interix/Path.cpp Mon Dec 13 12:41:28 2004 @@ -45,11 +45,6 @@ return result; } -std::string -Path::GetDLLSuffix() { - return "dll"; -} - } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Mon Dec 13 12:41:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:41:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Cygwin/Path.cpp Message-ID: <200412131841.MAA08296@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Cygwin: Path.cpp updated: 1.5 -> 1.6 --- Log message: Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT available. --- Diffs of the changes: (+0 -5) Index: llvm/lib/System/Cygwin/Path.cpp diff -u llvm/lib/System/Cygwin/Path.cpp:1.5 llvm/lib/System/Cygwin/Path.cpp:1.6 --- llvm/lib/System/Cygwin/Path.cpp:1.5 Sat Dec 11 11:37:01 2004 +++ llvm/lib/System/Cygwin/Path.cpp Mon Dec 13 12:41:28 2004 @@ -47,11 +47,6 @@ return result; } -std::string -Path::GetDLLSuffix() { - return "dll.a"; -} - } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Mon Dec 13 12:41:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:41:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Path.cpp Message-ID: <200412131841.MAA08287@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Path.cpp updated: 1.10 -> 1.11 --- Log message: Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT available. --- Diffs of the changes: (+6 -0) Index: llvm/lib/System/Path.cpp diff -u llvm/lib/System/Path.cpp:1.10 llvm/lib/System/Path.cpp:1.11 --- llvm/lib/System/Path.cpp:1.10 Sun Dec 12 21:00:39 2004 +++ llvm/lib/System/Path.cpp Mon Dec 13 12:41:28 2004 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/System/Path.h" +#include "llvm/Config/config.h" #include namespace llvm { @@ -80,6 +81,11 @@ return sys::Path(); } +std::string +Path::GetDLLSuffix() { + return LTDL_SHLIB_EXT; +} + } // Include the truly platform-specific parts of this class. From reid at x10sys.com Mon Dec 13 12:41:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 12:41:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412131841.MAA08280@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.11 -> 1.12 --- Log message: Genericize implementation of GetDLLSuffix now that we have LTDL_SHLIB_EXT available. --- Diffs of the changes: (+0 -5) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.11 llvm/lib/System/Win32/Path.cpp:1.12 --- llvm/lib/System/Win32/Path.cpp:1.11 Mon Dec 13 01:51:52 2004 +++ llvm/lib/System/Win32/Path.cpp Mon Dec 13 12:41:28 2004 @@ -118,11 +118,6 @@ return result; } -std::string -Path::GetDLLSuffix() { - return "dll"; -} - static void getPathList(const char*path, std::vector& Paths) { const char* at = path; const char* delim = strchr(at, ';'); From lattner at cs.uiuc.edu Mon Dec 13 13:10:48 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Dec 2004 13:10:48 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/SparcV9/2004-12-13-MallocCrash.ll Message-ID: <200412131910.iBDJAmDn006550@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/CodeGen/SparcV9: 2004-12-13-MallocCrash.ll added (r1.1) --- Log message: New testcase that crashes the V9 backend. --- Diffs of the changes: (+6 -0) Index: llvm/test/Regression/CodeGen/SparcV9/2004-12-13-MallocCrash.ll diff -c /dev/null llvm/test/Regression/CodeGen/SparcV9/2004-12-13-MallocCrash.ll:1.1 *** /dev/null Mon Dec 13 13:10:43 2004 --- llvm/test/Regression/CodeGen/SparcV9/2004-12-13-MallocCrash.ll Mon Dec 13 13:10:32 2004 *************** *** 0 **** --- 1,6 ---- + ; RUN: llvm-as < %s | llc -march=sparcv9 + + void %main() { + %tmp.0.i2.i = malloc [24 x sbyte] + ret void + } From lattner at cs.uiuc.edu Mon Dec 13 13:49:02 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Dec 2004 13:49:02 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Constants.h Message-ID: <200412131949.iBDJn2XD012566@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm: Constants.h updated: 1.65 -> 1.66 --- Log message: Change this method to return ulong, not uint, for 64-bit targets. --- Diffs of the changes: (+1 -1) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.65 llvm/include/llvm/Constants.h:1.66 --- llvm/include/llvm/Constants.h:1.65 Tue Dec 7 21:45:20 2004 +++ llvm/include/llvm/Constants.h Mon Dec 13 13:48:47 2004 @@ -558,7 +558,7 @@ } /// getSizeOf constant expr - computes the size of a type in a target - /// independent way (Note: the return type is UInt but the object is not + /// independent way (Note: the return type is ULong but the object is not /// necessarily a ConstantUInt). /// static Constant *getSizeOf(const Type *Ty); From lattner at cs.uiuc.edu Mon Dec 13 13:49:05 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Dec 2004 13:49:05 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Message-ID: <200412131949.iBDJn5xW012632@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.117 -> 1.118 --- Log message: Change this method to return ulong, not uint, for 64-bit targets. --- Diffs of the changes: (+4 -5) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.117 llvm/lib/VMCore/Constants.cpp:1.118 --- llvm/lib/VMCore/Constants.cpp:1.117 Tue Dec 7 01:38:08 2004 +++ llvm/lib/VMCore/Constants.cpp Mon Dec 13 13:48:51 2004 @@ -1255,12 +1255,11 @@ } Constant *ConstantExpr::getSizeOf(const Type *Ty) { - // sizeof is implemented as: (unsigned) gep (Ty*)null, 1 + // sizeof is implemented as: (ulong) gep (Ty*)null, 1 return getCast( - getGetElementPtr( - getNullValue(PointerType::get(Ty)), - std::vector(1, ConstantInt::get(Type::UIntTy, 1))), - Type::UIntTy); + getGetElementPtr(getNullValue(PointerType::get(Ty)), + std::vector(1, ConstantInt::get(Type::UIntTy, 1))), + Type::ULongTy); } Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode, From reid at x10sys.com Mon Dec 13 14:00:01 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 14:00:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200412132000.OAA10203@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.20 -> 1.21 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Implement three new functions to allow setting access/permission bits on the file referenced by a path. The makeReadable and makeExecutable methods replace the FileUtilities MakeFileReadable and MakeFileExecutable functions. The makeWritable function is new and provided for consistency since Path has a writable() method. --- Diffs of the changes: (+36 -0) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.20 llvm/lib/System/Unix/Path.cpp:1.21 --- llvm/lib/System/Unix/Path.cpp:1.20 Mon Dec 13 01:51:07 2004 +++ llvm/lib/System/Unix/Path.cpp Mon Dec 13 13:59:50 2004 @@ -256,6 +256,42 @@ path += '/'; } +static bool AddPermissionBits(const std::string& Filename, int bits) { + // Get the umask value from the operating system. We want to use it + // when changing the file's permissions. Since calling umask() sets + // the umask and returns its old value, we must call it a second + // time to reset it to the user's preference. + int mask = umask(0777); // The arg. to umask is arbitrary. + umask(mask); // Restore the umask. + + // Get the file's current mode. + struct stat st; + if ((stat(Filename.c_str(), &st)) == -1) + return false; + + // Change the file to have whichever permissions bits from 'bits' + // that the umask would not disable. + if ((chmod(Filename.c_str(), (st.st_mode | (bits & ~mask)))) == -1) + return false; + + return true; +} + +void Path::makeReadable() { + if (!AddPermissionBits(path,0444)) + ThrowErrno(path + ": can't make file readable"); +} + +void Path::makeWriteable() { + if (!AddPermissionBits(path,0222)) + ThrowErrno(path + ": can't make file writable"); +} + +void Path::makeExecutable() { + if (!AddPermissionBits(path,0111)) + ThrowErrno(path + ": can't make file executable"); +} + bool Path::getDirectoryContents(std::set& result) const { if (!isDirectory()) From lattner at cs.uiuc.edu Mon Dec 13 14:00:17 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Dec 2004 14:00:17 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LowerAllocations.cpp Message-ID: <200412132000.iBDK0H7S021934@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LowerAllocations.cpp updated: 1.50 -> 1.51 --- Log message: Get rid of getSizeOf, using ConstantExpr::getSizeOf instead. do not insert a prototype for malloc of: void* malloc(uint): on 64-bit u targets this is not correct. Instead of prototype it as void *malloc(...), and pass the correct intptr_t through the "...". Finally, fix Regression/CodeGen/SparcV9/2004-12-13-MallocCrash.ll, by not forming constantexpr casts from pointer to uint. --- Diffs of the changes: (+33 -20) Index: llvm/lib/Transforms/Scalar/LowerAllocations.cpp diff -u llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.50 llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.51 --- llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.50 Tue Dec 7 02:11:36 2004 +++ llvm/lib/Transforms/Scalar/LowerAllocations.cpp Mon Dec 13 14:00:02 2004 @@ -19,6 +19,7 @@ #include "llvm/Constants.h" #include "llvm/Pass.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Target/TargetData.h" using namespace llvm; namespace { @@ -33,13 +34,19 @@ public: LowerAllocations() : MallocFunc(0), FreeFunc(0) {} + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired(); + AU.setPreservesCFG(); + } + /// doPassInitialization - For the lower allocations pass, this ensures that /// a module contains a declaration for a malloc and a free function. /// bool doInitialization(Module &M); - virtual bool doInitialization(Function&f) - { return BasicBlockPass::doInitialization(f); } + virtual bool doInitialization(Function &F) { + return BasicBlockPass::doInitialization(F); + } /// runOnBasicBlock - This method does the actual work of converting /// instructions over, assuming that the pass has already been initialized. @@ -67,22 +74,18 @@ MallocFunc = M.getNamedFunction("malloc"); FreeFunc = M.getNamedFunction("free"); - if (MallocFunc == 0) - MallocFunc = M.getOrInsertFunction("malloc", SBPTy, Type::UIntTy, 0); + if (MallocFunc == 0) { + // Prototype malloc as "void* malloc(...)", because we don't know in + // doInitialization whether size_t is int or long. + FunctionType *FT = FunctionType::get(SBPTy,std::vector(),true); + MallocFunc = M.getOrInsertFunction("malloc", FT); + } if (FreeFunc == 0) - FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, SBPTy, 0); + FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, SBPTy, 0); return true; } -static Constant *getSizeof(const Type *Ty) { - Constant *Ret = ConstantPointerNull::get(PointerType::get(Ty)); - std::vector Idx; - Idx.push_back(ConstantUInt::get(Type::UIntTy, 1)); - Ret = ConstantExpr::getGetElementPtr(Ret, Idx); - return ConstantExpr::getCast(Ret, Type::UIntTy); -} - // runOnBasicBlock - This method does the actual work of converting // instructions over, assuming that the pass has already been initialized. // @@ -92,23 +95,30 @@ BasicBlock::InstListType &BBIL = BB.getInstList(); + const Type *IntPtrTy = getAnalysis().getIntPtrType(); + // Loop over all of the instructions, looking for malloc or free instructions for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) { if (MallocInst *MI = dyn_cast(I)) { const Type *AllocTy = MI->getType()->getElementType(); // malloc(type) becomes sbyte *malloc(size) - Value *MallocArg = getSizeof(AllocTy); + Value *MallocArg = ConstantExpr::getCast(ConstantExpr::getSizeOf(AllocTy), + IntPtrTy); if (MI->isArrayAllocation()) { - if (isa(MallocArg) && - cast(MallocArg)->getValue() == 1) { + if (isa(MallocArg) && + cast(MallocArg)->getRawValue() == 1) { MallocArg = MI->getOperand(0); // Operand * 1 = Operand } else if (Constant *CO = dyn_cast(MI->getOperand(0))) { + CO = ConstantExpr::getCast(CO, IntPtrTy); MallocArg = ConstantExpr::getMul(CO, cast(MallocArg)); } else { + Value *Scale = MI->getOperand(0); + if (Scale->getType() != IntPtrTy) + Scale = new CastInst(Scale, IntPtrTy, "", I); + // Multiply it by the array size if necessary... - MallocArg = BinaryOperator::create(Instruction::Mul, - MI->getOperand(0), + MallocArg = BinaryOperator::create(Instruction::Mul, Scale, MallocArg, "", I); } } @@ -117,8 +127,11 @@ std::vector MallocArgs; if (MallocFTy->getNumParams() > 0 || MallocFTy->isVarArg()) { - if (MallocFTy->getNumParams() > 0 && - MallocFTy->getParamType(0) != Type::UIntTy) + if (MallocFTy->isVarArg()) { + if (MallocArg->getType() != IntPtrTy) + MallocArg = new CastInst(MallocArg, IntPtrTy, "", I); + } else if (MallocFTy->getNumParams() > 0 && + MallocFTy->getParamType(0) != Type::UIntTy) MallocArg = new CastInst(MallocArg, MallocFTy->getParamType(0), "",I); MallocArgs.push_back(MallocArg); } From reid at x10sys.com Mon Dec 13 14:00:01 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 14:00:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412132000.OAA10216@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.12 -> 1.13 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Implement three new functions to allow setting access/permission bits on the file referenced by a path. The makeReadable and makeExecutable methods replace the FileUtilities MakeFileReadable and MakeFileExecutable functions. The makeWritable function is new and provided for consistency since Path has a writable() method. --- Diffs of the changes: (+9 -0) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.12 llvm/lib/System/Win32/Path.cpp:1.13 --- llvm/lib/System/Win32/Path.cpp:1.12 Mon Dec 13 12:41:28 2004 +++ llvm/lib/System/Win32/Path.cpp Mon Dec 13 13:59:50 2004 @@ -287,6 +287,15 @@ return path.substr(pos+1); } +void Path::makeReadable() { +} + +void Path::makeWriteable() { +} + +void Path::makeExecutable() { +} + bool Path::setDirectory(const std::string& a_path) { if (a_path.size() == 0) From reid at x10sys.com Mon Dec 13 14:00:01 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 14:00:01 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200412132000.OAA10213@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.15 -> 1.16 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Implement three new functions to allow setting access/permission bits on the file referenced by a path. The makeReadable and makeExecutable methods replace the FileUtilities MakeFileReadable and MakeFileExecutable functions. The makeWritable function is new and provided for consistency since Path has a writable() method. --- Diffs of the changes: (+16 -0) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.15 llvm/include/llvm/System/Path.h:1.16 --- llvm/include/llvm/System/Path.h:1.15 Mon Dec 13 11:01:53 2004 +++ llvm/include/llvm/System/Path.h Mon Dec 13 13:59:50 2004 @@ -391,6 +391,22 @@ StatusInfo info; getStatusInfo(info); return info.fileSize; } + /// This method attempts to make the file referenced by the Path object + /// available for reading so that the readable() method will return true. + /// @brief Make the file readable; + void makeReadable(); + + /// This method attempts to make the file referenced by the Path object + /// available for writing so that the writable() method will return true. + /// @brief Make the file writable; + void makeWriteable(); + + /// This method attempts to make the file referenced by the Path object + /// available for execution so that the executable() method will return + /// true. + /// @brief Make the file readable; + void makeExecutable(); + /// This method attempts to set the Path object to \p unverified_path /// and interpret the name as a directory name. The \p unverified_path /// is verified. If verification succeeds then \p unverified_path From reid at x10sys.com Mon Dec 13 14:03:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 14:03:13 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200412132003.OAA10303@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.87 -> 1.88 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Replace MakeFileReadable and MakeFileExecutable (from FileUtilities) with sys::Path::makeReadable and sys::Path:makeExecutable, respectively. --- Diffs of the changes: (+3 -3) Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.87 llvm/tools/gccld/gccld.cpp:1.88 --- llvm/tools/gccld/gccld.cpp:1.87 Mon Dec 13 11:18:19 2004 +++ llvm/tools/gccld/gccld.cpp Mon Dec 13 14:03:02 2004 @@ -329,11 +329,11 @@ } // Make the script executable... - MakeFileExecutable(OutputFilename); + sys::Path(OutputFilename).makeExecutable(); // Make the bytecode file readable and directly executable in LLEE as well - MakeFileExecutable(RealBytecodeOutput); - MakeFileReadable(RealBytecodeOutput); + sys::Path(RealBytecodeOutput).makeExecutable(); + sys::Path(RealBytecodeOutput).makeReadable(); } } catch (const char*msg) { std::cerr << argv[0] << ": " << msg << "\n"; From reid at x10sys.com Mon Dec 13 14:03:13 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 14:03:13 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200412132003.OAA10306@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.9 -> 1.10 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Replace MakeFileReadable and MakeFileExecutable (from FileUtilities) with sys::Path::makeReadable and sys::Path:makeExecutable, respectively. --- Diffs of the changes: (+3 -3) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.9 llvm/tools/llvm-ld/llvm-ld.cpp:1.10 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.9 Mon Dec 13 11:18:19 2004 +++ llvm/tools/llvm-ld/llvm-ld.cpp Mon Dec 13 14:03:02 2004 @@ -527,11 +527,11 @@ } // Make the script executable... - MakeFileExecutable(OutputFilename); + sys::Path(OutputFilename).makeExecutable(); // Make the bytecode file readable and directly executable in LLEE as well - MakeFileExecutable(RealBytecodeOutput); - MakeFileReadable(RealBytecodeOutput); + sys::Path(RealBytecodeOutput).makeExecutable(); + sys::Path(RealBytecodeOutput).makeReadable(); } return 0; From reid at x10sys.com Mon Dec 13 14:08:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 14:08:24 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/FileUtilities.h Message-ID: <200412132008.OAA10417@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: FileUtilities.h updated: 1.23 -> 1.24 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Remove the MakeFileReadable and MakeFileExecutable functions which are no longer present in LLVM. They have been replaced with the sys::Path methods makeReadable and makeExecutable, respectively. --- Diffs of the changes: (+0 -12) Index: llvm/include/llvm/Support/FileUtilities.h diff -u llvm/include/llvm/Support/FileUtilities.h:1.23 llvm/include/llvm/Support/FileUtilities.h:1.24 --- llvm/include/llvm/Support/FileUtilities.h:1.23 Mon Dec 13 12:28:59 2004 +++ llvm/include/llvm/Support/FileUtilities.h Mon Dec 13 14:08:14 2004 @@ -49,18 +49,6 @@ /// std::string getUniqueFilename(const std::string &FilenameBase); -/// MakeFileExecutable - This method turns on whatever access attributes are -/// needed to make the specified file executable. It returns true on success. -/// In case of failure, the file's access attributes are unspecified. -/// -bool MakeFileExecutable(const std::string &Filename); - -/// MakeFileReadable - This method turns on whatever access attributes are -/// needed to make the specified file readable. It returns true on success. -/// In case of failure, the file's access attributes are unspecified. -/// -bool MakeFileReadable(const std::string &Filename); - /// FDHandle - Simple handle class to make sure a file descriptor gets closed /// when the object is destroyed. This handle acts similarly to an /// std::auto_ptr, in that the copy constructor and assignment operators From reid at x10sys.com Mon Dec 13 14:08:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 14:08:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200412132008.OAA10420@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.30 -> 1.31 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Remove the MakeFileReadable and MakeFileExecutable functions which are no longer present in LLVM. They have been replaced with the sys::Path methods makeReadable and makeExecutable, respectively. --- Diffs of the changes: (+0 -39) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.30 llvm/lib/Support/FileUtilities.cpp:1.31 --- llvm/lib/Support/FileUtilities.cpp:1.30 Mon Dec 13 12:28:59 2004 +++ llvm/lib/Support/FileUtilities.cpp Mon Dec 13 14:08:14 2004 @@ -157,45 +157,6 @@ return Result; } -static bool AddPermissionsBits (const std::string &Filename, int bits) { - // Get the umask value from the operating system. We want to use it - // when changing the file's permissions. Since calling umask() sets - // the umask and returns its old value, we must call it a second - // time to reset it to the user's preference. - int mask = umask(0777); // The arg. to umask is arbitrary. - umask(mask); // Restore the umask. - - // Get the file's current mode. - struct stat st; - if ((stat(Filename.c_str(), &st)) == -1) - return false; - - // Change the file to have whichever permissions bits from 'bits' - // that the umask would not disable. - if ((chmod(Filename.c_str(), (st.st_mode | (bits & ~mask)))) == -1) - return false; - - return true; -} - -/// MakeFileExecutable - Make the file named Filename executable by -/// setting whichever execute permissions bits the process's current -/// umask would allow. Filename must name an existing file or -/// directory. Returns true on success, false on error. -/// -bool llvm::MakeFileExecutable(const std::string &Filename) { - return AddPermissionsBits(Filename, 0111); -} - -/// MakeFileReadable - Make the file named Filename readable by -/// setting whichever read permissions bits the process's current -/// umask would allow. Filename must name an existing file or -/// directory. Returns true on success, false on error. -/// -bool llvm::MakeFileReadable(const std::string &Filename) { - return AddPermissionsBits(Filename, 0444); -} - //===----------------------------------------------------------------------===// // FDHandle class implementation // From lattner at cs.uiuc.edu Mon Dec 13 14:13:25 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Dec 2004 14:13:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV8/README.txt Message-ID: <200412132013.iBDKDPPs021995@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV8: README.txt updated: 1.33 -> 1.34 --- Log message: Add some notes --- Diffs of the changes: (+22 -2) Index: llvm/lib/Target/SparcV8/README.txt diff -u llvm/lib/Target/SparcV8/README.txt:1.33 llvm/lib/Target/SparcV8/README.txt:1.34 --- llvm/lib/Target/SparcV8/README.txt:1.33 Sun Dec 12 18:27:35 2004 +++ llvm/lib/Target/SparcV8/README.txt Mon Dec 13 14:13:10 2004 @@ -53,7 +53,27 @@ * support shl on longs (fourinarow needs this) * support casting 64-bit integers to FP types (fhourstones needs this) -* support FP rem +* support FP rem (call fmod) -$Date: 2004/12/13 00:27:35 $ +* Eliminate srl/sll by zero bits like this: + sll %l0, 0, %l0 + srl %l0, 0, %o0 + + We think these are only used by V9 to clear off the top 32 bits of a reg, + so they are not needed. + +* Keep the address of the constant pool in a register instead of forming its + address all of the time. + +* Change code like this: + or %o0, %lo(.CPI_main_0), %o0 + ld [%o0+0], %o0 + into: + ld [%o0+%lo(.CPI_main_0)], %o0 + for constant pool access. + +* We can fold small constant offsets into the %hi/%lo references to constant + pool addresses as well. + +$Date: 2004/12/13 20:13:10 $ From reid at x10sys.com Mon Dec 13 14:14:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 14:14:41 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/SystemUtils.cpp Message-ID: <200412132014.OAA10552@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SystemUtils.cpp updated: 1.34 -> 1.35 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Remove AllocateRWXMemory as it is not used any more in LLVM. The function has been replaced with sys::Memory::AllocateRWX several months ago. --- Diffs of the changes: (+0 -61) Index: llvm/lib/Support/SystemUtils.cpp diff -u llvm/lib/Support/SystemUtils.cpp:1.34 llvm/lib/Support/SystemUtils.cpp:1.35 --- llvm/lib/Support/SystemUtils.cpp:1.34 Wed Sep 1 17:55:35 2004 +++ llvm/lib/Support/SystemUtils.cpp Mon Dec 13 14:14:29 2004 @@ -286,64 +286,3 @@ // Otherwise, return failure. return 1; } - -/// 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. -/// -void *llvm::AllocateRWXMemory(unsigned NumBytes) { - if (NumBytes == 0) return 0; - -#if defined(HAVE_WINDOWS_H) - // On windows we use VirtualAlloc. - void *P = VirtualAlloc(0, NumBytes, MEM_COMMIT, PAGE_EXECUTE_READWRITE); - if (P == 0) { - std::cerr << "Error allocating executable memory!\n"; - abort(); - } - return P; - -#elif defined(HAVE_MMAP) - static const long pageSize = GetPageSize(); - unsigned NumPages = (NumBytes+pageSize-1)/pageSize; - -/* FIXME: This should use the proper autoconf flags */ -#if defined(i386) || defined(__i386__) || defined(__x86__) - /* Linux and *BSD tend to have these flags named differently. */ -#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS) -# define MAP_ANONYMOUS MAP_ANON -#endif /* defined(MAP_ANON) && !defined(MAP_ANONYMOUS) */ -#elif defined(sparc) || defined(__sparc__) || defined(__sparcv9) -/* nothing */ -#else - std::cerr << "This architecture has an unknown MMAP implementation!\n"; - abort(); - return 0; -#endif - - int fd = -1; -#if defined(__linux__) - fd = 0; -#endif - - unsigned mmapFlags = MAP_PRIVATE|MAP_ANONYMOUS; -#ifdef MAP_NORESERVE - mmapFlags |= MAP_NORESERVE; -#endif - - void *pa = mmap(0, pageSize*NumPages, PROT_READ|PROT_WRITE|PROT_EXEC, - mmapFlags, fd, 0); - if (pa == MAP_FAILED) { - perror("mmap"); - abort(); - } - return pa; -#else - std::cerr << "Do not know how to allocate mem for the JIT without mmap!\n"; - abort(); - return 0; -#endif -} - - From reid at x10sys.com Mon Dec 13 14:14:41 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 14:14:41 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/SystemUtils.h Message-ID: <200412132014.OAA10553@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: SystemUtils.h updated: 1.13 -> 1.14 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Remove AllocateRWXMemory as it is not used any more in LLVM. The function has been replaced with sys::Memory::AllocateRWX several months ago. --- Diffs of the changes: (+0 -7) Index: llvm/include/llvm/Support/SystemUtils.h diff -u llvm/include/llvm/Support/SystemUtils.h:1.13 llvm/include/llvm/Support/SystemUtils.h:1.14 --- llvm/include/llvm/Support/SystemUtils.h:1.13 Wed Sep 1 17:55:35 2004 +++ llvm/include/llvm/Support/SystemUtils.h Mon Dec 13 14:14:30 2004 @@ -53,13 +53,6 @@ /// int ExecWait (const char * const argv[], const char * const envp[]); -/// 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. -/// -void *AllocateRWXMemory(unsigned NumBytes); - } // End llvm namespace #endif From gaeke at cs.uiuc.edu Mon Dec 13 15:28:49 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Mon, 13 Dec 2004 15:28:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp Message-ID: <200412132128.PAA12235@zion.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths: CombineBranch.cpp updated: 1.12 -> 1.13 --- Log message: Fix link error in PPC optimized build of 'opt'. --- Diffs of the changes: (+1 -0) Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp:1.12 llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp:1.13 --- llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp:1.12 Thu Sep 30 15:14:29 2004 +++ llvm/lib/Transforms/Instrumentation/ProfilePaths/CombineBranch.cpp Mon Dec 13 15:28:39 2004 @@ -17,6 +17,7 @@ #include "llvm/Instructions.h" #include "llvm/Function.h" #include "llvm/Pass.h" +#include "llvm/Type.h" namespace llvm { From brukman at cs.uiuc.edu Mon Dec 13 15:42:27 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Mon, 13 Dec 2004 15:42:27 -0600 Subject: [llvm-commits] CVS: llvm/tools/llee/README.txt Message-ID: <200412132142.PAA12622@zion.cs.uiuc.edu> Changes in directory llvm/tools/llee: README.txt updated: 1.1 -> 1.2 --- Log message: Minor cleanups --- Diffs of the changes: (+2 -2) Index: llvm/tools/llee/README.txt diff -u llvm/tools/llee/README.txt:1.1 llvm/tools/llee/README.txt:1.2 --- llvm/tools/llee/README.txt:1.1 Fri Aug 15 18:31:16 2003 +++ llvm/tools/llee/README.txt Mon Dec 13 15:42:16 2004 @@ -1,12 +1,12 @@ LLEE: (LL)VM (E)xecution (E)nvironment This tool presents a virtual execution environment for LLVM programs. By -preloading a shared object which defines a custom execve() functions, we can +preloading a shared object which defines a custom execve() function, we can execute bytecode files with the JIT directly, without the user ever thinking about it. Thus, a user can freely run any program, native or LLVM bytecode, transparently, and without even being aware of it. -To use LLEE, run `./llee ', a good choice is a shell. Anything +To use LLEE, run `llee '; a good choice is a shell. Anything started within that program will be affected by the execve() replacement. From lattner at cs.uiuc.edu Mon Dec 13 15:53:06 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon, 13 Dec 2004 15:53:06 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200412132153.iBDLr663023609@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.214 -> 1.215 --- Log message: When generating code for X86 targets, make sure the fp control word is set to 64-bit precision, not 80 bits. --- Diffs of the changes: (+13 -0) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.214 llvm/lib/Target/CBackend/Writer.cpp:1.215 --- llvm/lib/Target/CBackend/Writer.cpp:1.214 Thu Dec 9 23:44:45 2004 +++ llvm/lib/Target/CBackend/Writer.cpp Mon Dec 13 15:52:52 2004 @@ -214,6 +214,7 @@ unsigned Indent); void printIndexingExpression(Value *Ptr, gep_type_iterator I, gep_type_iterator E); + void printCodeForMain(); }; } @@ -1127,6 +1128,9 @@ Out << "\n"; + if (F.hasExternalLinkage() && F.getName() == "main") + printCodeForMain(); + // print the basic blocks for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { if (Loop *L = LI->getLoopFor(BB)) { @@ -1140,6 +1144,15 @@ Out << "}\n\n"; } +void CWriter::printCodeForMain() { + // On X86, set the FP control word to 64-bits of precision instead of 80 bits. + Out << "#if defined(__GNUC__) && !defined(__llvm__)\n" + << "#if defined(i386) || defined(__i386__) || defined(__i386)\n" + << "{short FPCW;__asm__ (\"fnstcw %0\" : \"=m\" (*&FPCW));\n" + << "FPCW=(FPCW&~0x300)|0x200;__asm__(\"fldcw %0\" :: \"m\" (*&FPCW));}\n" + << "#endif\n#endif\n"; +} + void CWriter::printLoop(Loop *L) { Out << " do { /* Syntactic loop '" << L->getHeader()->getName() << "' to make GCC happy */\n"; From reid at x10sys.com Mon Dec 13 17:15:42 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 17:15:42 -0600 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200412132315.RAA15034@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.35 -> 1.36 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : llee was a nice hack, but it wasn't portable so its gone, with Misha's approval. Operating systems have facilities available for making bytecode directly executable without this utility. --- Diffs of the changes: (+1 -1) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.35 llvm/tools/Makefile:1.36 --- llvm/tools/Makefile:1.35 Sun Nov 14 16:13:59 2004 +++ llvm/tools/Makefile Mon Dec 13 17:15:32 2004 @@ -10,7 +10,7 @@ LEVEL := .. PARALLEL_DIRS := llvm-as llvm-dis opt gccas llc llvm-link lli gccld llvm-stub \ analyze extract bugpoint llvm-nm llvm-prof llvm-db \ - llvm-ar llvm-ranlib llvm-bcanalyzer llee llvmc llvm-ld + llvm-ar llvm-ranlib llvm-bcanalyzer llvmc llvm-ld EXTRA_DIST := Makefile.JIT From llvm at cs.uiuc.edu Mon Dec 13 17:15:47 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Mon, 13 Dec 2004 17:15:47 -0600 Subject: [llvm-commits] CVS: llvm/tools/llee/ExecveHandler.c Makefile OSInterface.h README.txt StorageProxy.c SysUtils.c SysUtils.h Message-ID: <200412132315.RAA15043@zion.cs.uiuc.edu> Changes in directory llvm/tools/llee: ExecveHandler.c (r1.10) removed Makefile (r1.14) removed OSInterface.h (r1.4) removed README.txt (r1.2) removed StorageProxy.c (r1.4) removed SysUtils.c (r1.8) removed SysUtils.h (r1.5) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : llee was a nice hack, but it wasn't portable so its gone, with Misha's approval. Operating systems have facilities available for making bytecode directly executable without this utility. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Mon Dec 13 17:40:19 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 17:40:19 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/SystemUtils.h Message-ID: <200412132340.RAA15377@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: SystemUtils.h updated: 1.14 -> 1.15 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * isExecutable -> sys::Path::executable() * Adjust interface of FindExecutable to return a sys::Path --- Diffs of the changes: (+2 -7) Index: llvm/include/llvm/Support/SystemUtils.h diff -u llvm/include/llvm/Support/SystemUtils.h:1.14 llvm/include/llvm/Support/SystemUtils.h:1.15 --- llvm/include/llvm/Support/SystemUtils.h:1.14 Mon Dec 13 14:14:30 2004 +++ llvm/include/llvm/Support/SystemUtils.h Mon Dec 13 17:40:08 2004 @@ -15,15 +15,10 @@ #ifndef LLVM_SUPPORT_SYSTEMUTILS_H #define LLVM_SUPPORT_SYSTEMUTILS_H -#include +#include "llvm/System/Path.h" namespace llvm { -/// isExecutableFile - This function returns true if the filename specified -/// exists and is executable. -/// -bool isExecutableFile(const std::string &ExeFileName); - /// isStandardOutAConsole - Return true if we can tell that the standard output /// stream goes to a terminal window or console. bool isStandardOutAConsole(); @@ -33,7 +28,7 @@ /// the same directory, but that directory is neither the current directory, nor /// in the PATH. If the executable cannot be found, return an empty string. /// -std::string FindExecutable(const std::string &ExeName, +sys::Path FindExecutable(const std::string &ExeName, const std::string &ProgramPath); /// RunProgramWithTimeout - This function executes the specified program, with From reid at x10sys.com Mon Dec 13 17:41:48 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 17:41:48 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/SystemUtils.cpp Message-ID: <200412132341.RAA15401@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SystemUtils.cpp updated: 1.35 -> 1.36 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Remove isExecutable as its now implemented by sys::Path::executable * Make FindExecutable a thin veneer over sys::Program::FindProgramByName. --- Diffs of the changes: (+13 -64) Index: llvm/lib/Support/SystemUtils.cpp diff -u llvm/lib/Support/SystemUtils.cpp:1.35 llvm/lib/Support/SystemUtils.cpp:1.36 --- llvm/lib/Support/SystemUtils.cpp:1.35 Mon Dec 13 14:14:29 2004 +++ llvm/lib/Support/SystemUtils.cpp Mon Dec 13 17:41:37 2004 @@ -12,16 +12,11 @@ // //===----------------------------------------------------------------------===// -#define _POSIX_MAPPED_FILES #include "llvm/Support/SystemUtils.h" -#include "llvm/Config/fcntl.h" -#include "llvm/Config/pagesize.h" -#include "llvm/Config/unistd.h" -#include "llvm/Config/windows.h" -#include "llvm/Config/sys/mman.h" -#include "llvm/Config/sys/stat.h" -#include "llvm/Config/sys/types.h" -#include "llvm/Config/sys/wait.h" +#include "llvm/System/Program.h" +#include +#include +#include #include #include #include @@ -30,25 +25,6 @@ #include using namespace llvm; -/// isExecutableFile - This function returns true if the filename specified -/// exists and is executable. -/// -bool llvm::isExecutableFile(const std::string &ExeFileName) { - struct stat Buf; - if (stat(ExeFileName.c_str(), &Buf)) - return false; // Must not be executable! - - if (!(Buf.st_mode & S_IFREG)) - return false; // Not a regular file? - - if (Buf.st_uid == getuid()) // Owner of file? - return Buf.st_mode & S_IXUSR; - else if (Buf.st_gid == getgid()) // In group of file? - return Buf.st_mode & S_IXGRP; - else // Unrelated to file? - return Buf.st_mode & S_IXOTH; -} - /// isStandardOutAConsole - Return true if we can tell that the standard output /// stream goes to a terminal window or console. bool llvm::isStandardOutAConsole() { @@ -67,48 +43,21 @@ /// empty string. /// #undef FindExecutable // needed on windows :( -std::string llvm::FindExecutable(const std::string &ExeName, +sys::Path llvm::FindExecutable(const std::string &ExeName, const std::string &ProgramPath) { - // First check the directory that bugpoint is in. We can do this if - // BugPointPath contains at least one / character, indicating that it is a + // First check the directory that the calling program is in. We can do this + // if ProgramPath contains at least one / character, indicating that it is a // relative path to bugpoint itself. // - std::string Result = ProgramPath; - while (!Result.empty() && Result[Result.size()-1] != '/') - Result.erase(Result.size()-1, 1); - - if (!Result.empty()) { - Result += ExeName; - if (isExecutableFile(Result)) return Result; // Found it? - } + sys::Path Result ( ProgramPath ); + Result.elideFile(); - // Okay, if the path to the program didn't tell us anything, try using the - // PATH environment variable. - const char *PathStr = getenv("PATH"); - if (PathStr == 0) return ""; - - // Now we have a colon separated list of directories to search... try them... - unsigned PathLen = strlen(PathStr); - while (PathLen) { - // Find the first colon... - const char *Colon = std::find(PathStr, PathStr+PathLen, ':'); - - // Check to see if this first directory contains the executable... - std::string FilePath = std::string(PathStr, Colon) + '/' + ExeName; - if (isExecutableFile(FilePath)) - return FilePath; // Found the executable! - - // Nope it wasn't in this directory, check the next range! - PathLen -= Colon-PathStr; - PathStr = Colon; - while (*PathStr == ':') { // Advance past colons - PathStr++; - PathLen--; - } + if (!Result.isEmpty()) { + Result.appendFile(ExeName); + if (Result.executable()) return Result; } - // If we fell out, we ran out of directories in PATH to search, return failure - return ""; + return sys::Program::FindProgramByName(ExeName); } static void RedirectFD(const std::string &File, int FD) { From reid at x10sys.com Mon Dec 13 17:43:55 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 17:43:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/ToolRunner.cpp Message-ID: <200412132343.RAA15426@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: ToolRunner.cpp updated: 1.33 -> 1.34 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Adjust to changes in the interface of FindExecutable, getting ToolRunner ready for bigger things to come. --- Diffs of the changes: (+5 -5) Index: llvm/lib/Support/ToolRunner.cpp diff -u llvm/lib/Support/ToolRunner.cpp:1.33 llvm/lib/Support/ToolRunner.cpp:1.34 --- llvm/lib/Support/ToolRunner.cpp:1.33 Mon Nov 29 06:40:21 2004 +++ llvm/lib/Support/ToolRunner.cpp Mon Dec 13 17:43:44 2004 @@ -109,7 +109,7 @@ AbstractInterpreter *AbstractInterpreter::createLLI(const std::string &ProgPath, std::string &Message, const std::vector *ToolArgs) { - std::string LLIPath = FindExecutable("lli", ProgPath); + std::string LLIPath = FindExecutable("lli", ProgPath).toString(); if (!LLIPath.empty()) { Message = "Found lli: " + LLIPath + "\n"; return new LLI(LLIPath, ToolArgs); @@ -175,7 +175,7 @@ LLC *AbstractInterpreter::createLLC(const std::string &ProgramPath, std::string &Message, const std::vector *Args) { - std::string LLCPath = FindExecutable("llc", ProgramPath); + std::string LLCPath = FindExecutable("llc", ProgramPath).toString(); if (LLCPath.empty()) { Message = "Cannot find `llc' in executable directory or PATH!\n"; return 0; @@ -253,7 +253,7 @@ /// AbstractInterpreter *AbstractInterpreter::createJIT(const std::string &ProgPath, std::string &Message, const std::vector *Args) { - std::string LLIPath = FindExecutable("lli", ProgPath); + std::string LLIPath = FindExecutable("lli", ProgPath).toString(); if (!LLIPath.empty()) { Message = "Found lli: " + LLIPath + "\n"; return new JIT(LLIPath, Args); @@ -317,7 +317,7 @@ CBE *AbstractInterpreter::createCBE(const std::string &ProgramPath, std::string &Message, const std::vector *Args) { - std::string LLCPath = FindExecutable("llc", ProgramPath); + std::string LLCPath = FindExecutable("llc", ProgramPath).toString(); if (LLCPath.empty()) { Message = "Cannot find `llc' in executable directory or PATH!\n"; @@ -434,7 +434,7 @@ /// create - Try to find the `gcc' executable /// GCC *GCC::create(const std::string &ProgramPath, std::string &Message) { - std::string GCCPath = FindExecutable("gcc", ProgramPath); + std::string GCCPath = FindExecutable("gcc", ProgramPath).toString(); if (GCCPath.empty()) { Message = "Cannot find `gcc' in executable directory or PATH!\n"; return 0; From reid at x10sys.com Mon Dec 13 17:44:34 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 17:44:34 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200412132344.RAA15448@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.88 -> 1.89 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Adjust to interface change for FindExecutable. --- Diffs of the changes: (+12 -11) Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.88 llvm/tools/gccld/gccld.cpp:1.89 --- llvm/tools/gccld/gccld.cpp:1.88 Mon Dec 13 14:03:02 2004 +++ llvm/tools/gccld/gccld.cpp Mon Dec 13 17:44:23 2004 @@ -119,7 +119,7 @@ // Windows doesn't support #!/bin/sh style shell scripts in .exe files. To // support windows systems, we copy the llvm-stub.exe executable from the // build tree to the destination file. - std::string llvmstub = FindExecutable("llvm-stub.exe", argv[0]); + std::string llvmstub = FindExecutable("llvm-stub.exe", argv[0]).toString(); if (llvmstub.empty()) { std::cerr << "Could not find llvm-stub.exe executable!\n"; exit(1); @@ -193,7 +193,7 @@ } } -int main(int argc, char **argv, char **envp) { +int main(int argc, char **argv, char **envp ) { cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n"); sys::PrintStackTraceOnErrorSignal(); @@ -283,20 +283,20 @@ sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. - std::string llc = FindExecutable("llc", argv[0]); - std::string gcc = FindExecutable("gcc", argv[0]); + std::string llc = FindExecutable("llc", argv[0]).toString(); if (llc.empty()) return PrintAndReturn(argv[0], "Failed to find llc"); + std::string gcc = FindExecutable("gcc", argv[0]).toString(); if (gcc.empty()) return PrintAndReturn(argv[0], "Failed to find gcc"); // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateAssembly(AssemblyFile, RealBytecodeOutput, llc, envp); + GenerateAssembly(AssemblyFile, RealBytecodeOutput, llc, envp ); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, AssemblyFile, Libraries, LibPaths, - gcc, envp); + GenerateNative(OutputFilename, AssemblyFile, Libraries, LibPaths, + gcc, envp ); // Remove the assembly language file. removeFile (AssemblyFile); @@ -308,18 +308,19 @@ sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. - std::string llc = FindExecutable("llc", argv[0]); - std::string gcc = FindExecutable("gcc", argv[0]); + std::string llc = FindExecutable("llc", argv[0]).toString(); if (llc.empty()) return PrintAndReturn(argv[0], "Failed to find llc"); + + std::string gcc = FindExecutable("gcc", argv[0]).toString(); if (gcc.empty()) return PrintAndReturn(argv[0], "Failed to find gcc"); // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateCFile(CFile, RealBytecodeOutput, llc, envp); + GenerateCFile(CFile, RealBytecodeOutput, llc, envp ); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, CFile, Libraries, LibPaths, gcc, envp); + GenerateNative(OutputFilename, CFile, Libraries, LibPaths, gcc, envp ); // Remove the assembly language file. removeFile(CFile); From reid at x10sys.com Mon Dec 13 17:44:33 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 17:44:33 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200412132344.RAA15445@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.10 -> 1.11 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Adjust to interface change for FindExecutable. --- Diffs of the changes: (+5 -4) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.10 llvm/tools/llvm-ld/llvm-ld.cpp:1.11 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.10 Mon Dec 13 14:03:02 2004 +++ llvm/tools/llvm-ld/llvm-ld.cpp Mon Dec 13 17:44:23 2004 @@ -481,11 +481,11 @@ sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. - std::string llc = FindExecutable("llc", argv[0]); - std::string gcc = FindExecutable("gcc", argv[0]); + std::string llc = FindExecutable("llc", argv[0]).toString(); if (llc.empty()) return PrintAndReturn("Failed to find llc"); + std::string gcc = FindExecutable("gcc", argv[0]).toString(); if (gcc.empty()) return PrintAndReturn("Failed to find gcc"); @@ -506,10 +506,11 @@ sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. - std::string llc = FindExecutable("llc", argv[0]); - std::string gcc = FindExecutable("gcc", argv[0]); + std::string llc = FindExecutable("llc", argv[0]).toString(); if (llc.empty()) return PrintAndReturn("Failed to find llc"); + + std::string gcc = FindExecutable("gcc", argv[0]).toString(); if (gcc.empty()) return PrintAndReturn("Failed to find gcc"); From alkis at cs.uiuc.edu Mon Dec 13 20:58:05 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 20:58:05 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200412140258.UAA17951@zion.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.180 -> 1.181 --- Log message: Fix types after change to ConstantExpr::getSizeOf(). --- Diffs of the changes: (+11 -5) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.180 llvm-java/lib/Compiler/Compiler.cpp:1.181 --- llvm-java/lib/Compiler/Compiler.cpp:1.180 Sun Dec 12 01:21:15 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Mon Dec 13 20:57:54 2004 @@ -2302,14 +2302,20 @@ Type* elementTy, const VTableInfo& vi, Value* count) { + // The size of the element. + llvm::Constant* elementSize = + ConstantExpr::getCast(ConstantExpr::getSizeOf(elementTy), Type::UIntTy); + // The size of the array part of the struct. Value* size = BinaryOperator::create( - Instruction::Mul, count, ConstantExpr::getSizeOf(elementTy), - TMP, currentBB_); - // Plus the size of the rest of the struct. + Instruction::Mul, count, elementSize, TMP, currentBB_); + // The size of the rest of the array object. + llvm::Constant* arrayObjectSize = + ConstantExpr::getCast(ConstantExpr::getSizeOf(ci.type), Type::UIntTy); + + // Add the array part plus the object part together. size = BinaryOperator::create( - Instruction::Add, size, ConstantExpr::getSizeOf(ci.type), - TMP, currentBB_); + Instruction::Add, size, arrayObjectSize, TMP, currentBB_); // Allocate memory for the object. Value* objRef = new MallocInst(Type::SByteTy, size, TMP, currentBB_); objRef = new CastInst(objRef, PointerType::get(ci.type), TMP, currentBB_); From alkis at cs.uiuc.edu Mon Dec 13 20:59:45 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 20:59:45 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/Makefile Message-ID: <200412140259.UAA18057@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: Makefile updated: 1.31 -> 1.32 --- Log message: Make rules pick up any java files in a directory and compile them. There is no need to add them explicitely now. --- Diffs of the changes: (+9 -42) Index: llvm-java/test/Programs/SingleSource/UnitTests/Makefile diff -u llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.31 llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.32 --- llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.31 Sun Dec 12 22:45:50 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/Makefile Mon Dec 13 20:59:34 2004 @@ -8,50 +8,20 @@ ##===----------------------------------------------------------------------===## LEVEL := ../../../.. -JAVA_TESTS := AbstractCall \ - Arithm \ - Array \ - BigConstants \ - Call \ - FieldAccess \ - FloatCompare \ - ForLoop \ - If \ - InnerClass \ - InstanceOf \ - InterfaceCall \ - Lists \ - Lists1 \ - Lists2 \ - LongCompare \ - LookupSwitch \ - Numbers \ - StaticInitializers \ - TableSwitch \ - Test \ - VirtualCall \ - VTable \ - ackermann \ - ary \ - fibo \ - heapsort \ - methcall \ - nestedloop \ - objinst \ - sieve \ - random \ - takfp \ -# Strings \ -# MultipleInterfaces \ -# MultiArray \ - - CPPFLAGS+=-I$(BUILD_SRC_ROOT)/include/llvm/Java BYTECODE_LIBRARY=1 SHARED_LIBRARY=1 LIBRARYNAME=test -EXTRA_OBJS = $(LibDir)/libtest.bca +include $(LEVEL)/Makefile.common + +EXTRA_OBJS = $(LibName.BCA) + +BUILD_JAVA_SOURCES=1 + +include ../Makefile.singlesrc + +$(EXTRA_OBJS): Test.h Test.h: Output/Test.class $(Verb)$(Echo) Creating JNI header for class $(basename $(notdir $<)) @@ -61,6 +31,3 @@ clean:: $(Verb)rm -f Test.h -include ../Makefile.singlesrc - -$(EXTRA_OBJS): Test.h From alkis at cs.uiuc.edu Mon Dec 13 20:59:46 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 20:59:46 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/Makefile.singlesrc Message-ID: <200412140259.UAA18060@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource: Makefile.singlesrc updated: 1.14 -> 1.15 --- Log message: Make rules pick up any java files in a directory and compile them. There is no need to add them explicitely now. --- Diffs of the changes: (+4 -4) Index: llvm-java/test/Programs/SingleSource/Makefile.singlesrc diff -u llvm-java/test/Programs/SingleSource/Makefile.singlesrc:1.14 llvm-java/test/Programs/SingleSource/Makefile.singlesrc:1.15 --- llvm-java/test/Programs/SingleSource/Makefile.singlesrc:1.14 Sun Dec 12 22:25:40 2004 +++ llvm-java/test/Programs/SingleSource/Makefile.singlesrc Mon Dec 13 20:59:35 2004 @@ -7,12 +7,10 @@ # ##===----------------------------------------------------------------------===## -include $(LEVEL)/test/Makefile.test - # rule to build raw bytecode from a classfile %.raw.bc: %.class $(CLASS2LLVM) $(Echo) Compiling $< to bytecode - $(Verb)$(CLASS2LLVM) -cp $(CLASSPATH):Output $(subst /,.,$(*F)) -o=$@ + -$(Verb)$(CLASS2LLVM) -cp $(CLASSPATH):Output $(subst /,.,$(*F)) -o=$@ OPT_PASSES := -simplifycfg -mem2reg -globalopt -globaldce \ -ipsccp -simplifycfg -deadargelim -instcombine -simplifycfg \ @@ -25,4 +23,6 @@ # optimize raw bytecode %.linked.bc: %.raw.bc $(LOPT) $(Echo) Optimizing $< - $(Verb)$(LOPT) $(OPT_PASSES) -f -o=$@ $< + -$(Verb)$(LOPT) $(OPT_PASSES) -f -o=$@ $< + +include $(LEVEL)/test/Makefile.test From alkis at cs.uiuc.edu Mon Dec 13 20:59:46 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 20:59:46 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Makefile.test Message-ID: <200412140259.UAA18063@zion.cs.uiuc.edu> Changes in directory llvm-java/test: Makefile.test updated: 1.28 -> 1.29 --- Log message: Make rules pick up any java files in a directory and compile them. There is no need to add them explicitely now. --- Diffs of the changes: (+17 -18) Index: llvm-java/test/Makefile.test diff -u llvm-java/test/Makefile.test:1.28 llvm-java/test/Makefile.test:1.29 --- llvm-java/test/Makefile.test:1.28 Sun Dec 12 22:45:50 2004 +++ llvm-java/test/Makefile.test Mon Dec 13 20:59:35 2004 @@ -7,8 +7,6 @@ # ##===----------------------------------------------------------------------===## -include $(LEVEL)/Makefile.common - .PHONY: clean clean:: @@ -17,22 +15,12 @@ # we don't want these files to be deleted by make, even if they are # intermediate results -.PRECIOUS: Output/.dir %.linked.bc %.raw.bc %.ll %.llvm.bc - -# -simplifycfg -mem2reg -instcombine - -# rule to link bytecode with runtime -%.llvm %.llvm.bc: %.linked.bc $(LibDir)/libjrt.bca $(EXTRA_OBJS) $(LOPT) - $(Echo) Linking $< with the Java runtime - $(Verb)$(GCCLD) -o=$*.llvm $< -L $(LibDir) $(EXTRA_OBJS) - -# rule to make assembly from bytecode -%.dis-ll: %.bc - $(Echo) Disassembling $< - $(Verb)$(LDIS) -f -o=$@ $< +.PRECIOUS: %.linked.bc %.raw.bc %.ll %.llvm.bc # rule to compile java sources -ifdef JAVA_TESTS +ifdef BUILD_JAVA_SOURCES +JAVA_SOURCES := $(wildcard *.java) +JAVA_TESTS := $(basename $(JAVA_SOURCES)) PREFIXED_JAVA_TESTS := $(addprefix Output/, $(JAVA_TESTS)) PREFIXED_CLASS_FILES := $(addsuffix .class/, $(PREFIXED_JAVA_TESTS)) @@ -55,8 +43,6 @@ # Keep the output and diffs .PRECIOUS: %.out-nat %.out-jit %.diff -all:: $(DIFFS) - # rule to run a .class file with the jvm %.out-nat: %.class -$(Verb)LD_LIBRARY_PATH=$(LibDir) $(JAVA) -cp Output $(notdir $*) \ @@ -71,4 +57,17 @@ $(Verb)diff $*.out-nat $*.out-jit > $@ \ && echo "PASS: $(notdir $*)" \ || echo "FAIL: $(notdir $*)" + +# rule to link bytecode with runtime +%.llvm %.llvm.bc: %.linked.bc $(LibDir)/libjrt.bca $(EXTRA_OBJS) $(LOPT) + $(Echo) Linking $< with the Java runtime + -$(Verb)$(GCCLD) -o=$*.llvm $< -L $(LibDir) $(EXTRA_OBJS) + +# rule to make assembly from bytecode +%.dis-ll: %.bc + $(Echo) Disassembling $< + $(Verb)$(LDIS) -f -o=$@ $< + +all-local:: $(DIFFS) + endif From alkis at cs.uiuc.edu Mon Dec 13 21:00:14 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 21:00:14 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java Message-ID: <200412140300.VAA18144@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: MultipleInterfaces.java updated: 1.4 -> 1.5 --- Log message: Make this test compile now. --- Diffs of the changes: (+1 -1) Index: llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java:1.4 llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java:1.5 --- llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java:1.4 Sat Dec 11 17:31:49 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/MultipleInterfaces.java Mon Dec 13 21:00:03 2004 @@ -15,7 +15,7 @@ public int i3(); } - class C1 implements I3 + private static class C1 implements I3 { public int i1() { return 1; } public int i2() { return 2; } From alkis at cs.uiuc.edu Mon Dec 13 21:23:47 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Mon, 13 Dec 2004 21:23:47 -0600 Subject: [llvm-commits] CVS: llvm-java/docs/TODO Message-ID: <200412140323.VAA18574@zion.cs.uiuc.edu> Changes in directory llvm-java/docs: TODO added (r1.1) --- Log message: Add TODO list. --- Diffs of the changes: (+22 -0) Index: llvm-java/docs/TODO diff -c /dev/null llvm-java/docs/TODO:1.1 *** /dev/null Mon Dec 13 21:23:46 2004 --- llvm-java/docs/TODO Mon Dec 13 21:23:36 2004 *************** *** 0 **** --- 1,22 ---- + * Create Class description information from ClassFile object and + resolve all references (classfile constant pool) when loading the + classfile. This way we will not create types, parse method strings, + parse and find object fields on every refernce. This will both speedup + compilation but more importantly it will simplify code generation. + + * Change all object types as arguments to functions, on the operand + stack, or local variables should be of type llvm_object_base*. All + primitive types should normalize to their Java counterparts (a bool is + always an int on the operand stack). + + * Change object model so that we can support: + - Multiple inheritance of interfaces. + - Dynamic element type of an array. + - Distinguish between class or array objects dynamically. + - Reflection (used by JNI). + + * Exceptions. + + * Add GC hooks into the GC runtime. + + * Syncronization. From reid at x10sys.com Mon Dec 13 21:55:31 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 21:55:31 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200412140355.VAA19054@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.34 -> 1.35 --- Log message: Revert the last patch as it causes a static destruction ordering problem. --- Diffs of the changes: (+5 -3) Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.34 llvm/lib/Support/Timer.cpp:1.35 --- llvm/lib/Support/Timer.cpp:1.34 Mon Dec 13 10:04:04 2004 +++ llvm/lib/Support/Timer.cpp Mon Dec 13 21:55:21 2004 @@ -33,10 +33,12 @@ // problem is that a Statistic<> object gets destroyed, which ends up calling // 'GetLibSupportInfoOutputFile()' (below), which calls this function. // LibSupportInfoOutputFilename used to be a global variable, but sometimes it -// would get destroyed before the Statistic, causing havoc to ensue. +// would get destroyed before the Statistic, causing havoc to ensue. We "fix" +// this by creating the string the first time it is needed and never destroying +// it. static std::string &getLibSupportInfoOutputFilename() { - static std::string LibSupportInfoOutputFilename; - return LibSupportInfoOutputFilename; + static std::string *LibSupportInfoOutputFilename = new std::string(); + return *LibSupportInfoOutputFilename; } namespace { From reid at x10sys.com Mon Dec 13 22:17:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 22:17:23 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Program.h Message-ID: <200412140417.WAA19497@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Program.h updated: 1.2 -> 1.3 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Fix commentary, wrap lines, etc. * Add an environment pointer to the ExecuteAndWait function. --- Diffs of the changes: (+15 -10) Index: llvm/include/llvm/System/Program.h diff -u llvm/include/llvm/System/Program.h:1.2 llvm/include/llvm/System/Program.h:1.3 --- llvm/include/llvm/System/Program.h:1.2 Mon Sep 13 16:48:44 2004 +++ llvm/include/llvm/System/Program.h Mon Dec 13 22:17:12 2004 @@ -22,8 +22,8 @@ /// This class provides an abstraction for programs that are executable by the /// operating system. It provides a platform generic way to find executable - /// programs from the path and to execute them. The sys::Path class is used to - /// locate the Program. + /// programs from the path and to execute them in various ways. The sys::Path + /// class is used to specify the location of the Program. /// @since 1.4 /// @brief An abstraction for finding and executing programs. class Program { @@ -43,22 +43,27 @@ /// waits for the program to exit. This function will block the current /// program until the invoked program exits. The invoked program will /// inherit the stdin, stdout, and stderr file descriptors, the - /// environment and other configuration settings of the inoking program. + /// environment and other configuration settings of the invoking program. /// If Path::executable() does not return true when this function is /// called then a std::string is thrown. - /// Path::executable() returns true. /// @param path A sys::Path object providing the path of the program to be /// executed. It is presumed this is the result of the FindProgramByName /// method. - /// @param args A vector of strings that are passed to the program. - /// The first element should *not* be the name of the program. /// @returns an integer result code indicating the status of the program. - /// @throws std::string on a variety of error conditions or if the invoked + /// @throws std::string on a variety of error conditions or if the invoked /// program aborted abnormally. /// @see FindProgrambyName - /// @brief Executes the program with the given set of \p arguments. - static int ExecuteAndWait(const Path& path, - const std::vector& args); + /// @brief Executes the program with the given set of \p args. + static int ExecuteAndWait( + const Path& path, ///< The path to the program to execute + const std::vector& args, + ///< A vector of strings that are passed to the program. + ///< The first element should *not* be the name of the program. + const char ** env = 0 + ///< An optional vector of strings to use for the program's + ///< environment. If not provided, the current program's environment + ///< will be used. + ); /// @} }; } From reid at x10sys.com Mon Dec 13 22:18:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 22:18:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/SystemUtils.cpp Message-ID: <200412140418.WAA19516@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SystemUtils.cpp updated: 1.36 -> 1.37 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Remove the ExecWait function. This is now in sys::Program::ExecuteAndWait --- Diffs of the changes: (+3 -78) Index: llvm/lib/Support/SystemUtils.cpp diff -u llvm/lib/Support/SystemUtils.cpp:1.36 llvm/lib/Support/SystemUtils.cpp:1.37 --- llvm/lib/Support/SystemUtils.cpp:1.36 Mon Dec 13 17:41:37 2004 +++ llvm/lib/Support/SystemUtils.cpp Mon Dec 13 22:18:15 2004 @@ -14,15 +14,15 @@ #include "llvm/Support/SystemUtils.h" #include "llvm/System/Program.h" -#include -#include -#include +#include "llvm/Config/fcntl.h" +#include "llvm/Config/sys/wait.h" #include #include #include #include #include #include + using namespace llvm; /// isStandardOutAConsole - Return true if we can tell that the standard output @@ -160,78 +160,3 @@ return -1; #endif } - - -// ExecWait - executes a program with the specified arguments and environment. -// It then waits for the progarm to termiante and then returns to the caller. -// -// Inputs: -// argv - The arguments to the program as an array of C strings. The first -// argument should be the name of the program to execute, and the -// last argument should be a pointer to NULL. -// -// envp - The environment passes to the program as an array of C strings in -// the form of "name=value" pairs. The last element should be a -// pointer to NULL. -// -// Outputs: -// None. -// -// Return value: -// 0 - No errors. -// 1 - The program could not be executed. -// 1 - The program returned a non-zero exit status. -// 1 - The program terminated abnormally. -// -// Notes: -// The program will inherit the stdin, stdout, and stderr file descriptors -// as well as other various configuration settings (umask). -// -// This function should not print anything to stdout/stderr on its own. It is -// a generic library function. The caller or executed program should report -// errors in the way it sees fit. -// -// This function does not use $PATH to find programs. -// -int llvm::ExecWait(const char * const old_argv[], - const char * const old_envp[]) { -#ifdef HAVE_SYS_WAIT_H - // Create local versions of the parameters that can be passed into execve() - // without creating const problems. - char ** const argv = (char ** const) old_argv; - char ** const envp = (char ** const) old_envp; - - // Create a child process. - switch (fork()) { - // An error occured: Return to the caller. - case -1: - return 1; - break; - - // Child process: Execute the program. - case 0: - execve (argv[0], argv, envp); - // If the execve() failed, we should exit and let the parent pick up - // our non-zero exit status. - exit (1); - - // Parent process: Break out of the switch to do our processing. - default: - break; - } - - // Parent process: Wait for the child process to terminate. - int status; - if ((wait (&status)) == -1) - return 1; - - // If the program exited normally with a zero exit status, return success! - if (WIFEXITED (status) && (WEXITSTATUS(status) == 0)) - return 0; -#else - std::cerr << "llvm::ExecWait not implemented on this platform!\n"; -#endif - - // Otherwise, return failure. - return 1; -} From reid at x10sys.com Mon Dec 13 22:19:03 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 22:19:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Program.cpp Message-ID: <200412140419.WAA19539@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Program.cpp updated: 1.6 -> 1.7 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Implement the new environment pointer for ExecuteAndWait --- Diffs of the changes: (+4 -2) Index: llvm/lib/System/Win32/Program.cpp diff -u llvm/lib/System/Win32/Program.cpp:1.6 llvm/lib/System/Win32/Program.cpp:1.7 --- llvm/lib/System/Win32/Program.cpp:1.6 Sat Dec 11 11:37:01 2004 +++ llvm/lib/System/Win32/Program.cpp Mon Dec 13 22:18:51 2004 @@ -69,7 +69,8 @@ // int Program::ExecuteAndWait(const Path& path, - const std::vector& args) { + const std::vector& args, + const char** env) { if (!path.executable()) throw path.toString() + " is not executable"; @@ -124,8 +125,9 @@ PROCESS_INFORMATION pi; memset(&pi, 0, sizeof(pi)); + LPVOID lpEnvironment = envp; if (!CreateProcess(path.c_str(), command, NULL, NULL, FALSE, 0, - NULL, NULL, &si, &pi)) + lpEnvironment, NULL, &si, &pi)) { ThrowError(std::string("Couldn't execute program '") + path.toString() + "'"); From reid at x10sys.com Mon Dec 13 22:19:03 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 22:19:03 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Program.cpp Message-ID: <200412140419.WAA19538@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Program.cpp updated: 1.6 -> 1.7 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Implement the new environment pointer for ExecuteAndWait --- Diffs of the changes: (+8 -3) Index: llvm/lib/System/Unix/Program.cpp diff -u llvm/lib/System/Unix/Program.cpp:1.6 llvm/lib/System/Unix/Program.cpp:1.7 --- llvm/lib/System/Unix/Program.cpp:1.6 Fri Dec 10 18:14:15 2004 +++ llvm/lib/System/Unix/Program.cpp Mon Dec 13 22:18:51 2004 @@ -79,7 +79,8 @@ // int Program::ExecuteAndWait(const Path& path, - const std::vector& args) { + const std::vector& args, + const char ** envp ) { if (!path.executable()) throw path.toString() + " is not executable"; @@ -103,11 +104,15 @@ break; // Child process: Execute the program. - case 0: - execve (path.c_str(), (char** const)argv, environ); + case 0: { + char** env = environ; + if (envp != 0) + env = (char**) envp; + execve (path.c_str(), (char** const)argv, env); // If the execve() failed, we should exit and let the parent pick up // our non-zero exit status. exit (errno); + } // Parent process: Break out of the switch to do our processing. default: From reid at x10sys.com Mon Dec 13 22:20:19 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 22:20:19 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp gccld.cpp gccld.h Message-ID: <200412140420.WAA19581@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.40 -> 1.41 gccld.cpp updated: 1.89 -> 1.90 gccld.h updated: 1.11 -> 1.12 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Change ExecWait calls to sys::Program::ExecuteAndWait * Convert to use sys::Path where it makes sense --- Diffs of the changes: (+43 -73) Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.40 llvm/tools/gccld/GenerateCode.cpp:1.41 --- llvm/tools/gccld/GenerateCode.cpp:1.40 Fri Dec 10 16:30:32 2004 +++ llvm/tools/gccld/GenerateCode.cpp Mon Dec 13 22:20:07 2004 @@ -14,7 +14,7 @@ //===----------------------------------------------------------------------===// #include "gccld.h" -#include "llvm/Linker.h" +#include "llvm/System/Program.h" #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Analysis/LoadValueNumbering.h" @@ -26,6 +26,7 @@ #include "llvm/Transforms/Scalar.h" #include "llvm/Support/SystemUtils.h" #include "llvm/Support/CommandLine.h" + using namespace llvm; namespace { @@ -234,42 +235,35 @@ /// InputFilename - The name of the output bytecode file. /// OutputFilename - The name of the file to generate. /// llc - The pathname to use for LLC. -/// envp - The environment to use when running LLC. /// /// Return non-zero value on error. /// int llvm::GenerateAssembly(const std::string &OutputFilename, const std::string &InputFilename, - const std::string &llc, - char ** const envp) { + const sys::Path &llc) { // Run LLC to convert the bytecode file into assembly code. - const char *cmd[6]; - cmd[0] = llc.c_str(); - cmd[1] = "-f"; - cmd[2] = "-o"; - cmd[3] = OutputFilename.c_str(); - cmd[4] = InputFilename.c_str(); - cmd[5] = 0; + std::vector args; + args.push_back("-f"); + args.push_back("-o"); + args.push_back(OutputFilename); + args.push_back(InputFilename); - return ExecWait(cmd, envp); + return sys::Program::ExecuteAndWait(llc, args); } /// GenerateAssembly - generates a native assembly language source file from the /// specified bytecode file. int llvm::GenerateCFile(const std::string &OutputFile, const std::string &InputFile, - const std::string &llc, char ** const envp) { + const sys::Path &llc ) { // Run LLC to convert the bytecode file into C. - const char *cmd[7]; - - cmd[0] = llc.c_str(); - cmd[1] = "-march=c"; - cmd[2] = "-f"; - cmd[3] = "-o"; - cmd[4] = OutputFile.c_str(); - cmd[5] = InputFile.c_str(); - cmd[6] = 0; - return ExecWait(cmd, envp); + std::vector args; + args.push_back("-march=c"); + args.push_back("-f"); + args.push_back("-o"); + args.push_back(OutputFile); + args.push_back(InputFile); + return sys::Program::ExecuteAndWait(llc, args); } /// GenerateNative - generates a native assembly language source file from the @@ -279,7 +273,6 @@ /// InputFilename - The name of the output bytecode file. /// OutputFilename - The name of the file to generate. /// Libraries - The list of libraries with which to link. -/// LibPaths - The list of directories in which to find libraries. /// gcc - The pathname to use for GGC. /// envp - A copy of the process's current environment. /// @@ -291,8 +284,7 @@ int llvm::GenerateNative(const std::string &OutputFilename, const std::string &InputFilename, const std::vector &Libraries, - const std::vector &LibPaths, - const std::string &gcc, char ** const envp) { + const sys::Path &gcc, char ** const envp) { // Remove these environment variables from the environment of the // programs that we will execute. It appears that GCC sets these // environment variables so that the programs it uses can configure @@ -309,7 +301,6 @@ RemoveEnv("COMPILER_PATH", clean_env); RemoveEnv("COLLECT_GCC", clean_env); - std::vector cmd; // Run GCC to assemble and link the program into native code. // @@ -317,38 +308,20 @@ // We can't just assemble and link the file with the system assembler // and linker because we don't know where to put the _start symbol. // GCC mysteriously knows how to do it. - cmd.push_back(gcc.c_str()); - cmd.push_back("-fno-strict-aliasing"); - cmd.push_back("-O3"); - cmd.push_back("-o"); - cmd.push_back(OutputFilename.c_str()); - cmd.push_back(InputFilename.c_str()); - - // Adding the library paths creates a problem for native generation. If we - // include the search paths from llvmgcc, then we'll be telling normal gcc - // to look inside of llvmgcc's library directories for libraries. This is - // bad because those libraries hold only bytecode files (not native object - // files). In the end, we attempt to link the bytecode libgcc into a native - // program. -#if 0 - // Add in the library path options. - for (unsigned index=0; index < LibPaths.size(); index++) { - cmd.push_back("-L"); - cmd.push_back(LibPaths[index].c_str()); - } -#endif + std::vector args; + args.push_back("-fno-strict-aliasing"); + args.push_back("-O3"); + args.push_back("-o"); + args.push_back(OutputFilename); + args.push_back(InputFilename); // Add in the libraries to link. - std::vector Libs(Libraries); - for (unsigned index = 0; index < Libs.size(); index++) { - if (Libs[index] != "crtend") { - Libs[index] = "-l" + Libs[index]; - cmd.push_back(Libs[index].c_str()); - } + for (unsigned index = 0; index < Libraries.size(); index++) { + if (Libraries[index] != "crtend") + args.push_back("-l" + Libraries[index]); } - cmd.push_back(NULL); // Run the compiler to assembly and link together the program. - return ExecWait(&(cmd[0]), clean_env); + return sys::Program::ExecuteAndWait(gcc, args, (const char**)clean_env); } Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.89 llvm/tools/gccld/gccld.cpp:1.90 --- llvm/tools/gccld/gccld.cpp:1.89 Mon Dec 13 17:44:23 2004 +++ llvm/tools/gccld/gccld.cpp Mon Dec 13 22:20:07 2004 @@ -283,20 +283,19 @@ sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. - std::string llc = FindExecutable("llc", argv[0]).toString(); - if (llc.empty()) + sys::Path llc = FindExecutable("llc", argv[0]); + if (llc.isEmpty()) return PrintAndReturn(argv[0], "Failed to find llc"); - std::string gcc = FindExecutable("gcc", argv[0]).toString(); - if (gcc.empty()) + sys::Path gcc = FindExecutable("gcc", argv[0]); + if (gcc.isEmpty()) return PrintAndReturn(argv[0], "Failed to find gcc"); // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateAssembly(AssemblyFile, RealBytecodeOutput, llc, envp ); + GenerateAssembly(AssemblyFile, RealBytecodeOutput, llc); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, AssemblyFile, Libraries, LibPaths, - gcc, envp ); + GenerateNative(OutputFilename, AssemblyFile, Libraries, gcc, envp ); // Remove the assembly language file. removeFile (AssemblyFile); @@ -308,19 +307,19 @@ sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. - std::string llc = FindExecutable("llc", argv[0]).toString(); - if (llc.empty()) + sys::Path llc = FindExecutable("llc", argv[0]); + if (llc.isEmpty()) return PrintAndReturn(argv[0], "Failed to find llc"); - std::string gcc = FindExecutable("gcc", argv[0]).toString(); - if (gcc.empty()) + sys::Path gcc = FindExecutable("gcc", argv[0]); + if (gcc.isEmpty()) return PrintAndReturn(argv[0], "Failed to find gcc"); // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateCFile(CFile, RealBytecodeOutput, llc, envp ); + GenerateCFile(CFile, RealBytecodeOutput, llc); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, CFile, Libraries, LibPaths, gcc, envp ); + GenerateNative(OutputFilename, CFile, Libraries, gcc, envp ); // Remove the assembly language file. removeFile(CFile); Index: llvm/tools/gccld/gccld.h diff -u llvm/tools/gccld/gccld.h:1.11 llvm/tools/gccld/gccld.h:1.12 --- llvm/tools/gccld/gccld.h:1.11 Thu Dec 2 15:26:10 2004 +++ llvm/tools/gccld/gccld.h Mon Dec 13 22:20:07 2004 @@ -29,17 +29,15 @@ int GenerateAssembly (const std::string & OutputFilename, const std::string & InputFilename, - const std::string & llc, - char ** const envp); + const sys::Path & llc); int GenerateCFile(const std::string &OutputFile, const std::string &InputFile, - const std::string &llc, char ** const envp); + const sys::Path &llc); int GenerateNative (const std::string & OutputFilename, const std::string & InputFilename, const std::vector & Libraries, - const std::vector & LibPaths, - const std::string & gcc, + const sys::Path & gcc, char ** const envp); } // End llvm namespace From reid at x10sys.com Mon Dec 13 22:20:19 2004 From: reid at x10sys.com (Reid Spencer) Date: Mon, 13 Dec 2004 22:20:19 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200412140420.WAA19578@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.11 -> 1.12 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Change ExecWait calls to sys::Program::ExecuteAndWait * Convert to use sys::Path where it makes sense --- Diffs of the changes: (+39 -66) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.11 llvm/tools/llvm-ld/llvm-ld.cpp:1.12 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.11 Mon Dec 13 17:44:23 2004 +++ llvm/tools/llvm-ld/llvm-ld.cpp Mon Dec 13 22:20:08 2004 @@ -21,6 +21,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Linker.h" +#include "llvm/System/Program.h" #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Bytecode/Reader.h" @@ -215,36 +216,30 @@ /// static int GenerateAssembly(const std::string &OutputFilename, const std::string &InputFilename, - const std::string &llc, - char ** const envp) { + const sys::Path &llc) { // Run LLC to convert the bytecode file into assembly code. - const char *cmd[6]; - cmd[0] = llc.c_str(); - cmd[1] = "-f"; - cmd[2] = "-o"; - cmd[3] = OutputFilename.c_str(); - cmd[4] = InputFilename.c_str(); - cmd[5] = 0; + std::vector args; + args.push_back( "-f"); + args.push_back( "-o"); + args.push_back( OutputFilename); + args.push_back( InputFilename); - return ExecWait(cmd, envp); + return sys::Program::ExecuteAndWait(llc,args); } /// GenerateAssembly - generates a native assembly language source file from the /// specified bytecode file. static int GenerateCFile(const std::string &OutputFile, const std::string &InputFile, - const std::string &llc, char ** const envp) { + const sys::Path &llc) { // Run LLC to convert the bytecode file into C. - const char *cmd[7]; - - cmd[0] = llc.c_str(); - cmd[1] = "-march=c"; - cmd[2] = "-f"; - cmd[3] = "-o"; - cmd[4] = OutputFile.c_str(); - cmd[5] = InputFile.c_str(); - cmd[6] = 0; - return ExecWait(cmd, envp); + std::vector args; + args.push_back( "-march=c"); + args.push_back( "-f"); + args.push_back( "-o"); + args.push_back( OutputFile); + args.push_back( InputFile); + return sys::Program::ExecuteAndWait(llc, args); } /// GenerateNative - generates a native assembly language source file from the @@ -266,8 +261,7 @@ static int GenerateNative(const std::string &OutputFilename, const std::string &InputFilename, const std::vector &Libraries, - const std::vector &LibPaths, - const std::string &gcc, char ** const envp) { + const sys::Path &gcc, char ** const envp) { // Remove these environment variables from the environment of the // programs that we will execute. It appears that GCC sets these // environment variables so that the programs it uses can configure @@ -284,7 +278,6 @@ RemoveEnv("COMPILER_PATH", clean_env); RemoveEnv("COLLECT_GCC", clean_env); - std::vector cmd; // Run GCC to assemble and link the program into native code. // @@ -292,39 +285,20 @@ // We can't just assemble and link the file with the system assembler // and linker because we don't know where to put the _start symbol. // GCC mysteriously knows how to do it. - cmd.push_back(gcc.c_str()); - cmd.push_back("-fno-strict-aliasing"); - cmd.push_back("-O3"); - cmd.push_back("-o"); - cmd.push_back(OutputFilename.c_str()); - cmd.push_back(InputFilename.c_str()); - - // Adding the library paths creates a problem for native generation. If we - // include the search paths from llvmgcc, then we'll be telling normal gcc - // to look inside of llvmgcc's library directories for libraries. This is - // bad because those libraries hold only bytecode files (not native object - // files). In the end, we attempt to link the bytecode libgcc into a native - // program. -#if 0 - // Add in the library path options. - for (unsigned index=0; index < LibPaths.size(); index++) { - cmd.push_back("-L"); - cmd.push_back(LibPaths[index].c_str()); - } -#endif + std::vector args; + args.push_back("-fno-strict-aliasing"); + args.push_back("-O3"); + args.push_back("-o"); + args.push_back(OutputFilename); + args.push_back(InputFilename); // Add in the libraries to link. - std::vector Libs(Libraries); - for (unsigned index = 0; index < Libs.size(); index++) { - if (Libs[index] != "crtend") { - Libs[index] = "-l" + Libs[index]; - cmd.push_back(Libs[index].c_str()); - } - } - cmd.push_back(NULL); + for (unsigned index = 0; index < Libraries.size(); index++) + if (Libraries[index] != "crtend") + args.push_back("-l" + Libraries[index]); // Run the compiler to assembly and link together the program. - return ExecWait(&(cmd[0]), clean_env); + return sys::Program::ExecuteAndWait(gcc, args, (const char**)clean_env); } /// EmitShellScript - Output the wrapper file that invokes the JIT on the LLVM @@ -481,20 +455,19 @@ sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. - std::string llc = FindExecutable("llc", argv[0]).toString(); - if (llc.empty()) + sys::Path llc = FindExecutable("llc", argv[0]); + if (llc.isEmpty()) return PrintAndReturn("Failed to find llc"); - std::string gcc = FindExecutable("gcc", argv[0]).toString(); - if (gcc.empty()) + 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, RealBytecodeOutput, llc, envp); + GenerateAssembly(AssemblyFile, RealBytecodeOutput, llc); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, AssemblyFile, Libraries, LibPaths, - gcc, envp); + GenerateNative(OutputFilename, AssemblyFile, Libraries, gcc, envp); // Remove the assembly language file. removeFile (AssemblyFile); @@ -506,19 +479,19 @@ sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. - std::string llc = FindExecutable("llc", argv[0]).toString(); - if (llc.empty()) + sys::Path llc = FindExecutable("llc", argv[0]); + if (llc.isEmpty()) return PrintAndReturn("Failed to find llc"); - std::string gcc = FindExecutable("gcc", argv[0]).toString(); - if (gcc.empty()) + 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, RealBytecodeOutput, llc, envp); + GenerateCFile(CFile, RealBytecodeOutput, llc); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, CFile, Libraries, LibPaths, gcc, envp); + GenerateNative(OutputFilename, CFile, Libraries, gcc, envp); // Remove the assembly language file. removeFile(CFile); From jeffc at jolt-lang.org Mon Dec 13 23:26:54 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 13 Dec 2004 23:26:54 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/TimeValue.h Message-ID: <200412140526.XAA20596@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: TimeValue.h updated: 1.9 -> 1.10 --- Log message: Implement Win32 Path::getStatusInfo(), TimeValue::toString() --- Diffs of the changes: (+8 -0) Index: llvm/include/llvm/System/TimeValue.h diff -u llvm/include/llvm/System/TimeValue.h:1.9 llvm/include/llvm/System/TimeValue.h:1.10 --- llvm/include/llvm/System/TimeValue.h:1.9 Tue Nov 16 00:22:17 2004 +++ llvm/include/llvm/System/TimeValue.h Mon Dec 13 23:26:43 2004 @@ -336,6 +336,14 @@ this->normalize(); } + /// Converts the \p win32Time argument from Windows FILETIME to the + /// corresponding TimeValue and assigns that value to \p this. + /// @brief Convert seconds form Windows FILETIME to TimeValue + void fromWin32Time( uint64_t win32Time ) { + this->seconds_ = win32Time / 10000000 + Win32ZeroTime.seconds_; + this->nanos_ = NanoSecondsType(win32Time % 10000000) * 100; + } + /// @} /// @name Implementation /// @{ From jeffc at jolt-lang.org Mon Dec 13 23:26:53 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Mon, 13 Dec 2004 23:26:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Program.cpp TimeValue.cpp Message-ID: <200412140526.XAA20593@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.13 -> 1.14 Program.cpp updated: 1.7 -> 1.8 TimeValue.cpp updated: 1.4 -> 1.5 --- Log message: Implement Win32 Path::getStatusInfo(), TimeValue::toString() --- Diffs of the changes: (+50 -9) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.13 llvm/lib/System/Win32/Path.cpp:1.14 --- llvm/lib/System/Win32/Path.cpp:1.13 Mon Dec 13 13:59:50 2004 +++ llvm/lib/System/Win32/Path.cpp Mon Dec 13 23:26:43 2004 @@ -287,13 +287,49 @@ return path.substr(pos+1); } +void +Path::getStatusInfo(StatusInfo& info) const { + WIN32_FILE_ATTRIBUTE_DATA fi; + if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &fi)) + ThrowError(std::string(path) + ": Can't get status: "); + + info.fileSize = fi.nFileSizeHigh; + info.fileSize <<= 32; + info.fileSize += fi.nFileSizeLow; + + info.mode = 0777; // Not applicable to Windows, so... + info.user = 9999; // Not applicable to Windows, so... + info.group = 9999; // Not applicable to Windows, so... + + __int64 ft = *reinterpret_cast<__int64*>(&fi.ftLastWriteTime); + info.modTime.fromWin32Time(ft); + + info.isDir = fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; + if (info.isDir && path[path.length() - 1] != '/') + path += '/'; + else if (!info.isDir && path[path.length() - 1] == '/') + path.erase(path.length() - 1); +} + void Path::makeReadable() { + // All files are readable on Windows (ignoring security attributes). } void Path::makeWriteable() { + DWORD attr = GetFileAttributes(path.c_str()); + + // If it doesn't exist, we're done. + if (attr == INVALID_FILE_ATTRIBUTES) + return; + + if (attr & FILE_ATTRIBUTE_READONLY) { + if (!SetFileAttributes(path.c_str(), attr & ~FILE_ATTRIBUTE_READONLY)) + ThrowError(std::string(path) + ": Can't make file writable: "); + } } void Path::makeExecutable() { + // All files are executable on Windows (ignoring security attributes). } bool Index: llvm/lib/System/Win32/Program.cpp diff -u llvm/lib/System/Win32/Program.cpp:1.7 llvm/lib/System/Win32/Program.cpp:1.8 --- llvm/lib/System/Win32/Program.cpp:1.7 Mon Dec 13 22:18:51 2004 +++ llvm/lib/System/Win32/Program.cpp Mon Dec 13 23:26:43 2004 @@ -70,7 +70,7 @@ int Program::ExecuteAndWait(const Path& path, const std::vector& args, - const char** env) { + const char** envp) { if (!path.executable()) throw path.toString() + " is not executable"; @@ -125,9 +125,8 @@ PROCESS_INFORMATION pi; memset(&pi, 0, sizeof(pi)); - LPVOID lpEnvironment = envp; if (!CreateProcess(path.c_str(), command, NULL, NULL, FALSE, 0, - lpEnvironment, NULL, &si, &pi)) + envp, NULL, &si, &pi)) { ThrowError(std::string("Couldn't execute program '") + path.toString() + "'"); Index: llvm/lib/System/Win32/TimeValue.cpp diff -u llvm/lib/System/Win32/TimeValue.cpp:1.4 llvm/lib/System/Win32/TimeValue.cpp:1.5 --- llvm/lib/System/Win32/TimeValue.cpp:1.4 Tue Nov 16 00:22:17 2004 +++ llvm/lib/System/Win32/TimeValue.cpp Mon Dec 13 23:26:43 2004 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "Win32.h" +#include namespace llvm { using namespace sys; @@ -21,17 +22,22 @@ //===----------------------------------------------------------------------===// TimeValue TimeValue::now() { - __int64 ft; + uint64_t ft; GetSystemTimeAsFileTime(reinterpret_cast(&ft)); - return TimeValue( - static_cast( ft / 10000000 + - Win32ZeroTime.seconds_ ), - static_cast( (ft % 10000000) * 100) ); + TimeValue t(0, 0); + t.fromWin32Time(ft); + return t; } std::string TimeValue::toString() const { - return "Don't know how to conver time on Win32"; + // Alas, asctime is not re-entrant on Windows... + + __time64_t ourTime = this->toEpochTime(); + char* buffer = ::asctime(::_localtime64(&ourTime)); + + std::string result(buffer); + return result.substr(0,24); } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From gaeke at cs.uiuc.edu Tue Dec 14 02:21:23 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 14 Dec 2004 02:21:23 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV8/README.txt SparcV8ISelSimple.cpp Message-ID: <200412140821.CAA02149@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV8: README.txt updated: 1.34 -> 1.35 SparcV8ISelSimple.cpp updated: 1.85 -> 1.86 --- Log message: Get rid of shifts by zero in most cases. --- Diffs of the changes: (+7 -13) Index: llvm/lib/Target/SparcV8/README.txt diff -u llvm/lib/Target/SparcV8/README.txt:1.34 llvm/lib/Target/SparcV8/README.txt:1.35 --- llvm/lib/Target/SparcV8/README.txt:1.34 Mon Dec 13 14:13:10 2004 +++ llvm/lib/Target/SparcV8/README.txt Tue Dec 14 02:21:02 2004 @@ -55,13 +55,6 @@ * support casting 64-bit integers to FP types (fhourstones needs this) * support FP rem (call fmod) -* Eliminate srl/sll by zero bits like this: - sll %l0, 0, %l0 - srl %l0, 0, %o0 - - We think these are only used by V9 to clear off the top 32 bits of a reg, - so they are not needed. - * Keep the address of the constant pool in a register instead of forming its address all of the time. @@ -75,5 +68,5 @@ * We can fold small constant offsets into the %hi/%lo references to constant pool addresses as well. -$Date: 2004/12/13 20:13:10 $ +$Date: 2004/12/14 08:21:02 $ Index: llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp diff -u llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.85 llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.86 --- llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.85 Sun Dec 12 01:42:58 2004 +++ llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp Tue Dec 14 02:21:02 2004 @@ -71,7 +71,8 @@ unsigned emitIntegerCast (MachineBasicBlock *BB, MachineBasicBlock::iterator IP, const Type *oldTy, unsigned SrcReg, - const Type *newTy, unsigned DestReg); + const Type *newTy, unsigned DestReg, + bool castToLong = false); void emitFPToIntegerCast (MachineBasicBlock *BB, MachineBasicBlock::iterator IP, const Type *oldTy, unsigned SrcReg, const Type *newTy, @@ -606,15 +607,15 @@ unsigned V8ISel::emitIntegerCast (MachineBasicBlock *BB, MachineBasicBlock::iterator IP, const Type *oldTy, unsigned SrcReg, const Type *newTy, - unsigned DestReg) { - if (oldTy == newTy) { + unsigned DestReg, bool castToLong) { + unsigned shiftWidth = 32 - (8 * TM.getTargetData ().getTypeSize (newTy)); + if (oldTy == newTy || (!castToLong && shiftWidth == 0)) { // No-op cast - just emit a copy; assume the reg. allocator will zap it. BuildMI (*BB, IP, V8::ORrr, 2, DestReg).addReg (V8::G0).addReg(SrcReg); return SrcReg; } // Emit left-shift, then right-shift to sign- or zero-extend. unsigned TmpReg = makeAnotherReg (newTy); - unsigned shiftWidth = 32 - (8 * TM.getTargetData ().getTypeSize (newTy)); BuildMI (*BB, IP, V8::SLLri, 2, TmpReg).addZImm (shiftWidth).addReg(SrcReg); if (newTy->isSigned ()) { // sign-extend with SRA BuildMI(*BB, IP, V8::SRAri, 2, DestReg).addZImm (shiftWidth).addReg(TmpReg); @@ -739,7 +740,7 @@ const Type *OldHalfTy = oldTy->isSigned() ? Type::IntTy : Type::UIntTy; const Type *NewHalfTy = newTy->isSigned() ? Type::IntTy : Type::UIntTy; unsigned TempReg = emitIntegerCast (BB, IP, OldHalfTy, SrcReg, - NewHalfTy, DestReg+1); + NewHalfTy, DestReg+1, true); if (newTy->isSigned ()) { BuildMI (*BB, IP, V8::SRAri, 2, DestReg).addReg (TempReg) .addZImm (31); From gaeke at cs.uiuc.edu Tue Dec 14 03:10:27 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 14 Dec 2004 03:10:27 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV8/README.txt Message-ID: <200412140910.DAA07142@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV8: README.txt updated: 1.35 -> 1.36 --- Log message: The mystery of Olden/tsp solved, and more opportunities for speedup. --- Diffs of the changes: (+7 -1) Index: llvm/lib/Target/SparcV8/README.txt diff -u llvm/lib/Target/SparcV8/README.txt:1.35 llvm/lib/Target/SparcV8/README.txt:1.36 --- llvm/lib/Target/SparcV8/README.txt:1.35 Tue Dec 14 02:21:02 2004 +++ llvm/lib/Target/SparcV8/README.txt Tue Dec 14 03:10:10 2004 @@ -68,5 +68,11 @@ * We can fold small constant offsets into the %hi/%lo references to constant pool addresses as well. -$Date: 2004/12/14 08:21:02 $ +* Directly support select instructions, and fold setcc instructions into them + where possible. I think this is what afflicts the inner loop of Olden/tsp + (hot block = tsp():no_exit.1.i, overall GCC/LLC = 0.03). + +* Generate fsqrtd for calls to sqrt() (~ 4% speedup on Olden/tsp). + +$Date: 2004/12/14 09:10:10 $ From reid at x10sys.com Tue Dec 14 12:42:23 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 12:42:23 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412141842.MAA22124@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.14 -> 1.15 --- Log message: Add the getMagicNumber method. Patch contributed by Henrik Bach. Thanks Henrik! --- Diffs of the changes: (+19 -0) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.14 llvm/lib/System/Win32/Path.cpp:1.15 --- llvm/lib/System/Win32/Path.cpp:1.14 Mon Dec 13 23:26:43 2004 +++ llvm/lib/System/Win32/Path.cpp Tue Dec 14 12:42:13 2004 @@ -565,6 +565,25 @@ return true; } +bool Path::getMagicNumber(std::string& Magic, unsigned len) const { + if (!isFile()) + return false; + assert(len < 1024 && "Request for magic string too long"); + char* buf = (char*) alloca(1 + len); + std::ofstream ofs(path.c_str(),std::ofstream::in); + if (!ofs.is_open()) + return false; + std::ifstream ifs(path.c_str()); + if (!ifs.is_open()) + return false; + ifs.read(buf, len); + ofs.close(); + ifs.close(); + buf[len] = '\0'; + Magic = buf; + return true; +} + } } From lattner at cs.uiuc.edu Tue Dec 14 13:17:32 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Dec 2004 13:17:32 -0600 Subject: [llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/FreeBench/distray/distray.c Message-ID: <200412141917.iBEJHW0Y017934@apoc.cs.uiuc.edu> Changes in directory llvm-test/MultiSource/Benchmarks/FreeBench/distray: distray.c updated: 1.1 -> 1.2 --- Log message: Reduce the precision of the output, avoiding spurious FP comparison failures. --- Diffs of the changes: (+3 -3) Index: llvm-test/MultiSource/Benchmarks/FreeBench/distray/distray.c diff -u llvm-test/MultiSource/Benchmarks/FreeBench/distray/distray.c:1.1 llvm-test/MultiSource/Benchmarks/FreeBench/distray/distray.c:1.2 --- llvm-test/MultiSource/Benchmarks/FreeBench/distray/distray.c:1.1 Sat Oct 11 16:18:47 2003 +++ llvm-test/MultiSource/Benchmarks/FreeBench/distray/distray.c Tue Dec 14 13:17:16 2004 @@ -439,9 +439,9 @@ /***...write image to stdout...***/ for (i=0 ; i<3*WIDTH*HEIGHT ; ) { - fputc( memory[i++], stdout); - fputc( memory[i++], stdout); - fputc( memory[i++], stdout); + fputc( memory[i++]&~1, stdout); + fputc( memory[i++]&~1, stdout); + fputc( memory[i++]&~1, stdout); } return 0; /***...ANSI C wants main to return an int...***/ From lattner at cs.uiuc.edu Tue Dec 14 14:08:22 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Dec 2004 14:08:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp Message-ID: <200412142008.iBEK8MKH019895@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.294 -> 1.295 --- Log message: Constant exprs are not efficiently negatable in practice. This disables turning X - (constantexpr) into X + (-constantexpr) among other things. --- Diffs of the changes: (+3 -4) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.294 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.295 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.294 Sun Dec 12 15:48:58 2004 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Tue Dec 14 14:08:06 2004 @@ -309,10 +309,9 @@ if (BinaryOperator::isNeg(V)) return BinaryOperator::getNegArgument(cast(V)); - // Constants can be considered to be negated values if they can be folded... - if (Constant *C = dyn_cast(V)) - if (!isa(C)) - return ConstantExpr::getNeg(C); + // Constants can be considered to be negated values if they can be folded. + if (ConstantInt *C = dyn_cast(V)) + return ConstantExpr::getNeg(C); return 0; } From lattner at cs.uiuc.edu Tue Dec 14 14:15:46 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Dec 2004 14:15:46 -0600 Subject: [llvm-commits] CVS: poolalloc/test/TEST.poolalloc.Makefile Message-ID: <200412142015.iBEKFkDL023954@apoc.cs.uiuc.edu> Changes in directory poolalloc/test: TEST.poolalloc.Makefile updated: 1.34 -> 1.35 --- Log message: Adjust to changes in dir structure --- Diffs of the changes: (+1 -1) Index: poolalloc/test/TEST.poolalloc.Makefile diff -u poolalloc/test/TEST.poolalloc.Makefile:1.34 poolalloc/test/TEST.poolalloc.Makefile:1.35 --- poolalloc/test/TEST.poolalloc.Makefile:1.34 Thu Nov 11 04:13:00 2004 +++ poolalloc/test/TEST.poolalloc.Makefile Tue Dec 14 14:15:36 2004 @@ -21,7 +21,7 @@ RELDIR := $(subst $(PROGDIR),,$(CURDIR)) # Pool allocator pass shared object -PA_SO := $(PROJECT_DIR)/lib/Debug/libpoolalloc$(SHLIBEXT) +PA_SO := $(PROJECT_DIR)/Debug/lib/libpoolalloc$(SHLIBEXT) # Pool allocator runtime library #PA_RT := $(PROJECT_DIR)/lib/Bytecode/libpoolalloc_fl_rt.bc From lattner at cs.uiuc.edu Tue Dec 14 14:16:34 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Dec 2004 14:16:34 -0600 Subject: [llvm-commits] CVS: poolalloc/lib/PoolAllocate/PoolAllocate.cpp PoolAllocate.h TransformFunctionBody.cpp Message-ID: <200412142016.iBEKGYvf024204@apoc.cs.uiuc.edu> Changes in directory poolalloc/lib/PoolAllocate: PoolAllocate.cpp updated: 1.94 -> 1.95 PoolAllocate.h updated: 1.32 -> 1.33 TransformFunctionBody.cpp updated: 1.33 -> 1.34 --- Log message: Refactor a bunch of code to make it easier to understand. Switch from std::set> to multimap. --- Diffs of the changes: (+164 -158) Index: poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.94 poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.95 --- poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.94 Mon Nov 15 15:05:09 2004 +++ poolalloc/lib/PoolAllocate/PoolAllocate.cpp Tue Dec 14 14:16:24 2004 @@ -386,8 +386,6 @@ return true; } - TargetData &TD = getAnalysis(); - std::cerr << "Pool allocating " << GlobalHeapNodes.size() << " global nodes!\n"; @@ -557,8 +555,8 @@ // Transform the body of the function now... collecting information about uses // of the pools. - std::set > PoolUses; - std::set > PoolFrees; + std::multimap PoolUses; + std::multimap PoolFrees; TransformBody(G, FI, PoolUses, PoolFrees, NewF); // Create pool construction/destruction code @@ -582,13 +580,16 @@ } static void DeleteIfIsPoolFree(Instruction *I, AllocaInst *PD, - std::set > &PoolFrees) { + std::multimap &PoolFrees) { + std::multimap::iterator PFI, PFE; if (CallInst *CI = dyn_cast(I)) - if (PoolFrees.count(std::make_pair(PD, CI))) { - PoolFrees.erase(std::make_pair(PD, CI)); - I->eraseFromParent(); - ++NumPoolFree; - } + for (tie(PFI,PFE) = PoolFrees.equal_range(PD); PFI != PFE; ++PFI) + if (PFI->second == I) { + PoolFrees.erase(PFI); + I->eraseFromParent(); + ++NumPoolFree; + return; + } } void PoolAllocate::CalculateLivePoolFreeBlocks(std::set&LiveBlocks, @@ -608,17 +609,57 @@ } } - -/// InitializeAndDestroyPools - This inserts calls to poolinit and pooldestroy -/// into the function to initialize and destroy the pools in the NodesToPA list. +/// InitializeAndDestroyPools- This inserts calls to poolinit and pooldestroy +/// into the function to initialize and destroy one pool. /// -void PoolAllocate::InitializeAndDestroyPools(Function &F, - const std::vector &NodesToPA, +void PoolAllocate::InitializeAndDestroyPool(Function &F, DSNode *Node, std::map &PoolDescriptors, - std::set > &PoolUses, - std::set > &PoolFrees) { - TargetData &TD = getAnalysis(); - + std::multimap &PoolUses, + std::multimap &PoolFrees) { + AllocaInst *PD = cast(PoolDescriptors[Node]); + + // Convert the PoolUses/PoolFrees sets into something specific to this pool: a + // set of which blocks are immediately using the pool. + std::set UsingBlocks; + + std::multimap::iterator PUI, PUE; + tie(PUI, PUE) = PoolUses.equal_range(PD); + for (; PUI != PUE; ++PUI) + UsingBlocks.insert(PUI->second->getParent()); + + // To calculate all of the basic blocks which require the pool to be + // initialized before, do a depth first search on the CFG from the using + // blocks. + std::set InitializedBefore; + std::set DestroyedAfter; + for (std::set::iterator I = UsingBlocks.begin(), + E = UsingBlocks.end(); I != E; ++I) { + for (df_ext_iterator > + DI = df_ext_begin(*I, InitializedBefore), + DE = df_ext_end(*I, InitializedBefore); DI != DE; ++DI) + /* empty */; + + for (idf_ext_iterator > + DI = idf_ext_begin(*I, DestroyedAfter), + DE = idf_ext_end(*I, DestroyedAfter); DI != DE; ++DI) + /* empty */; + } + // Now that we have created the sets, intersect them. + std::set LiveBlocks; + std::set_intersection(InitializedBefore.begin(),InitializedBefore.end(), + DestroyedAfter.begin(), DestroyedAfter.end(), + std::inserter(LiveBlocks, LiveBlocks.end())); + InitializedBefore.clear(); + DestroyedAfter.clear(); + + DEBUG(std::cerr << "POOL: " << PD->getName() << " information:\n"); + DEBUG(std::cerr << " Live in blocks: "); + DEBUG(for (std::set::iterator I = LiveBlocks.begin(), + E = LiveBlocks.end(); I != E; ++I) + std::cerr << (*I)->getName() << " "); + DEBUG(std::cerr << "\n"); + + std::vector PoolInitPoints; std::vector PoolDestroyPoints; @@ -635,100 +676,32 @@ if (isa(BB->getTerminator()) || isa(BB->getTerminator())) PoolDestroyPoints.push_back(BB->getTerminator()); - } - - std::set AllocasHandled; - - // Insert all of the poolinit/destroy calls into the function. - for (unsigned i = 0, e = NodesToPA.size(); i != e; ++i) { - DSNode *Node = NodesToPA[i]; - - if (isa(PoolDescriptors[Node]) || - isa(PoolDescriptors[Node])) - continue; - - assert(isa(PoolDescriptors[Node]) && "Why pool allocate this?"); - AllocaInst *PD = cast(PoolDescriptors[Node]); - - std::set >::iterator XUI = - PoolUses.lower_bound(std::make_pair(PD, (Instruction*)0)); - bool HasUse = XUI != PoolUses.end() && XUI->first == PD; - - std::set >::iterator XUI2 = - PoolFrees.lower_bound(std::make_pair(PD, (CallInst*)0)); - bool HasFree = XUI2 != PoolFrees.end() && XUI2->first == PD; - - // FIXME: Turn this into an assert and fix the problem!! - //assert(HasUse && "Pool is not used, but is marked heap?!"); - if (!HasUse && !HasFree) continue; - if (!AllocasHandled.insert(PD).second) continue; - - ++NumPools; - if (!Node->isNodeCompletelyFolded()) - ++NumTSPools; - - // Convert the PoolUses/PoolFrees sets into something specific to this - // pool. - std::set UsingBlocks; - - std::set >::iterator PUI = - PoolUses.lower_bound(std::make_pair(PD, (Instruction*)0)); - if (PUI != PoolUses.end() && PUI->first < PD) ++PUI; - for (; PUI != PoolUses.end() && PUI->first == PD; ++PUI) - UsingBlocks.insert(PUI->second->getParent()); - - // To calculate all of the basic blocks which require the pool to be - // initialized before, do a depth first search on the CFG from the using - // blocks. - std::set InitializedBefore; - std::set DestroyedAfter; - for (std::set::iterator I = UsingBlocks.begin(), - E = UsingBlocks.end(); I != E; ++I) { - for (df_ext_iterator > - DI = df_ext_begin(*I, InitializedBefore), - DE = df_ext_end(*I, InitializedBefore); DI != DE; ++DI) - /* empty */; - - for (idf_ext_iterator > - DI = idf_ext_begin(*I, DestroyedAfter), - DE = idf_ext_end(*I, DestroyedAfter); DI != DE; ++DI) - /* empty */; - } - // Now that we have created the sets, intersect them. - std::set LiveBlocks; - std::set_intersection(InitializedBefore.begin(),InitializedBefore.end(), - DestroyedAfter.begin(), DestroyedAfter.end(), - std::inserter(LiveBlocks, LiveBlocks.end())); - InitializedBefore.clear(); - DestroyedAfter.clear(); - - // Keep track of the blocks we have inserted poolinit/destroy in + } else { + // Keep track of the blocks we have inserted poolinit/destroy into. std::set PoolInitInsertedBlocks, PoolDestroyInsertedBlocks; - - DEBUG(std::cerr << "POOL: " << PD->getName() << " information:\n"); - DEBUG(std::cerr << " Live in blocks: "); + for (std::set::iterator I = LiveBlocks.begin(), E = LiveBlocks.end(); I != E; ++I) { BasicBlock *BB = *I; TerminatorInst *Term = BB->getTerminator(); - DEBUG(std::cerr << BB->getName() << " "); // Check the predecessors of this block. If any preds are not in the // set, or if there are no preds, insert a pool init. bool AllIn, NoneIn; AllOrNoneInSet(pred_begin(BB), pred_end(BB), LiveBlocks, AllIn, NoneIn); - + if (NoneIn) { if (!PoolInitInsertedBlocks.count(BB)) { BasicBlock::iterator It = BB->begin(); +#if 0 // Move through all of the instructions not in the pool while (!PoolUses.count(std::make_pair(PD, It))) // Advance past non-users deleting any pool frees that we run // across. DeleteIfIsPoolFree(It++, PD, PoolFrees); - if (!DisableInitDestroyOpt) - PoolInitPoints.push_back(It); +#endif + PoolInitPoints.push_back(It); PoolInitInsertedBlocks.insert(BB); } } else if (!AllIn) { @@ -739,10 +712,9 @@ if (SplitCriticalEdge(BB, PI)) // If the critical edge was split, *PI was invalidated goto TryAgainPred; - + // Insert at the end of the predecessor, before the terminator. - if (!DisableInitDestroyOpt) - PoolInitPoints.push_back((*PI)->getTerminator()); + PoolInitPoints.push_back((*PI)->getTerminator()); PoolInitInsertedBlocks.insert(*PI); } } @@ -751,19 +723,20 @@ // not in the set, insert a destroy in this block. AllOrNoneInSet(succ_begin(BB), succ_end(BB), LiveBlocks, AllIn, NoneIn); - + if (NoneIn) { // Insert before the terminator. if (!PoolDestroyInsertedBlocks.count(BB)) { BasicBlock::iterator It = Term; - // Rewind to the first using insruction + // Rewind to the first using instruction. +#if 0 while (!PoolUses.count(std::make_pair(PD, It))) DeleteIfIsPoolFree(It--, PD, PoolFrees); - +#endif + // Insert after the first using instruction - if (!DisableInitDestroyOpt) - PoolDestroyPoints.push_back(++It); + PoolDestroyPoints.push_back(++It); PoolDestroyInsertedBlocks.insert(BB); } } else if (!AllIn) { @@ -773,64 +746,92 @@ !PoolDestroyInsertedBlocks.count(*SI)) { // If this edge is critical, split it. SplitCriticalEdge(BB, SI); - + // Insert at entry to the successor, but after any PHI nodes. BasicBlock::iterator It = (*SI)->begin(); while (isa(It)) ++It; - if (!DisableInitDestroyOpt) - PoolDestroyPoints.push_back(It); + PoolDestroyPoints.push_back(It); PoolDestroyInsertedBlocks.insert(*SI); } } } - DEBUG(std::cerr << "\n Init in blocks: "); + } - // Insert the calls to initialize the pool. - unsigned ElSizeV = Heuristic::getRecommendedSize(Node); - Value *ElSize = ConstantUInt::get(Type::UIntTy, ElSizeV); - unsigned AlignV = Heuristic::getRecommendedAlignment(Node); - Value *Align = ConstantUInt::get(Type::UIntTy, AlignV); - - for (unsigned i = 0, e = PoolInitPoints.size(); i != e; ++i) { - new CallInst(PoolInit, make_vector((Value*)PD, ElSize, Align, 0), - "", PoolInitPoints[i]); - DEBUG(std::cerr << PoolInitPoints[i]->getParent()->getName() << " "); - } - if (!DisableInitDestroyOpt) - PoolInitPoints.clear(); + DEBUG(std::cerr << " Init in blocks: "); - DEBUG(std::cerr << "\n Destroy in blocks: "); + // Insert the calls to initialize the pool. + unsigned ElSizeV = Heuristic::getRecommendedSize(Node); + Value *ElSize = ConstantUInt::get(Type::UIntTy, ElSizeV); + unsigned AlignV = Heuristic::getRecommendedAlignment(Node); + Value *Align = ConstantUInt::get(Type::UIntTy, AlignV); + + for (unsigned i = 0, e = PoolInitPoints.size(); i != e; ++i) { + new CallInst(PoolInit, make_vector((Value*)PD, ElSize, Align, 0), + "", PoolInitPoints[i]); + DEBUG(std::cerr << PoolInitPoints[i]->getParent()->getName() << " "); + } + + DEBUG(std::cerr << "\n Destroy in blocks: "); + + // Loop over all of the places to insert pooldestroy's... + for (unsigned i = 0, e = PoolDestroyPoints.size(); i != e; ++i) { + // Insert the pooldestroy call for this pool. + new CallInst(PoolDestroy, make_vector((Value*)PD, 0), "", + PoolDestroyPoints[i]); + DEBUG(std::cerr << PoolDestroyPoints[i]->getParent()->getName()<<" "); + } + DEBUG(std::cerr << "\n\n"); + + // We are allowed to delete any poolfree's which occur between the last + // call to poolalloc, and the call to pooldestroy. Figure out which + // basic blocks have this property for this pool. + std::set PoolFreeLiveBlocks; + if (!DisablePoolFreeOpt) + CalculateLivePoolFreeBlocks(PoolFreeLiveBlocks, PD); + else + PoolFreeLiveBlocks = LiveBlocks; + + // Delete any pool frees which are not in live blocks, for correctness. + std::multimap::iterator PFI, PFE; + for (tie(PFI,PFE) = PoolFrees.equal_range(PD); PFI != PFE; ) { + CallInst *PoolFree = (PFI++)->second; + if (!LiveBlocks.count(PoolFree->getParent()) || + !PoolFreeLiveBlocks.count(PoolFree->getParent())) + DeleteIfIsPoolFree(PoolFree, PD, PoolFrees); + } +} - // Loop over all of the places to insert pooldestroy's... - for (unsigned i = 0, e = PoolDestroyPoints.size(); i != e; ++i) { - // Insert the pooldestroy call for this pool. - new CallInst(PoolDestroy, make_vector((Value*)PD, 0), "", - PoolDestroyPoints[i]); - DEBUG(std::cerr << PoolDestroyPoints[i]->getParent()->getName()<<" "); - } - DEBUG(std::cerr << "\n\n"); - // We are allowed to delete any poolfree's which occur between the last - // call to poolalloc, and the call to pooldestroy. Figure out which - // basic blocks have this property for this pool. - std::set PoolFreeLiveBlocks; - if (!DisablePoolFreeOpt) - CalculateLivePoolFreeBlocks(PoolFreeLiveBlocks, PD); - else - PoolFreeLiveBlocks = LiveBlocks; +/// InitializeAndDestroyPools - This inserts calls to poolinit and pooldestroy +/// into the function to initialize and destroy the pools in the NodesToPA list. +/// +void PoolAllocate::InitializeAndDestroyPools(Function &F, + const std::vector &NodesToPA, + std::map &PoolDescriptors, + std::multimap &PoolUses, + std::multimap &PoolFrees) { + std::set AllocasHandled; - if (!DisableInitDestroyOpt) - PoolDestroyPoints.clear(); + // Insert all of the poolinit/destroy calls into the function. + for (unsigned i = 0, e = NodesToPA.size(); i != e; ++i) { + DSNode *Node = NodesToPA[i]; - // Delete any pool frees which are not in live blocks, for correctness. - std::set >::iterator PFI = - PoolFrees.lower_bound(std::make_pair(PD, (CallInst*)0)); - if (PFI != PoolFrees.end() && PFI->first < PD) ++PFI; - for (; PFI != PoolFrees.end() && PFI->first == PD; ) { - CallInst *PoolFree = (PFI++)->second; - if (!LiveBlocks.count(PoolFree->getParent()) || - !PoolFreeLiveBlocks.count(PoolFree->getParent())) - DeleteIfIsPoolFree(PoolFree, PD, PoolFrees); - } + if (isa(PoolDescriptors[Node]) || + isa(PoolDescriptors[Node])) + continue; + + assert(isa(PoolDescriptors[Node]) && "Why pool allocate this?"); + AllocaInst *PD = cast(PoolDescriptors[Node]); + + // FIXME: Turn this into an assert and fix the problem!! + //assert(PoolUses.count(PD) && "Pool is not used, but is marked heap?!"); + if (!PoolUses.count(PD) && !PoolFrees.count(PD)) continue; + if (!AllocasHandled.insert(PD).second) continue; + + ++NumPools; + if (!Node->isNodeCompletelyFolded()) + ++NumTSPools; + + InitializeAndDestroyPool(F, Node, PoolDescriptors, PoolUses, PoolFrees); } } Index: poolalloc/lib/PoolAllocate/PoolAllocate.h diff -u poolalloc/lib/PoolAllocate/PoolAllocate.h:1.32 poolalloc/lib/PoolAllocate/PoolAllocate.h:1.33 --- poolalloc/lib/PoolAllocate/PoolAllocate.h:1.32 Mon Nov 15 15:05:09 2004 +++ poolalloc/lib/PoolAllocate/PoolAllocate.h Tue Dec 14 14:16:24 2004 @@ -187,8 +187,8 @@ std::map &PoolDescriptors); void TransformBody(DSGraph &g, PA::FuncInfo &fi, - std::set > &poolUses, - std::set > &poolFrees, + std::multimap &poolUses, + std::multimap &poolFrees, Function &F); /// InitializeAndDestroyPools - This inserts calls to poolinit and pooldestroy @@ -197,8 +197,13 @@ void InitializeAndDestroyPools(Function &F, const std::vector &NodesToPA, std::map &PoolDescriptors, - std::set > &PoolUses, - std::set > &PoolFrees); + std::multimap &PoolUses, + std::multimap &PoolFrees); + + void InitializeAndDestroyPool(Function &F, DSNode *Pool, + std::map &PoolDescriptors, + std::multimap &PoolUses, + std::multimap &PoolFrees); void CalculateLivePoolFreeBlocks(std::set &LiveBlocks,Value *PD); }; Index: poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp diff -u poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.33 poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.34 --- poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.33 Mon Nov 15 15:05:09 2004 +++ poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp Tue Dec 14 14:16:24 2004 @@ -40,15 +40,15 @@ // of which blocks require the memory in the pool to not be freed. This // does not include poolfree's. Note that this is only tracked for pools // which this is the home of, ie, they are Alloca instructions. - std::set > &PoolUses; + std::multimap &PoolUses; // PoolDestroys - For each pool, keep track of the actual poolfree calls // inserted into the code. This is seperated out from PoolUses. - std::set > &PoolFrees; + std::multimap &PoolFrees; FuncTransform(PoolAllocate &P, DSGraph &g, FuncInfo &fi, - std::set > &poolUses, - std::set > &poolFrees) + std::multimap &poolUses, + std::multimap &poolFrees) : PAInfo(P), G(g), FI(fi), PoolUses(poolUses), PoolFrees(poolFrees) { } @@ -111,8 +111,8 @@ } void PoolAllocate::TransformBody(DSGraph &g, PA::FuncInfo &fi, - std::set > &poolUses, - std::set > &poolFrees, + std::multimap &poolUses, + std::multimap &poolFrees, Function &F) { FuncTransform(*this, g, fi, poolUses, poolFrees).visit(F); } From gaeke at cs.uiuc.edu Tue Dec 14 14:34:46 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 14 Dec 2004 14:34:46 -0600 Subject: [llvm-commits] CVS: reopt/docs/ReoptUsersGuide.rtf Message-ID: <200412142034.OAA24898@zion.cs.uiuc.edu> Changes in directory reopt/docs: ReoptUsersGuide.rtf updated: 1.5 -> 1.6 --- Log message: Add section on machine-dependent parts of the reoptimizer. Other minor updates. --- Diffs of the changes: (+74 -25) Index: reopt/docs/ReoptUsersGuide.rtf diff -u reopt/docs/ReoptUsersGuide.rtf:1.5 reopt/docs/ReoptUsersGuide.rtf:1.6 --- reopt/docs/ReoptUsersGuide.rtf:1.5 Fri Oct 29 16:50:08 2004 +++ reopt/docs/ReoptUsersGuide.rtf Tue Dec 14 14:34:35 2004 @@ -70,6 +70,7 @@ \f0 - list LLVM assembly for a trace's basic blocks ( \f3 reopt/tools/dumptrace \f0 )\ + Machine-dependent parts of the reoptimizer\ Known problems with the current implementation\ UnpackTraceFunction generates inefficient code\ TraceJITEmitter is poorly integrated with the TraceCache\ @@ -80,7 +81,7 @@ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \f0\b0 \cf0 \ulnone \ -The reoptimizer is LLVM's dynamic optimization framework. It consists of three basic parts: a collection of profiling instrumentation passes, a runtime profiler and trace generator, and a runtime trace optimizer.\ +The reoptimizer is LLVM's dynamic optimization framework. It consists of three basic parts: a collection of profiling instrumentation passes, a runtime profiler and trace generator, and a runtime trace optimizer. For more general background information on the reoptimizer, read the presentation slides titled "The LLVM Reoptimizer" presented by Brian Gaeke on Dec. 6 2004, which should be available along with this manual.\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ul Link-time profiling instrumentation\ulnone \ @@ -90,8 +91,7 @@ * Function inlining ( \f3 lib/Transforms/IPO/InlineSimple.cpp \f0 )\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 Performing more inlining is supposed to increase the effectiveness of interprocedural tracing.\ +Performing more inlining is supposed to increase the effectiveness of interprocedural tracing.\ \ * Lower LLVM 'switch' instructions to branches ( \f3 lib/Transforms/Scalar/LowerSwitch.cpp @@ -118,16 +118,11 @@ \f3 reopt/lib/LightWtProfiling/FirstTrigger.cpp \f0 .\ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul Runtime profiler and trace generator\ulnone \ +\ul Runtime profiler and trace generator\ulnone \ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural - -\f1\b \cf0 [FIXME - not done.] -\f0\b0 For more information about the reoptimizer's instrumentation passes and runtime profiler, consult Anand Shukla's M.S. thesis, "Lightweight Cross-Procedure Tracing for Runtime Optimization", July 2003.\ +For more information about the reoptimizer's instrumentation passes and runtime profiler, consult Anand Shukla's M.S. thesis, "Lightweight Cross-Procedure Tracing for Runtime Optimization", July 2003.\ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ul Trace optimizer\ulnone \ +\ul Trace optimizer\ulnone \ \ See the section "How the trace optimizer works", below.\ \ @@ -382,10 +377,8 @@ -sli-threshold= \f5\i count \f0\i0 Number of iterations of SLI before path counters are sampled.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 The default is 50.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ + The default is 50.\ +\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ul Phase detection options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural @@ -399,11 +392,9 @@ -timer-int-s= \f5\i seconds \f0\i0 Interval (in seconds) between phase detection sweeps.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 The default is 3.0 seconds. You can provide a decimal fraction\ + The default is 3.0 seconds. You can provide a decimal fraction\ to this option.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 \ +\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ul Trace layout engine options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural @@ -434,18 +425,19 @@ -opt-trace-cache-size= \f5\i size \f0\i0 Trace cache size for optimized code\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f1\b [FIXME: what are the defaults for these? what are the units in which they are specified?]\ +\f1\b \cf0 [FIXME: what are the defaults for these? what are the units in which they are specified?]\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\f0\b0 \ +\f0\b0 \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ul Debugging options\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural \cf0 \ulnone -debug Turn on debugging printouts from TraceToFunction,\ UnpackTraceFunction, and the various other reoptimizer libraries\ (in addition to those available from the other options listed below).\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural -\cf0 -print-machineinstrs Print generated machine code for traces.\ + -print-machineinstrs Print generated machine code for traces.\ -skip-trace= \f5\i n \f0\i0 Don't optimize the @@ -493,7 +485,18 @@ \f3 \ul reopt/lib/TraceToFunction \f0 \ul )\ulnone \ \ -The first pass that runs over newly-identified Traces is the TraceToFunction pass, also known as the TraceFunctionBuilder. TraceToFunction has three major goals: first, to find the live-in and live-out sets from the trace; second, to remove the reoptimizer's first-level loop instrumentation from the trace, if it is found; and third, to construct a function containing the same code as the trace. This function is called the TraceFunction, and it is the principal output of the TraceToFunction pass.\ +The first pass that runs over newly-identified Traces is the TraceToFunction pass, also known as the TraceFunctionBuilder. It is called from optimizeTrace() when a new trace is available, and implemented in +\f3 reopt/lib/TraceToFunction/TraceToFunction.cpp +\f0 . TraceToFunction has three major goals: first, to find the live-in and live-out sets from the trace; second, to remove the reoptimizer's first-level loop instrumentation from the trace, if it is found; and third, to construct a function containing the same code as the trace. This function is called the TraceFunction, and it is the principal output of the TraceToFunction pass.\ +\ +\ul Principal functions that make up TraceToFunction\ulnone (in order of execution)\ +BuildTraceFunction() -- Runs the TraceFunctionBuilder Pass on a given Trace (calls each of the following)\ +buildFLIMap() -- identifies FLI blocks (using identifyFLIEdge()) on the trace so they can be removed\ +findAlternateEntryPoints() -- identifies entrances to the trace other than the trace entry BB\ +buildTraceLiveInSet(), buildTraceLiveOutSet() -- find LLVM Values which are live-in at entry to the trace and live-out at exits from the trace\ +fillInFunctionBody() -- inline (clone) the trace's BBs into the new Function (using cloneTraceBBsIntoFunction()), removes FLI (using threadFLIEdges()), then calls fixupFunctionBodyBB()\ +fixupFunctionBodyBB() -- adds compensation code at trace edges, makes cloned code internally consistent\ +fixupPhis() - removes off-trace sources from Phi nodes TraceToFunction\ \ A TraceFunction has several components besides the newly-generated LLVM Function containing the trace code. It also contains a pointer to the original LLVM Function which the trace came from; this is known as the trace's "matrix function". It also contains the trace's live-in and live-out sets (represented as vectors of LLVM Values), and mapping information relating LLVM Values in the matrix function to those in the TraceFunction. Also, since live-in and live-out values are expressed as arguments to the TraceFunction, there are separate maps that relate the TraceFunction's arguments to the live values that they represent.\ \ @@ -535,7 +538,13 @@ \f3 '-dregalloc=y -print-machineinstrs' \f0 flags to \f3 reopt-llc -\f0 , and save the output, so that you can look up the registers to which LLVM Values were allocated when you are single-stepping through traces.\ +\f0 , and save the output, so that you can look up the registers to which LLVM Values were allocated when you are single-stepping through traces. If you run +\f3 'gmake TEST=reopt' +\f0 with a debug build, the TEST.reopt.Makefile rules will save this information for each test in the file +\f3 'Output/ +\f4\i testname +\f3\i0 .reopt-llc.s.log' +\f0 .\ \ 2. Set your \f3 LLVM_REOPT @@ -656,6 +665,46 @@ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\f1\b \cf0 \ul \ulc0 Machine-dependent parts of the reoptimizer\ + +\f0\b0 \ulnone \ +In addition to the aspects listed individually below, almost all of the files below use "uint64_t" to hold pointer values at some point. These should be changed to use either "void *" or "uintptr_t". (There may be other parts of the code that also use "uint64_t" to hold pointers.)\ +\ +MappingInfo/ValueAllocState.cpp\ + - Assumes use of SparcV9 register allocator\ +LightWtProfiling/SecondTrigger.cpp\ + - Depends on libcpc.h (cputrack interface) from Solaris; could be ported to use PAPI\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 - Uses SparcV9 inline assembly for saving and restoring registers\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 - Assumes use of SparcV9 register allocator (uses %g regs)\ + - Contains hardcoded SparcV9 binary machine code fragments used for instrumentation\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural +\cf0 LightWtProfiling/FirstTrigger.cpp\ + - Assumes 32-bit instruction words\ + - Uses SparcV9 inline assembly for saving and restoring registers\ + - Uses "doFlush" to flush instruction cache after modifying instructions in memory\ +LightWtProfiling/SLI.cpp\ + - Assumes 32-bit instruction words\ + - Assumes use of SparcV9 register allocator (uses %g regs)\ + - Contains hardcoded SparcV9 binary machine code fragments used for instrumentation\ +LightWtProfiling/UnpackTraceFunction.cpp\ + - Assumes use of SparcV9 instruction set and register allocator (uses %g regs)\ + - Depends on exact sequences of code produced by SparcV9's CreateCodeToLoadConst() method\ +LightWtProfiling/scheduler.cpp\ + - Uses POSIX interval timers; only compiles correctly on Linux & Solaris\ +ScratchMemory/ScratchMemory.cpp\ + - Depends on assembler ".skip" directive.\ +TraceCache/InstrUtils.cpp\ + - Assumes use of SparcV9 instruction set\ + - Contains hardcoded SparcV9 binary machine code bit patterns used for identifying & constructing code\ +TraceCache/VirtualMem.cpp\ + - Contains hardcoded SparcV9 binary machine code bit patterns used for identifying & constructing code\ +TraceCache/TraceCache.cpp\ + - Uses "doFlush" to flush instruction cache after modifying instructions in memory\ +\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural + \f1\b \cf0 \ul Known problems with the current implementation\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardeftab720\ql\qnatural From gaeke at cs.uiuc.edu Tue Dec 14 14:36:40 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 14 Dec 2004 14:36:40 -0600 Subject: [llvm-commits] CVS: reopt/docs/index.html Message-ID: <200412142036.OAA25026@zion.cs.uiuc.edu> Changes in directory reopt/docs: index.html added (r1.1) --- Log message: Add Reopt documentation index. --- Diffs of the changes: (+27 -0) Index: reopt/docs/index.html diff -c /dev/null reopt/docs/index.html:1.1 *** /dev/null Tue Dec 14 14:36:40 2004 --- reopt/docs/index.html Tue Dec 14 14:36:30 2004 *************** *** 0 **** --- 1,27 ---- + + + + The LLVM Compiler Infrastructure Project + + + + + +
+ LLVM Reoptimizer +
+ + +
+
gaeke at uiuc.edu
+ + From lattner at cs.uiuc.edu Tue Dec 14 14:37:27 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Dec 2004 14:37:27 -0600 Subject: [llvm-commits] CVS: llvm-test/Makefile.programs Message-ID: <200412142037.iBEKbRIk029053@apoc.cs.uiuc.edu> Changes in directory llvm-test: Makefile.programs updated: 1.142 -> 1.143 --- Log message: This seems more portable --- Diffs of the changes: (+1 -1) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.142 llvm-test/Makefile.programs:1.143 --- llvm-test/Makefile.programs:1.142 Mon Nov 29 14:36:41 2004 +++ llvm-test/Makefile.programs Tue Dec 14 14:37:12 2004 @@ -560,7 +560,7 @@ GENERATEREPORT := $(BUILD_SRC_ROOT)/GenerateReport.pl report.$(TEST).raw.out: $(REPORT_DEPENDENCIES) $(TestMakefile) - gmake TEST=$(TEST) 2>&1 | tee $@ + $(MAKE) -j1 TEST=$(TEST) 2>&1 | tee $@ ifneq ($(TestReport),) report.$(TEST).txt: report.$(TEST).raw.out $(TestReport) $(GENERATEREPORT) From gaeke at cs.uiuc.edu Tue Dec 14 14:37:44 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Tue, 14 Dec 2004 14:37:44 -0600 Subject: [llvm-commits] CVS: reopt/docs/ReoptPresentation.pdf Message-ID: <200412142037.OAA25110@zion.cs.uiuc.edu> Changes in directory reopt/docs: ReoptPresentation.pdf added (r1.1) --- Log message: Keep copy of my presentation here. --- Diffs of the changes: (+0 -0) Index: reopt/docs/ReoptPresentation.pdf From reid at x10sys.com Tue Dec 14 16:07:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 16:07:40 -0600 Subject: [llvm-commits] CVS: llvm/docs/CFEBuildInstrs.html FAQ.html GettingStarted.html TestingGuide.html Message-ID: <200412142207.QAA27783@zion.cs.uiuc.edu> Changes in directory llvm/docs: CFEBuildInstrs.html updated: 1.33 -> 1.34 FAQ.html updated: 1.26 -> 1.27 GettingStarted.html updated: 1.93 -> 1.94 TestingGuide.html updated: 1.21 -> 1.22 --- Log message: Correct documentation to reflect the change in location of the CFE runtime libraries. They are now in $CFEINSTALL/lib not $CFEINSTALL/bytecode-lib. --- Diffs of the changes: (+15 -15) Index: llvm/docs/CFEBuildInstrs.html diff -u llvm/docs/CFEBuildInstrs.html:1.33 llvm/docs/CFEBuildInstrs.html:1.34 --- llvm/docs/CFEBuildInstrs.html:1.33 Fri Dec 10 09:47:17 2004 +++ llvm/docs/CFEBuildInstrs.html Tue Dec 14 16:07:29 2004 @@ -231,9 +231,9 @@ These are the commands you need.

  % gmake
- % mkdir $CFEINSTALL/bytecode-libs
+ % mkdir $CFEINSTALL/lib
  % gmake -C runtime install-bytecode
- % setenv LLVM_LIB_SEARCH_PATH $CFEINSTALL/bytecode-libs
+ % setenv LLVM_LIB_SEARCH_PATH $CFEINSTALL/lib
 
  • Optionally, build a symbol table for the newly installed runtime @@ -332,7 +332,7 @@ Brian Gaeke
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/10 15:47:17 $ + Last modified: $Date: 2004/12/14 22:07:29 $ Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.26 llvm/docs/FAQ.html:1.27 --- llvm/docs/FAQ.html:1.26 Wed Dec 8 12:01:27 2004 +++ llvm/docs/FAQ.html Tue Dec 14 16:07:29 2004 @@ -364,10 +364,10 @@ To fix it, verify that LLVM_LIB_SEARCH_PATH points to the correct directory and that libcrtend.a is inside. For pre-built LLVM GCC front ends, this should be the absolute path to -cfrontend/<platform>/llvm-gcc/bytecode-libs. If you've +cfrontend/<platform>/llvm-gcc/lib. If you've built your own LLVM GCC front end, then ensure that you've built and installed the libraries in llvm/runtime and have LLVM_LIB_SEARCH_PATH pointing -to the LLVMGCCDIR/bytecode-libs subdirectory. +to the $LLVMGCCDIR/lib subdirectory.

    @@ -460,7 +460,7 @@

    In order to find libcrtend.a, you must have the directory in which it lives in your LLVM_LIB_SEARCH_PATH environment variable. For the binary distribution of -the LLVM GCC front end, this will be the full path of the bytecode-libs +the LLVM GCC front end, this will be the full path of the lib directory inside of the LLVM GCC distribution.

    @@ -554,7 +554,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/08 18:01:27 $ + Last modified: $Date: 2004/12/14 22:07:29 $ Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.93 llvm/docs/GettingStarted.html:1.94 --- llvm/docs/GettingStarted.html:1.93 Fri Dec 10 09:47:17 2004 +++ llvm/docs/GettingStarted.html Tue Dec 14 16:07:29 2004 @@ -548,7 +548,7 @@ .cshrc or .profile.
    -
    LLVM_LIB_SEARCH_PATH=LLVMGCCDIR/bytecode-libs +
    LLVM_LIB_SEARCH_PATH=LLVMGCCDIR/lib
    This environment variable helps the LLVM GCC front end find bytecode libraries that it will need for compilation. @@ -806,10 +806,10 @@ LLVM_LIB_SEARCH_PATH environment variable in your startup shell scripts. This environment variable is used to locate "system" libraries like "-lc" and "-lm" when linking. This variable should be set to -the absolute path of the bytecode-libs subdirectory of the GCC front -end, or LLVMGCCDIR/bytecode-libs. For example, one might set +the absolute path of the lib subdirectory of the GCC front +end, or LLVMGCCDIR/lib. For example, one might set LLVM_LIB_SEARCH_PATH to -/home/vadve/lattner/local/x86/llvm-gcc/bytecode-libs for the x86 +/home/vadve/lattner/local/x86/llvm-gcc/lib for the x86 version of the GCC front end on our research machines.

    @@ -1503,7 +1503,7 @@ Chris Lattner
    Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/10 15:47:17 $ + Last modified: $Date: 2004/12/14 22:07:29 $ Index: llvm/docs/TestingGuide.html diff -u llvm/docs/TestingGuide.html:1.21 llvm/docs/TestingGuide.html:1.22 --- llvm/docs/TestingGuide.html:1.21 Fri Dec 10 09:47:17 2004 +++ llvm/docs/TestingGuide.html Tue Dec 14 16:07:29 2004 @@ -474,7 +474,7 @@

    -5 3 * * *       LLVM_LIB_SEARCH_PATH=.../llvm-gcc/bytecode-libs $HOME/llvm/utils/NightlyTest.pl -parallel -enable-linscan ...CVSREPOSTRING... $HOME/buildtest-X86 $HOME/cvs/testresults-X86
    +5 3 * * *       LLVM_LIB_SEARCH_PATH=.../llvm-gcc/lib $HOME/llvm/utils/NightlyTest.pl -parallel -enable-linscan ...CVSREPOSTRING... $HOME/buildtest-X86 $HOME/cvs/testresults-X86
     

    Or, you can create a shell script to encapsulate the running of the script. @@ -488,7 +488,7 @@ export LLVMGCCDIR=/proj/work/llvm/cfrontend/install export PATH=/proj/install/bin:$LLVMGCCDIR/bin:$PATH export LD_LIBRARY_PATH=/proj/install/lib -export LLVM_LIB_SEARCH_PATH=/proj/work/llvm/cfrontend/install/bytecode-libs +export LLVM_LIB_SEARCH_PATH=/proj/work/llvm/cfrontend/install/lib cd $BASE cp /proj/work/llvm/llvm/utils/NightlyTest.pl . nice ./NightlyTest.pl -nice -release -verbose -parallel -enable-linscan -noexternals @@ -513,7 +513,7 @@ John T. Criswell
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/10 15:47:17 $ + Last modified: $Date: 2004/12/14 22:07:29 $ From lattner at cs.uiuc.edu Tue Dec 14 16:41:36 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Dec 2004 16:41:36 -0600 Subject: [llvm-commits] CVS: llvm-test/TEST.nightly.report Message-ID: <200412142241.iBEMfaZ8024801@apoc.cs.uiuc.edu> Changes in directory llvm-test: TEST.nightly.report updated: 1.33 -> 1.34 --- Log message: Print user times in columns, not wall times. --- Diffs of the changes: (+5 -5) Index: llvm-test/TEST.nightly.report diff -u llvm-test/TEST.nightly.report:1.33 llvm-test/TEST.nightly.report:1.34 --- llvm-test/TEST.nightly.report:1.33 Sun Dec 12 11:10:44 2004 +++ llvm-test/TEST.nightly.report Tue Dec 14 16:41:21 2004 @@ -8,7 +8,7 @@ $SortCol = 0; $TrimRepeatedPrefix = 1; -my $WallTimeRE = "[A-Za-z0-9.: ]+\\(([0-9.]+) wall clock"; +my $WallTimeRE = "Time: ([0-9.]+) seconds \\([0-9.]+ wall clock"; # FormatTime - Convert a time from 1m23.45 into 83.45 sub FormatTime { @@ -61,11 +61,11 @@ ["Program" , '\'([^\']+)\' Program'], [], # Times - ["GCCAS" , "TEST-RESULT-compile: $WallTimeRE"], + ["GCCAS" , "TEST-RESULT-compile: .*$WallTimeRE"], ["Bytecode" , 'TEST-RESULT-compile: *([0-9]+)'], - ["LLC
    compile" , "TEST-RESULT-llc: $WallTimeRE"], - ["LLC-BETA
    compile" , "TEST-RESULT-llc-ls: $WallTimeRE"], - ["JIT
    codegen" , "TEST-RESULT-jit-comptime: $WallTimeRE"], + ["LLC
    compile" , "TEST-RESULT-llc: .*$WallTimeRE"], + ["LLC-BETA
    compile" , "TEST-RESULT-llc-ls: .*$WallTimeRE"], + ["JIT
    codegen" , "TEST-RESULT-jit-comptime: .*$WallTimeRE"], ["Machine
    code", 'TEST-RESULT-jit-machcode: *([0-9]+).*bytes of machine code'], [], ["GCC" , 'TEST-RESULT-nat-time: program\s*([.0-9m:]+)', \&FormatTime], From lattner at cs.uiuc.edu Tue Dec 14 16:43:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Dec 2004 16:43:12 -0600 Subject: [llvm-commits] CVS: llvm/utils/NightlyTest.pl Message-ID: <200412142243.iBEMhC51024816@apoc.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTest.pl updated: 1.81 -> 1.82 --- Log message: Use user time, not wall time, for optimizer time. --- Diffs of the changes: (+2 -2) Index: llvm/utils/NightlyTest.pl diff -u llvm/utils/NightlyTest.pl:1.81 llvm/utils/NightlyTest.pl:1.82 --- llvm/utils/NightlyTest.pl:1.81 Mon Dec 6 14:14:45 2004 +++ llvm/utils/NightlyTest.pl Tue Dec 14 16:42:59 2004 @@ -688,13 +688,13 @@ # Loop over all of the records, summarizing them into rows for the running # totals file. - my $WallTimeRE = "[A-Za-z0-9.: ]+\\(([0-9.]+) wall clock"; + my $WallTimeRE = "Time: ([0-9.]+) seconds \\([0-9.]+ wall clock"; foreach $Rec (@Records) { my $rNATTime = GetRegex 'TEST-RESULT-nat-time: program\s*([.0-9m]+)', $Rec; my $rCBETime = GetRegex 'TEST-RESULT-cbe-time: program\s*([.0-9m]+)', $Rec; my $rLLCTime = GetRegex 'TEST-RESULT-llc-time: program\s*([.0-9m]+)', $Rec; my $rJITTime = GetRegex 'TEST-RESULT-jit-time: program\s*([.0-9m]+)', $Rec; - my $rOptTime = GetRegex "TEST-RESULT-compile: $WallTimeRE", $Rec; + my $rOptTime = GetRegex "TEST-RESULT-compile: .*$WallTimeRE", $Rec; my $rBytecodeSize = GetRegex 'TEST-RESULT-compile: *([0-9]+)', $Rec; my $rMachCodeSize = GetRegex 'TEST-RESULT-jit-machcode: *([0-9]+).*bytes of machine code', $Rec; From reid at x10sys.com Tue Dec 14 16:44:15 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 16:44:15 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412142244.QAA28342@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.263 -> 1.264 --- Log message: Fix the default install directory of modules from / to $(libdir) ! Many thanks to Vladimir Merzliakov for pointing this out! --- Diffs of the changes: (+1 -1) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.263 llvm/Makefile.rules:1.264 --- llvm/Makefile.rules:1.263 Mon Dec 13 12:08:29 2004 +++ llvm/Makefile.rules Tue Dec 14 16:44:05 2004 @@ -510,7 +510,7 @@ ifdef BYTECODE_DESTINATION ModuleDestDir := $(BYTECODE_DESTINATION) else -ModuleDestDir := $(BYTECODE_DESTINATION) +ModuleDestDir := $(libdir) endif DestModule := $(ModuleDestDir)/$(MODULE_NAME).bc From lattner at cs.uiuc.edu Tue Dec 14 17:16:48 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue, 14 Dec 2004 17:16:48 -0600 Subject: [llvm-commits] CVS: poolalloc/lib/PoolAllocate/PoolAllocate.cpp Message-ID: <200412142316.iBENGmoP002771@apoc.cs.uiuc.edu> Changes in directory poolalloc/lib/PoolAllocate: PoolAllocate.cpp updated: 1.95 -> 1.96 --- Log message: Fix a bug in computation of # typesafe pools --- Diffs of the changes: (+5 -1) Index: poolalloc/lib/PoolAllocate/PoolAllocate.cpp diff -u poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.95 poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.96 --- poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.95 Tue Dec 14 14:16:24 2004 +++ poolalloc/lib/PoolAllocate/PoolAllocate.cpp Tue Dec 14 17:16:38 2004 @@ -482,9 +482,13 @@ // later. if (!IsMain) PoolDesc = new AllocaInst(PoolDescType, 0, "PD", InsertPoint); - else + else { PoolDesc = CreateGlobalPool(Pool.PoolSize, Pool.PoolAlignment, InsertPoint); + if (Pool.NodesInPool.size() == 1 && + !Pool.NodesInPool[0]->isNodeCompletelyFolded()) + ++NumTSPools; + } } for (unsigned N = 0, e = Pool.NodesInPool.size(); N != e; ++N) { PoolDescriptors[Pool.NodesInPool[N]] = PoolDesc; From reid at x10sys.com Tue Dec 14 18:14:12 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 18:14:12 -0600 Subject: [llvm-commits] CVS: llvm/docs/CFEBuildInstrs.html FAQ.html GettingStarted.html TestingGuide.html Message-ID: <200412150014.SAA31452@zion.cs.uiuc.edu> Changes in directory llvm/docs: CFEBuildInstrs.html updated: 1.34 -> 1.35 FAQ.html updated: 1.27 -> 1.28 GettingStarted.html updated: 1.94 -> 1.95 TestingGuide.html updated: 1.22 -> 1.23 --- Log message: Remove most references to LLVM_LIB_SEARCH_PATH. It now only exists in the GettingStarted.html document in the environment section and only as an optional feature. --- Diffs of the changes: (+21 -65) Index: llvm/docs/CFEBuildInstrs.html diff -u llvm/docs/CFEBuildInstrs.html:1.34 llvm/docs/CFEBuildInstrs.html:1.35 --- llvm/docs/CFEBuildInstrs.html:1.34 Tue Dec 14 16:07:29 2004 +++ llvm/docs/CFEBuildInstrs.html Tue Dec 14 18:14:01 2004 @@ -132,8 +132,6 @@ % cd build % ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \ --disable-shared --enable-languages=c,c++ - % gmake - % setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc % gmake all; gmake install @@ -143,8 +141,6 @@ % cd build % ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \ --disable-shared --enable-languages=c,c++ --disable-c-mbchar - % gmake - % setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc % gmake all; gmake install @@ -163,8 +159,6 @@ % ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \ --disable-shared --enable-languages=c,c++ --host=sparcv9-sun-solaris2.8 \ --disable-c-mbchar - % gmake - % setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc % gmake all; gmake install @@ -233,7 +227,6 @@ % gmake % mkdir $CFEINSTALL/lib % gmake -C runtime install-bytecode - % setenv LLVM_LIB_SEARCH_PATH $CFEINSTALL/lib

  • Optionally, build a symbol table for the newly installed runtime @@ -332,7 +325,7 @@ Brian Gaeke
    LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/14 22:07:29 $ + Last modified: $Date: 2004/12/15 00:14:01 $ Index: llvm/docs/FAQ.html diff -u llvm/docs/FAQ.html:1.27 llvm/docs/FAQ.html:1.28 --- llvm/docs/FAQ.html:1.27 Tue Dec 14 16:07:29 2004 +++ llvm/docs/FAQ.html Tue Dec 14 18:14:01 2004 @@ -347,31 +347,6 @@

    -

    -When I use the test suite, all of the C Backend tests fail. What is -wrong? -

    -
    - -
    -

    -If you build LLVM and the C Backend tests fail in llvm/test/Programs, -then chances are good that the directory pointed to by the LLVM_LIB_SEARCH_PATH -environment variable does not contain the libcrtend.a library. -

    - -

    -To fix it, verify that LLVM_LIB_SEARCH_PATH points to the correct directory -and that libcrtend.a is inside. For pre-built LLVM GCC front ends, this -should be the absolute path to -cfrontend/<platform>/llvm-gcc/lib. If you've -built your own LLVM GCC front end, then ensure that you've built and installed -the libraries in llvm/runtime and have LLVM_LIB_SEARCH_PATH pointing -to the $LLVMGCCDIR/lib subdirectory. -

    -
    - -

    After CVS update, rebuilding gives the error "No rule to make target".

    @@ -458,11 +433,12 @@

    -In order to find libcrtend.a, you must have the directory in which it lives in -your LLVM_LIB_SEARCH_PATH environment variable. For the binary distribution of -the LLVM GCC front end, this will be the full path of the lib -directory inside of the LLVM GCC distribution. -

    +The only way this can happen is if you haven't installed the runtime library. To +correct this, do:

    +
    +  % cd llvm/runtime
    +  % make clean ; make install-bytecode
    +
    @@ -554,7 +530,7 @@ src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/14 22:07:29 $ + Last modified: $Date: 2004/12/15 00:14:01 $ Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.94 llvm/docs/GettingStarted.html:1.95 --- llvm/docs/GettingStarted.html:1.94 Tue Dec 14 16:07:29 2004 +++ llvm/docs/GettingStarted.html Tue Dec 14 18:14:01 2004 @@ -185,7 +185,6 @@
  • Build the LLVM Suite:
      -
    1. Set your LLVM_LIB_SEARCH_PATH environment variable.
    2. gmake -k |& tee gnumake.out    # this is csh or tcsh syntax
    3. If you get an "internal compiler error (ICE)" see below.
    4. @@ -548,17 +547,16 @@ .cshrc or .profile.
      -
      LLVM_LIB_SEARCH_PATH=LLVMGCCDIR/lib -
      - This environment variable helps the LLVM GCC front end find bytecode - libraries that it will need for compilation. -

      - -

      alias llvmgcc LLVMGCCDIR/bin/gcc -
      alias llvmg++ LLVMGCCDIR/bin/g++ -
      - These aliases allow you to use the LLVM C and C++ front ends without putting - them in your PATH or typing in their complete pathnames. +
      LLVM_LIB_SEARCH_PATH=/path/to/your/bytecode/libs
      +
      This environment variable helps LLVM linking tools find the locations + of your bytecode libraries. It is optional and provided only a convenience + since you can specify the paths using the -L options of the tools.
      + +
      alias llvmgcc LLVMGCCDIR/bin/gcc
      +
      alias llvmg++ LLVMGCCDIR/bin/g++
      +
      These aliases allow you to use the LLVM C and C++ front ends + without putting them in your PATH or typing in their complete + pathnames.
      @@ -802,16 +800,6 @@

    -

    In addition to running configure, you must set the -LLVM_LIB_SEARCH_PATH environment variable in your startup shell -scripts. This environment variable is used to locate "system" libraries like -"-lc" and "-lm" when linking. This variable should be set to -the absolute path of the lib subdirectory of the GCC front -end, or LLVMGCCDIR/lib. For example, one might set -LLVM_LIB_SEARCH_PATH to -/home/vadve/lattner/local/x86/llvm-gcc/lib for the x86 -version of the GCC front end on our research machines.

    - @@ -1503,7 +1491,7 @@ Chris Lattner
    Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/14 22:07:29 $ + Last modified: $Date: 2004/12/15 00:14:01 $ Index: llvm/docs/TestingGuide.html diff -u llvm/docs/TestingGuide.html:1.22 llvm/docs/TestingGuide.html:1.23 --- llvm/docs/TestingGuide.html:1.22 Tue Dec 14 16:07:29 2004 +++ llvm/docs/TestingGuide.html Tue Dec 14 18:14:01 2004 @@ -474,7 +474,7 @@

    -5 3 * * *       LLVM_LIB_SEARCH_PATH=.../llvm-gcc/lib $HOME/llvm/utils/NightlyTest.pl -parallel -enable-linscan ...CVSREPOSTRING... $HOME/buildtest-X86 $HOME/cvs/testresults-X86
    +5 3 * * *  $HOME/llvm/utils/NightlyTest.pl -parallel -enable-linscan ...CVSREPOSTORY... $HOME/buildtest-X86 $HOME/cvs/testresults-X86
     

    Or, you can create a shell script to encapsulate the running of the script. @@ -488,7 +488,6 @@ export LLVMGCCDIR=/proj/work/llvm/cfrontend/install export PATH=/proj/install/bin:$LLVMGCCDIR/bin:$PATH export LD_LIBRARY_PATH=/proj/install/lib -export LLVM_LIB_SEARCH_PATH=/proj/work/llvm/cfrontend/install/lib cd $BASE cp /proj/work/llvm/llvm/utils/NightlyTest.pl . nice ./NightlyTest.pl -nice -release -verbose -parallel -enable-linscan -noexternals @@ -513,7 +512,7 @@ John T. Criswell
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/14 22:07:29 $ + Last modified: $Date: 2004/12/15 00:14:01 $ From reid at x10sys.com Tue Dec 14 19:42:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:42:07 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200412150142.TAA00437@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.38 -> 1.39 --- Log message: Add some system specific functions we use --- Diffs of the changes: (+9 -0) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.38 llvm/include/llvm/Config/config.h.in:1.39 --- llvm/include/llvm/Config/config.h.in:1.38 Sun Dec 12 20:58:28 2004 +++ llvm/include/llvm/Config/config.h.in Tue Dec 14 19:41:56 2004 @@ -179,9 +179,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the `mkdtemp' function. */ +#undef HAVE_MKDTEMP + /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP +/* Define to 1 if you have the `mktemp' function. */ +#undef HAVE_MKTEMP + /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP @@ -216,6 +222,9 @@ /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR +/* Define to 1 if you have the `realpath' function. */ +#undef HAVE_REALPATH + /* Define to 1 if you have the `rindex' function. */ #undef HAVE_RINDEX From reid at x10sys.com Tue Dec 14 19:42:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:42:07 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200412150142.TAA00440@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.150 -> 1.151 --- Log message: Add some system specific functions we use --- Diffs of the changes: (+5 -1) Index: llvm/configure diff -u llvm/configure:1.150 llvm/configure:1.151 --- llvm/configure:1.150 Sun Dec 12 20:16:51 2004 +++ llvm/configure Tue Dec 14 19:41:56 2004 @@ -26617,7 +26617,11 @@ -for ac_func in backtrace getcwd gettimeofday isatty getrusage mkstemp + + + +for ac_func in backtrace getcwd gettimeofday isatty getrusage mkstemp mktemp + mkdtemp realpath do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 From reid at x10sys.com Tue Dec 14 19:42:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:42:07 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200412150142.TAA00443@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.141 -> 1.142 --- Log message: Add some system specific functions we use --- Diffs of the changes: (+2 -1) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.141 llvm/autoconf/configure.ac:1.142 --- llvm/autoconf/configure.ac:1.141 Sun Dec 12 20:16:51 2004 +++ llvm/autoconf/configure.ac Tue Dec 14 19:41:56 2004 @@ -409,7 +409,8 @@ dnl=== dnl===-----------------------------------------------------------------------=== -AC_CHECK_FUNCS([backtrace getcwd gettimeofday isatty getrusage mkstemp]) +AC_CHECK_FUNCS([backtrace getcwd gettimeofday isatty getrusage mkstemp mktemp + mkdtemp realpath]) AC_CHECK_FUNCS([strdup strtoq strtoll]) AC_C_PRINTF_A AC_FUNC_ALLOCA From reid at x10sys.com Tue Dec 14 19:47:05 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:47:05 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/FileUtilities.h Message-ID: <200412150147.TAA00596@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: FileUtilities.h updated: 1.24 -> 1.25 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Remove getUniqueFilename and CopyFile. These are now implemented by sys::Path::makeUnique and sys::CopyFile, respectively. --- Diffs of the changes: (+0 -11) Index: llvm/include/llvm/Support/FileUtilities.h diff -u llvm/include/llvm/Support/FileUtilities.h:1.24 llvm/include/llvm/Support/FileUtilities.h:1.25 --- llvm/include/llvm/Support/FileUtilities.h:1.24 Mon Dec 13 14:08:14 2004 +++ llvm/include/llvm/Support/FileUtilities.h Tue Dec 14 19:46:54 2004 @@ -28,11 +28,6 @@ bool DiffFiles(const std::string &FileA, const std::string &FileB, std::string *Error = 0); -/// CopyFile - Copy the specified source file to the specified destination, -/// overwriting destination if it exists. This returns true on failure. -/// -bool CopyFile(const std::string &Dest, const std::string &Src); - /// MoveFileOverIfUpdated - If the file specified by New is different than Old, /// or if Old does not exist, move the New file over the Old file. Otherwise, /// remove the New file. @@ -43,12 +38,6 @@ /// void removeFile(const std::string &Filename); -/// getUniqueFilename - Return a filename with the specified prefix. If the -/// file does not exist yet, return it, otherwise add a suffix to make it -/// unique. -/// -std::string getUniqueFilename(const std::string &FilenameBase); - /// FDHandle - Simple handle class to make sure a file descriptor gets closed /// when the object is destroyed. This handle acts similarly to an /// std::auto_ptr, in that the copy constructor and assignment operators From reid at x10sys.com Tue Dec 14 19:47:06 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:47:06 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200412150147.TAA00600@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.31 -> 1.32 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Remove getUniqueFilename and CopyFile. These are now implemented by sys::Path::makeUnique and sys::CopyFile, respectively. --- Diffs of the changes: (+1 -88) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.31 llvm/lib/Support/FileUtilities.cpp:1.32 --- llvm/lib/Support/FileUtilities.cpp:1.31 Mon Dec 13 14:08:14 2004 +++ llvm/lib/Support/FileUtilities.cpp Tue Dec 14 19:46:54 2004 @@ -13,18 +13,10 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/FileUtilities.h" -#include "llvm/Support/DataTypes.h" #include "llvm/System/Path.h" -#include "llvm/Config/unistd.h" -#include "llvm/Config/fcntl.h" -#include "llvm/Config/sys/types.h" -#include "llvm/Config/sys/stat.h" -#include "llvm/Config/sys/mman.h" -#include "llvm/Config/alloca.h" -#include -#include #include #include + using namespace llvm; /// DiffFiles - Compare the two files specified, returning true if they are @@ -58,42 +50,6 @@ return false; } - -/// CopyFile - Copy the specified source file to the specified destination, -/// overwriting destination if it exists. This returns true on failure. -/// -bool llvm::CopyFile(const std::string &Dest, const std::string &Src) { - FDHandle InFD(open(Src.c_str(), O_RDONLY)); - if (InFD == -1) return true; - - FileRemover FR(Dest); - - FDHandle OutFD(open(Dest.c_str(), O_WRONLY|O_CREAT, 0666)); - if (OutFD == -1) return true; - - char Buffer[16*1024]; - while (ssize_t Amt = read(InFD, Buffer, 16*1024)) { - if (Amt == -1) { - if (errno != EINTR) return true; // Error reading the file. - } else { - char *BufPtr = Buffer; - while (Amt) { - ssize_t AmtWritten = write(OutFD, BufPtr, Amt); - if (AmtWritten == -1) { - if (errno != EINTR) return true; // Error writing the file. - } else { - Amt -= AmtWritten; - BufPtr += AmtWritten; - } - } - } - } - - FR.releaseFile(); // Success! - return false; -} - - /// MoveFileOverIfUpdated - If the file specified by New is different than Old, /// or if Old does not exist, move the New file over the Old file. Otherwise, /// remove the New file. @@ -114,48 +70,6 @@ std::remove(Filename.c_str()); } -/// getUniqueFilename - Return a filename with the specified prefix. If the -/// file does not exist yet, return it, otherwise add a suffix to make it -/// unique. -/// -std::string llvm::getUniqueFilename(const std::string &FilenameBase) { - if (!std::ifstream(FilenameBase.c_str())) - return FilenameBase; // Couldn't open the file? Use it! - - // Create a pattern for mkstemp... - char *FNBuffer = new char[FilenameBase.size()+8]; - strcpy(FNBuffer, FilenameBase.c_str()); - strcpy(FNBuffer+FilenameBase.size(), "-XXXXXX"); - - // Agree on a temporary file name to use.... -#if defined(HAVE_MKSTEMP) && !defined(_MSC_VER) - int TempFD; - if ((TempFD = mkstemp(FNBuffer)) == -1) { - // FIXME: this should return an emtpy string or something and allow the - // caller to deal with the error! - std::cerr << "bugpoint: ERROR: Cannot create temporary file in the current " - << " directory!\n"; - exit(1); - } - - // We don't need to hold the temp file descriptor... we will trust that no one - // will overwrite/delete the file while we are working on it... - close(TempFD); -#else - // If we don't have mkstemp, use the old and obsolete mktemp function. - if (mktemp(FNBuffer) == 0) { - // FIXME: this should return an emtpy string or something and allow the - // caller to deal with the error! - std::cerr << "bugpoint: ERROR: Cannot create temporary file in the current " - << " directory!\n"; - exit(1); - } -#endif - - std::string Result(FNBuffer); - delete[] FNBuffer; - return Result; -} //===----------------------------------------------------------------------===// // FDHandle class implementation @@ -170,4 +84,3 @@ FD = fd; return *this; } - From reid at x10sys.com Tue Dec 14 19:50:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:50:24 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200412150150.TAA00700@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.16 -> 1.17 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Fix implementation and documentation about LLVMGCCDIR/bytecode-libs * Add the makeUnique method, replacement for getUniqueFilename in Support. * Add the sys::CopyFile function, replacement for CopyFile in Support. * Move GetLLVMConfigDir() into generic code area since its generic. --- Diffs of the changes: (+16 -1) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.16 llvm/include/llvm/System/Path.h:1.17 --- llvm/include/llvm/System/Path.h:1.16 Mon Dec 13 13:59:50 2004 +++ llvm/include/llvm/System/Path.h Tue Dec 14 19:50:13 2004 @@ -100,7 +100,8 @@ /// Construct a vector of sys::Path that contains the "standard" bytecode /// library paths suitable for linking into an llvm program. This function /// *must* return the value of LLVM_LIB_SEARCH_PATH as well as the values - /// of LLVM_LIBDIR and LLVMGCCDIR/bytecode-libs. It also must provide the + /// of LLVM_LIBDIR and LLVMGCCDIR/lib (if --with-llvmgccdir was specified + /// when LLVM was configured). It also must provide the /// System library paths as returned by GetSystemLibraryPaths. /// @brief Construct a list of directories in which bytecode could be /// found. @@ -487,6 +488,14 @@ /// @brief Remove the suffix from a path name. bool elideSuffix(); + /// The current Path name is made unique in the file system. Upon return, + /// the Path will have been changed to make a unique file in the file + /// system or it will not have been changed if the current path name is + /// already unique. + /// @throws std::string if an unrecoverable error occurs. + /// @brief Make the current path name unique in the file system. + void makeUnique(); + /// This method attempts to create a directory in the file system with the /// same name as the Path object. The \p create_parents parameter controls /// whether intermediate directories are created or not. if \p @@ -577,6 +586,12 @@ /// This utility function allows any memory block to be examined in order /// to determine its file type. LLVMFileType IdentifyFileType(const char*magic, unsigned length); + + /// This function can be used to copy the file specified by Src to the + /// file specified by Dest. If an error occurs, Dest is removed. + /// @throws std::string if an error opening or writing the files occurs. + /// @brief Copy one file to another. + void CopyFiles(const Path& Dest, const Path& Src); } inline std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath) { From reid at x10sys.com Tue Dec 14 19:50:24 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:50:24 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200412150150.TAA00697@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.21 -> 1.22 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Fix implementation and documentation about LLVMGCCDIR/bytecode-libs * Add the makeUnique method, replacement for getUniqueFilename in Support. * Add the sys::CopyFile function, replacement for CopyFile in Support. * Move GetLLVMConfigDir() into generic code area since its generic. --- Diffs of the changes: (+99 -21) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.21 llvm/lib/System/Unix/Path.cpp:1.22 --- llvm/lib/System/Unix/Path.cpp:1.21 Mon Dec 13 13:59:50 2004 +++ llvm/lib/System/Unix/Path.cpp Tue Dec 14 19:50:13 2004 @@ -87,7 +87,7 @@ } #ifdef LLVMGCCDIR { - Path tmpPath(std::string(LLVMGCCDIR) + "bytecode-libs/"); + Path tmpPath(std::string(LLVMGCCDIR) + "lib/"); if (tmpPath.readable()) Paths.push_back(tmpPath); } @@ -108,14 +108,6 @@ return Path("/etc/llvm/"); } -Path -Path::GetLLVMConfigDir() { - Path result; - if (result.setDirectory(LLVM_ETCDIR)) - return result; - return GetLLVMDefaultConfigDir(); -} - Path Path::GetUserHomeDirectory() { const char* home = getenv("HOME"); @@ -491,20 +483,19 @@ bool Path::createTemporaryFile() { // Make sure we're dealing with a file - if (!isFile()) return false; + if (!isFile()) + return false; - // Append the filename filler - char pathname[MAXPATHLEN]; - path.copy(pathname,MAXPATHLEN); - pathname[path.length()] = 0; - strcat(pathname,"XXXXXX"); - int fd = ::mkstemp(pathname); - if (fd < 0) { - ThrowErrno(path + ": Can't create temporary file"); + // Make this into a unique file name + makeUnique(); + + // create the file + int outFile = ::open(path.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0666); + if (outFile != -1) { + ::close(outFile); + return true; } - path = pathname; - ::close(fd); - return true; + return false; } bool @@ -565,6 +556,93 @@ return true; } +void +CopyFile(const sys::Path &Dest, const sys::Path &Src) { + int inFile = -1; + int outFile = -1; + try { + inFile = ::open(Src.c_str(), O_RDONLY); + if (inFile == -1) + ThrowErrno("Cannnot open source file to copy: " + Src.toString()); + + outFile = ::open(Dest.c_str(), O_WRONLY|O_CREAT, 0666); + if (outFile == -1) + ThrowErrno("Cannnot create destination file for copy: " +Dest.toString()); + + char Buffer[16*1024]; + while (ssize_t Amt = ::read(inFile, Buffer, 16*1024)) { + if (Amt == -1) { + if (errno != EINTR && errno != EAGAIN) + ThrowErrno("Can't read source file: " + Src.toString()); + } else { + char *BufPtr = Buffer; + while (Amt) { + ssize_t AmtWritten = ::write(outFile, BufPtr, Amt); + if (AmtWritten == -1) { + if (errno != EINTR && errno != EAGAIN) + ThrowErrno("Can't write destination file: " + Dest.toString()); + } else { + Amt -= AmtWritten; + BufPtr += AmtWritten; + } + } + } + } + ::close(inFile); + ::close(outFile); + } catch (...) { + if (inFile != -1) + ::close(inFile); + if (outFile != -1) + ::close(outFile); + throw; + } +} + +void +Path::makeUnique() { + if (!exists()) + return; // File doesn't exist already, just use it! + + // Append an XXXXXX pattern to the end of the file for use with mkstemp, + // mktemp or our own implementation. + char *FNBuffer = (char*) alloca(path.size()+8); + path.copy(FNBuffer,path.size()); + strcpy(FNBuffer+path.size(), "-XXXXXX"); + +#if defined(HAVE_MKSTEMP) + int TempFD; + if ((TempFD = mkstemp(FNBuffer)) == -1) { + ThrowErrno("Cannot make unique filename for '" + path + "'"); + } + + // We don't need to hold the temp file descriptor... we will trust that no one + // will overwrite/delete the file before we can open it again. + close(TempFD); + + // Save the name + path = FNBuffer; +#elif defined(HAVE_MKTEMP) + // If we don't have mkstemp, use the old and obsolete mktemp function. + if (mktemp(FNBuffer) == 0) { + ThrowErrno("Cannot make unique filename for '" + path + "'"); + } + + // Save the name + path = FNBuffer; +#else + // Okay, looks like we have to do it all by our lonesome. + static unsigned FCounter = 0; + unsigned offset = path.size() + 1; + while ( FCounter < 999999 && exists()) { + sprintf(FNBuffer+offset,"%06u",++FCounter); + path = FNBuffer; + } + if (FCounter > 999999) + throw std::string("Cannot make unique filename for '" + path + "'"); +#endif + +} } // vim: sw=2 From reid at x10sys.com Tue Dec 14 19:50:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:50:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412150150.TAA00705@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.15 -> 1.16 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Fix implementation and documentation about LLVMGCCDIR/bytecode-libs * Add the makeUnique method, replacement for getUniqueFilename in Support. * Add the sys::CopyFile function, replacement for CopyFile in Support. * Move GetLLVMConfigDir() into generic code area since its generic. --- Diffs of the changes: (+24 -1) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.15 llvm/lib/System/Win32/Path.cpp:1.16 --- llvm/lib/System/Win32/Path.cpp:1.15 Tue Dec 14 12:42:13 2004 +++ llvm/lib/System/Win32/Path.cpp Tue Dec 14 19:50:13 2004 @@ -158,7 +158,7 @@ } #ifdef LLVMGCCDIR { - Path tmpPath(std::string(LLVMGCCDIR) + "bytecode-libs/"); + Path tmpPath(std::string(LLVMGCCDIR) + "lib/"); if (tmpPath.readable()) Paths.push_back(tmpPath); } @@ -584,6 +584,29 @@ return true; } +void +CopyFile(const sys::Path &Dest, const sys::Path &Src) { + if (!::CopyFile(Src.c_str(), Dest.c_str(), false)) + ThrowError("Can't copy '" + Src.toString() + + "' to '" + Dest.toString() + "'"); +} + +void +Path::makeUnique() { + if (!exists()) + return; // File doesn't exist already, just use it! + + Path dir (*this); + dir.elideFile(); + std::string fname = this->getLast(); + + char* newName = alloca(MAX_PATH+1); + if (!GetTempFileName(dir.c_str(), fname.c_str(), 0, newName)) + ThrowError("Cannot make unique filename for '" + path + "'"); + + path = newName; +} + } } From reid at x10sys.com Tue Dec 14 19:50:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:50:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Path.cpp Message-ID: <200412150150.TAA00708@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Path.cpp updated: 1.11 -> 1.12 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Fix implementation and documentation about LLVMGCCDIR/bytecode-libs * Add the makeUnique method, replacement for getUniqueFilename in Support. * Add the sys::CopyFile function, replacement for CopyFile in Support. * Move GetLLVMConfigDir() into generic code area since its generic. --- Diffs of the changes: (+8 -0) Index: llvm/lib/System/Path.cpp diff -u llvm/lib/System/Path.cpp:1.11 llvm/lib/System/Path.cpp:1.12 --- llvm/lib/System/Path.cpp:1.11 Mon Dec 13 12:41:28 2004 +++ llvm/lib/System/Path.cpp Tue Dec 14 19:50:13 2004 @@ -23,6 +23,14 @@ //=== independent code. //===----------------------------------------------------------------------===// +Path +Path::GetLLVMConfigDir() { + Path result; + if (result.setDirectory(LLVM_ETCDIR)) + return result; + return GetLLVMDefaultConfigDir(); +} + LLVMFileType sys::IdentifyFileType(const char*magic, unsigned length) { assert(magic && "Invalid magic number string"); From reid at x10sys.com Tue Dec 14 19:52:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:52:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/ToolRunner.cpp Message-ID: <200412150152.TAA00755@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: ToolRunner.cpp updated: 1.34 -> 1.35 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Remove #inclusion of FileUtilities.h, not needed any more. * Convert getUniqueFilename -> sys::Pat::makeUnique() --- Diffs of the changes: (+17 -8) Index: llvm/lib/Support/ToolRunner.cpp diff -u llvm/lib/Support/ToolRunner.cpp:1.34 llvm/lib/Support/ToolRunner.cpp:1.35 --- llvm/lib/Support/ToolRunner.cpp:1.34 Mon Dec 13 17:43:44 2004 +++ llvm/lib/Support/ToolRunner.cpp Tue Dec 14 19:51:56 2004 @@ -30,7 +30,8 @@ OS << "\n"; // Rerun the compiler, capturing any error messages to print them. - std::string ErrorFilename = getUniqueFilename("error_messages"); + sys::Path ErrorFilename("error_messages"); + ErrorFilename.makeUnique(); RunProgramWithTimeout(ProgPath, Args, "/dev/null", ErrorFilename.c_str(), ErrorFilename.c_str()); @@ -43,7 +44,7 @@ ErrorFile.close(); } - removeFile(ErrorFilename); + removeFile(ErrorFilename.toString()); throw ToolExecutionError(OS.str()); } @@ -123,7 +124,9 @@ // LLC Implementation of AbstractIntepreter interface // void LLC::OutputAsm(const std::string &Bytecode, std::string &OutputAsmFile) { - OutputAsmFile = getUniqueFilename(Bytecode+".llc.s"); + sys::Path uniqueFile(Bytecode+".llc.s"); + uniqueFile.makeUnique(); + OutputAsmFile = uniqueFile.toString(); std::vector LLCArgs; LLCArgs.push_back (LLCPath.c_str()); @@ -265,7 +268,9 @@ void CBE::OutputC(const std::string &Bytecode, std::string &OutputCFile) { - OutputCFile = getUniqueFilename(Bytecode+".cbe.c"); + sys::Path uniqueFile(Bytecode+".cbe.c"); + uniqueFile.makeUnique(); + OutputCFile = uniqueFile.toString(); std::vector LLCArgs; LLCArgs.push_back (LLCPath.c_str()); @@ -361,7 +366,8 @@ } GCCArgs.push_back(ProgramFile.c_str()); // Specify the input filename... GCCArgs.push_back("-o"); - std::string OutputBinary = getUniqueFilename(ProgramFile+".gcc.exe"); + sys::Path OutputBinary (ProgramFile+".gcc.exe"); + OutputBinary.makeUnique(); GCCArgs.push_back(OutputBinary.c_str()); // Output to the right file... GCCArgs.push_back("-lm"); // Hard-code the math library... GCCArgs.push_back("-O2"); // Optimize the program a bit... @@ -392,14 +398,17 @@ std::cerr << "\n"; ); - FileRemover OutputBinaryRemover(OutputBinary); - return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], + FileRemover OutputBinaryRemover(OutputBinary.toString()); + return RunProgramWithTimeout(OutputBinary.toString(), &ProgramArgs[0], InputFile, OutputFile, OutputFile, Timeout); } int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, std::string &OutputFile) { - OutputFile = getUniqueFilename(InputFile+LTDL_SHLIB_EXT); + sys::Path uniqueFilename(InputFile+LTDL_SHLIB_EXT); + uniqueFilename.makeUnique(); + OutputFile = uniqueFilename.toString(); + // Compile the C/asm file into a shared object const char* GCCArgs[] = { GCCPath.c_str(), From reid at x10sys.com Tue Dec 14 19:52:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:52:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Message-ID: <200412150152.TAA00758@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveWriter.cpp updated: 1.11 -> 1.12 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Remove #inclusion of FileUtilities.h, not needed any more. * Convert getUniqueFilename -> sys::Pat::makeUnique() --- Diffs of the changes: (+0 -1) Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.11 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.12 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.11 Fri Dec 10 18:14:15 2004 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Tue Dec 14 19:51:56 2004 @@ -13,7 +13,6 @@ #include "ArchiveInternals.h" #include "llvm/Bytecode/Reader.h" -#include "llvm/Support/FileUtilities.h" #include "llvm/Support/Compressor.h" #include "llvm/System/Signals.h" #include From reid at x10sys.com Tue Dec 14 19:52:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:52:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/Debugger/ProgramInfo.cpp SourceFile.cpp Message-ID: <200412150152.TAA00763@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: ProgramInfo.cpp updated: 1.8 -> 1.9 SourceFile.cpp updated: 1.3 -> 1.4 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Remove #inclusion of FileUtilities.h, not needed any more. * Convert getUniqueFilename -> sys::Pat::makeUnique() --- Diffs of the changes: (+0 -2) Index: llvm/lib/Debugger/ProgramInfo.cpp diff -u llvm/lib/Debugger/ProgramInfo.cpp:1.8 llvm/lib/Debugger/ProgramInfo.cpp:1.9 --- llvm/lib/Debugger/ProgramInfo.cpp:1.8 Mon Dec 13 11:01:53 2004 +++ llvm/lib/Debugger/ProgramInfo.cpp Tue Dec 14 19:51:56 2004 @@ -20,7 +20,6 @@ #include "llvm/Module.h" #include "llvm/Debugger/SourceFile.h" #include "llvm/Debugger/SourceLanguage.h" -#include "llvm/Support/FileUtilities.h" #include "llvm/Support/SlowOperationInformer.h" #include "llvm/ADT/STLExtras.h" #include Index: llvm/lib/Debugger/SourceFile.cpp diff -u llvm/lib/Debugger/SourceFile.cpp:1.3 llvm/lib/Debugger/SourceFile.cpp:1.4 --- llvm/lib/Debugger/SourceFile.cpp:1.3 Sun Dec 12 20:59:15 2004 +++ llvm/lib/Debugger/SourceFile.cpp Tue Dec 14 19:51:56 2004 @@ -13,7 +13,6 @@ #include "llvm/Debugger/SourceFile.h" #include "llvm/Support/SlowOperationInformer.h" -#include "llvm/Support/FileUtilities.h" #include #include #include From reid at x10sys.com Tue Dec 14 19:53:19 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:53:19 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExecutionDriver.cpp Miscompilation.cpp OptimizerDriver.cpp Message-ID: <200412150153.TAA00791@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: ExecutionDriver.cpp updated: 1.48 -> 1.49 Miscompilation.cpp updated: 1.56 -> 1.57 OptimizerDriver.cpp updated: 1.24 -> 1.25 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Convert use of getUniqueFilename to sys::Path::makeUnique(); --- Diffs of the changes: (+34 -20) Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.48 llvm/tools/bugpoint/ExecutionDriver.cpp:1.49 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.48 Wed Sep 1 17:55:37 2004 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Tue Dec 14 19:53:08 2004 @@ -152,18 +152,19 @@ /// void BugDriver::compileProgram(Module *M) { // Emit the program to a bytecode file... - std::string BytecodeFile = getUniqueFilename("bugpoint-test-program.bc"); - if (writeProgramToFile(BytecodeFile, M)) { + sys::Path BytecodeFile ("bugpoint-test-program.bc"); + BytecodeFile.makeUnique(); + if (writeProgramToFile(BytecodeFile.toString(), M)) { std::cerr << ToolName << ": Error emitting bytecode to file '" << BytecodeFile << "'!\n"; exit(1); } // Remove the temporary bytecode file when we are done. - FileRemover BytecodeFileRemover(BytecodeFile); + FileRemover BytecodeFileRemover(BytecodeFile.toString()); // Actually compile the program! - Interpreter->compileProgram(BytecodeFile); + Interpreter->compileProgram(BytecodeFile.toString()); } @@ -181,7 +182,9 @@ bool CreatedBytecode = false; if (BytecodeFile.empty()) { // Emit the program to a bytecode file... - BytecodeFile = getUniqueFilename("bugpoint-test-program.bc"); + sys::Path uniqueFilename("bugpoint-test-program.bc"); + uniqueFilename.makeUnique(); + BytecodeFile = uniqueFilename.toString(); if (writeProgramToFile(BytecodeFile, Program)) { std::cerr << ToolName << ": Error emitting bytecode to file '" @@ -197,7 +200,9 @@ if (OutputFile.empty()) OutputFile = "bugpoint-execution-output"; // Check to see if this is a valid output filename... - OutputFile = getUniqueFilename(OutputFile); + sys::Path uniqueFile(OutputFile); + uniqueFile.makeUnique(); + OutputFile = uniqueFile.toString(); // Figure out which shared objects to run, if any. std::vector SharedObjs(AdditionalSOs); Index: llvm/tools/bugpoint/Miscompilation.cpp diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.56 llvm/tools/bugpoint/Miscompilation.cpp:1.57 --- llvm/tools/bugpoint/Miscompilation.cpp:1.56 Sun Dec 12 21:01:03 2004 +++ llvm/tools/bugpoint/Miscompilation.cpp Tue Dec 14 19:53:08 2004 @@ -733,33 +733,35 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe) { CleanupAndPrepareModules(BD, Test, Safe); - std::string TestModuleBC = getUniqueFilename("bugpoint.test.bc"); - if (BD.writeProgramToFile(TestModuleBC, Test)) { + sys::Path TestModuleBC("bugpoint.test.bc"); + TestModuleBC.makeUnique(); + if (BD.writeProgramToFile(TestModuleBC.toString(), Test)) { std::cerr << "Error writing bytecode to `" << TestModuleBC << "'\nExiting."; exit(1); } delete Test; // Make the shared library - std::string SafeModuleBC = getUniqueFilename("bugpoint.safe.bc"); + sys::Path SafeModuleBC("bugpoint.safe.bc"); + SafeModuleBC.makeUnique(); - if (BD.writeProgramToFile(SafeModuleBC, Safe)) { + if (BD.writeProgramToFile(SafeModuleBC.toString(), Safe)) { std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; exit(1); } - std::string SharedObject = BD.compileSharedObject(SafeModuleBC); + std::string SharedObject = BD.compileSharedObject(SafeModuleBC.toString()); delete Safe; // Run the code generator on the `Test' code, loading the shared library. // The function returns whether or not the new output differs from reference. - int Result = BD.diffProgram(TestModuleBC, SharedObject, false); + int Result = BD.diffProgram(TestModuleBC.toString(), SharedObject, false); if (Result) std::cerr << ": still failing!\n"; else std::cerr << ": didn't fail.\n"; - removeFile(TestModuleBC); - removeFile(SafeModuleBC); + removeFile(TestModuleBC.toString()); + removeFile(SafeModuleBC.toString()); removeFile(SharedObject); return Result; @@ -791,20 +793,24 @@ // Condition the modules CleanupAndPrepareModules(*this, ToCodeGen, ToNotCodeGen); - std::string TestModuleBC = getUniqueFilename("bugpoint.test.bc"); - if (writeProgramToFile(TestModuleBC, ToCodeGen)) { + sys::Path TestModuleBC("bugpoint.test.bc"); + TestModuleBC.makeUnique(); + + if (writeProgramToFile(TestModuleBC.toString(), ToCodeGen)) { std::cerr << "Error writing bytecode to `" << TestModuleBC << "'\nExiting."; exit(1); } delete ToCodeGen; // Make the shared library - std::string SafeModuleBC = getUniqueFilename("bugpoint.safe.bc"); - if (writeProgramToFile(SafeModuleBC, ToNotCodeGen)) { + sys::Path SafeModuleBC("bugpoint.safe.bc"); + SafeModuleBC.makeUnique(); + + if (writeProgramToFile(SafeModuleBC.toString(), ToNotCodeGen)) { std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; exit(1); } - std::string SharedObject = compileSharedObject(SafeModuleBC); + std::string SharedObject = compileSharedObject(SafeModuleBC.toString()); delete ToNotCodeGen; std::cout << "You can reproduce the problem with the command line: \n"; Index: llvm/tools/bugpoint/OptimizerDriver.cpp diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.24 llvm/tools/bugpoint/OptimizerDriver.cpp:1.25 --- llvm/tools/bugpoint/OptimizerDriver.cpp:1.24 Sat Nov 6 23:43:51 2004 +++ llvm/tools/bugpoint/OptimizerDriver.cpp Tue Dec 14 19:53:08 2004 @@ -22,6 +22,7 @@ #include "llvm/Bytecode/WriteBytecodePass.h" #include "llvm/Target/TargetData.h" #include "llvm/Support/FileUtilities.h" +#include "llvm/System/Path.h" #include #include #include @@ -114,7 +115,9 @@ std::string &OutputFilename, bool DeleteOutput, bool Quiet) const{ std::cout << std::flush; - OutputFilename = getUniqueFilename("bugpoint-output.bc"); + sys::Path uniqueFilename("bugpoint-output.bc"); + uniqueFilename.makeUnique(); + OutputFilename = uniqueFilename.toString(); pid_t child_pid; switch (child_pid = fork()) { From reid at x10sys.com Tue Dec 14 19:54:01 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:54:01 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/llvm-ar.cpp Message-ID: <200412150154.TAA00819@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: llvm-ar.cpp updated: 1.22 -> 1.23 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Remove #inclusion of Support/FileUtilities.h which isn't needed any more. --- Diffs of the changes: (+0 -1) Index: llvm/tools/llvm-ar/llvm-ar.cpp diff -u llvm/tools/llvm-ar/llvm-ar.cpp:1.22 llvm/tools/llvm-ar/llvm-ar.cpp:1.23 --- llvm/tools/llvm-ar/llvm-ar.cpp:1.22 Fri Dec 10 18:14:15 2004 +++ llvm/tools/llvm-ar/llvm-ar.cpp Tue Dec 14 19:53:50 2004 @@ -16,7 +16,6 @@ #include "llvm/Bytecode/Archive.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compressor.h" -#include "llvm/Support/FileUtilities.h" #include "llvm/System/Signals.h" #include #include From reid at x10sys.com Tue Dec 14 19:54:01 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:54:01 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-nm/llvm-nm.cpp Message-ID: <200412150154.TAA00823@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-nm: llvm-nm.cpp updated: 1.20 -> 1.21 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Remove #inclusion of Support/FileUtilities.h which isn't needed any more. --- Diffs of the changes: (+0 -1) Index: llvm/tools/llvm-nm/llvm-nm.cpp diff -u llvm/tools/llvm-nm/llvm-nm.cpp:1.20 llvm/tools/llvm-nm/llvm-nm.cpp:1.21 --- llvm/tools/llvm-nm/llvm-nm.cpp:1.20 Sun Dec 12 21:01:26 2004 +++ llvm/tools/llvm-nm/llvm-nm.cpp Tue Dec 14 19:53:50 2004 @@ -20,7 +20,6 @@ #include "llvm/Bytecode/Reader.h" #include "llvm/Bytecode/Archive.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/FileUtilities.h" #include "llvm/System/Signals.h" #include #include From reid at x10sys.com Tue Dec 14 19:54:01 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:54:01 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ranlib/llvm-ranlib.cpp Message-ID: <200412150154.TAA00826@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ranlib: llvm-ranlib.cpp updated: 1.2 -> 1.3 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Remove #inclusion of Support/FileUtilities.h which isn't needed any more. --- Diffs of the changes: (+0 -1) Index: llvm/tools/llvm-ranlib/llvm-ranlib.cpp diff -u llvm/tools/llvm-ranlib/llvm-ranlib.cpp:1.2 llvm/tools/llvm-ranlib/llvm-ranlib.cpp:1.3 --- llvm/tools/llvm-ranlib/llvm-ranlib.cpp:1.2 Tue Nov 16 00:41:20 2004 +++ llvm/tools/llvm-ranlib/llvm-ranlib.cpp Tue Dec 14 19:53:50 2004 @@ -14,7 +14,6 @@ #include "llvm/Module.h" #include "llvm/Bytecode/Archive.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/FileUtilities.h" #include "llvm/System/Signals.h" #include #include From reid at x10sys.com Tue Dec 14 19:54:48 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 19:54:48 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/c.in cpp.in Message-ID: <200412150154.TAA00852@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: c.in updated: 1.2 -> 1.3 cpp.in updated: 1.2 -> 1.3 --- Log message: Change LLVMGCCDIR/bytecode-libs -> LLVMGCCDIR/lib --- Diffs of the changes: (+2 -2) Index: llvm/tools/llvmc/c.in diff -u llvm/tools/llvmc/c.in:1.2 llvm/tools/llvmc/c.in:1.3 --- llvm/tools/llvmc/c.in:1.2 Thu Nov 25 13:38:39 2004 +++ llvm/tools/llvmc/c.in Tue Dec 14 19:54:37 2004 @@ -9,7 +9,7 @@ lang.opt3=-O3 lang.opt4=-O3 lang.opt5=-O3 - lang.libs=@LLVMGCCDIR@/lib @LLVMGCCDIR@/bytecode-libs \ + lang.libs=@LLVMGCCDIR@/lib @LLVMGCCDIR@/lib \ @LLVMGCCDIR@/lib/gcc/@LLVMGCCARCH@ ########################################################## Index: llvm/tools/llvmc/cpp.in diff -u llvm/tools/llvmc/cpp.in:1.2 llvm/tools/llvmc/cpp.in:1.3 --- llvm/tools/llvmc/cpp.in:1.2 Thu Nov 25 13:38:51 2004 +++ llvm/tools/llvmc/cpp.in Tue Dec 14 19:54:37 2004 @@ -9,7 +9,7 @@ lang.opt3=-O3 lang.opt4=-O3 lang.opt5=-O3 - lang.libs=@LLVMGCCDIR@/lib @LLVMGCCDIR@/bytecode-libs \ + lang.libs=@LLVMGCCDIR@/lib @LLVMGCCDIR@/lib \ @LLVMGCCDIR@/lib/gcc/@LLVMGCCARCH@ ########################################################## From reid at x10sys.com Tue Dec 14 22:01:59 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 22:01:59 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200412150401.WAA03861@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.151 -> 1.152 --- Log message: Don't put newlines in AC macros that can't handle them! --- Diffs of the changes: (+3 -4) Index: llvm/configure diff -u llvm/configure:1.151 llvm/configure:1.152 --- llvm/configure:1.151 Tue Dec 14 19:41:56 2004 +++ llvm/configure Tue Dec 14 22:01:48 2004 @@ -26618,10 +26618,7 @@ - - for ac_func in backtrace getcwd gettimeofday isatty getrusage mkstemp mktemp - mkdtemp realpath do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -26725,7 +26722,9 @@ -for ac_func in strdup strtoq strtoll + + +for ac_func in mkdtemp realpath strdup strtoq strtoll do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 From reid at x10sys.com Tue Dec 14 22:01:59 2004 From: reid at x10sys.com (Reid Spencer) Date: Tue, 14 Dec 2004 22:01:59 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200412150401.WAA03864@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.142 -> 1.143 --- Log message: Don't put newlines in AC macros that can't handle them! --- Diffs of the changes: (+2 -3) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.142 llvm/autoconf/configure.ac:1.143 --- llvm/autoconf/configure.ac:1.142 Tue Dec 14 19:41:56 2004 +++ llvm/autoconf/configure.ac Tue Dec 14 22:01:48 2004 @@ -409,9 +409,8 @@ dnl=== dnl===-----------------------------------------------------------------------=== -AC_CHECK_FUNCS([backtrace getcwd gettimeofday isatty getrusage mkstemp mktemp - mkdtemp realpath]) -AC_CHECK_FUNCS([strdup strtoq strtoll]) +AC_CHECK_FUNCS([backtrace getcwd gettimeofday isatty getrusage mkstemp mktemp]) +AC_CHECK_FUNCS([mkdtemp realpath strdup strtoq strtoll]) AC_C_PRINTF_A AC_FUNC_ALLOCA AC_FUNC_RAND48 From jeffc at jolt-lang.org Tue Dec 14 22:08:26 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Tue, 14 Dec 2004 22:08:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412150408.WAA04028@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.16 -> 1.17 --- Log message: Fix VC++ compilation errors --- Diffs of the changes: (+1 -6) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.16 llvm/lib/System/Win32/Path.cpp:1.17 --- llvm/lib/System/Win32/Path.cpp:1.16 Tue Dec 14 19:50:13 2004 +++ llvm/lib/System/Win32/Path.cpp Tue Dec 14 22:08:15 2004 @@ -180,11 +180,6 @@ } Path -Path::GetLLVMConfigDir() { - return GetLLVMDefaultConfigDir(); -} - -Path Path::GetUserHomeDirectory() { const char* home = getenv("HOME"); if (home) { @@ -600,7 +595,7 @@ dir.elideFile(); std::string fname = this->getLast(); - char* newName = alloca(MAX_PATH+1); + char newName[MAX_PATH + 1]; if (!GetTempFileName(dir.c_str(), fname.c_str(), 0, newName)) ThrowError("Cannot make unique filename for '" + path + "'"); From jeffc at jolt-lang.org Tue Dec 14 22:08:26 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Tue, 14 Dec 2004 22:08:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Path.cpp Message-ID: <200412150408.WAA04025@zion.cs.uiuc.edu> Changes in directory llvm/lib/System: Path.cpp updated: 1.12 -> 1.13 --- Log message: Fix VC++ compilation errors --- Diffs of the changes: (+2 -0) Index: llvm/lib/System/Path.cpp diff -u llvm/lib/System/Path.cpp:1.12 llvm/lib/System/Path.cpp:1.13 --- llvm/lib/System/Path.cpp:1.12 Tue Dec 14 19:50:13 2004 +++ llvm/lib/System/Path.cpp Tue Dec 14 22:08:15 2004 @@ -26,8 +26,10 @@ Path Path::GetLLVMConfigDir() { Path result; +#ifdef LLVM_ETCDIR if (result.setDirectory(LLVM_ETCDIR)) return result; +#endif return GetLLVMDefaultConfigDir(); } From jeffc at jolt-lang.org Tue Dec 14 22:28:55 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Tue, 14 Dec 2004 22:28:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/TimeValue.cpp Message-ID: <200412150428.WAA04514@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: TimeValue.cpp updated: 1.5 -> 1.6 --- Log message: Make Win32 TimeValue::toString() re-entrant and work with mingw --- Diffs of the changes: (+9 -5) Index: llvm/lib/System/Win32/TimeValue.cpp diff -u llvm/lib/System/Win32/TimeValue.cpp:1.5 llvm/lib/System/Win32/TimeValue.cpp:1.6 --- llvm/lib/System/Win32/TimeValue.cpp:1.5 Mon Dec 13 23:26:43 2004 +++ llvm/lib/System/Win32/TimeValue.cpp Tue Dec 14 22:28:44 2004 @@ -31,13 +31,17 @@ } std::string TimeValue::toString() const { - // Alas, asctime is not re-entrant on Windows... - +#ifdef __MINGW + time_t ourTime = time_t(this->toEpochTime()); + struct tm *lt = ::localtime(&ourTime); +#else __time64_t ourTime = this->toEpochTime(); - char* buffer = ::asctime(::_localtime64(&ourTime)); + struct tm *lt = ::_localtime64(&ourTime); +#endif - std::string result(buffer); - return result.substr(0,24); + char buffer[25]; + strftime(buffer, 25, "%a %b %d %H:%M:%S %Y", lt); + return std::string(buffer); } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From lattner at cs.uiuc.edu Wed Dec 15 01:04:46 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 01:04:46 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/RegAllocIterativeScan.cpp Message-ID: <200412150704.iBF74k0b027188@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: RegAllocIterativeScan.cpp updated: 1.18 -> 1.19 --- Log message: Move virtual method call out of loop --- Diffs of the changes: (+4 -4) Index: llvm/lib/CodeGen/RegAllocIterativeScan.cpp diff -u llvm/lib/CodeGen/RegAllocIterativeScan.cpp:1.18 llvm/lib/CodeGen/RegAllocIterativeScan.cpp:1.19 --- llvm/lib/CodeGen/RegAllocIterativeScan.cpp:1.18 Wed Nov 17 19:29:39 2004 +++ llvm/lib/CodeGen/RegAllocIterativeScan.cpp Wed Dec 15 01:04:32 2004 @@ -397,8 +397,8 @@ float minWeight = HUGE_VAL; unsigned minReg = 0; const TargetRegisterClass* rc = mf_->getSSARegMap()->getRegClass(cur->reg); - for (TargetRegisterClass::iterator i = rc->allocation_order_begin(*mf_); - i != rc->allocation_order_end(*mf_); ++i) { + for (TargetRegisterClass::iterator i = rc->allocation_order_begin(*mf_), + e = rc->allocation_order_end(*mf_); i != e; ++i) { unsigned reg = *i; if (minWeight > spillWeights_[reg]) { minWeight = spillWeights_[reg]; @@ -477,8 +477,8 @@ const TargetRegisterClass* rc = mf_->getSSARegMap()->getRegClass(cur->reg); unsigned freeReg = 0; - for (TargetRegisterClass::iterator i = rc->allocation_order_begin(*mf_); - i != rc->allocation_order_end(*mf_); ++i) { + for (TargetRegisterClass::iterator i = rc->allocation_order_begin(*mf_), + e = rc->allocation_order_end(*mf_); i != e; ++i) { unsigned reg = *i; if (prt_->isRegAvail(reg) && (!freeReg || inactiveCounts[freeReg] < inactiveCounts[reg])) From lattner at cs.uiuc.edu Wed Dec 15 01:05:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 01:05:00 -0600 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/RegAllocLinearScan.cpp Message-ID: <200412150705.iBF750UO027194@apoc.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: RegAllocLinearScan.cpp updated: 1.104 -> 1.105 --- Log message: Move virtual method call out of loop --- Diffs of the changes: (+2 -2) Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.104 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.105 --- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.104 Mon Dec 6 23:25:53 2004 +++ llvm/lib/CodeGen/RegAllocLinearScan.cpp Wed Dec 15 01:04:17 2004 @@ -426,8 +426,8 @@ float minWeight = HUGE_VAL; unsigned minReg = 0; const TargetRegisterClass* rc = mf_->getSSARegMap()->getRegClass(cur->reg); - for (TargetRegisterClass::iterator i = rc->allocation_order_begin(*mf_); - i != rc->allocation_order_end(*mf_); ++i) { + for (TargetRegisterClass::iterator i = rc->allocation_order_begin(*mf_), + e = rc->allocation_order_end(*mf_); i != e; ++i) { unsigned reg = *i; if (minWeight > SpillWeights[reg]) { minWeight = SpillWeights[reg]; From lattner at cs.uiuc.edu Wed Dec 15 01:21:54 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 01:21:54 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasAnalysis.h Message-ID: <200412150721.iBF7Ls0n013646@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasAnalysis.h updated: 1.17 -> 1.18 --- Log message: Make the AliasAnalysis interface more precise for common cases. --- Diffs of the changes: (+94 -11) Index: llvm/include/llvm/Analysis/AliasAnalysis.h diff -u llvm/include/llvm/Analysis/AliasAnalysis.h:1.17 llvm/include/llvm/Analysis/AliasAnalysis.h:1.18 --- llvm/include/llvm/Analysis/AliasAnalysis.h:1.17 Sun May 23 16:12:38 2004 +++ llvm/include/llvm/Analysis/AliasAnalysis.h Wed Dec 15 01:21:39 2004 @@ -100,6 +100,93 @@ /// virtual bool pointsToConstantMemory(const Value *P); + //===--------------------------------------------------------------------===// + /// Simple mod/ref information... + /// + + /// ModRefResult - Represent the result of a mod/ref query. Mod and Ref are + /// bits which may be or'd together. + /// + enum ModRefResult { NoModRef = 0, Ref = 1, Mod = 2, ModRef = 3 }; + + + /// ModRefBehavior - Summary of how a function affects memory in the program. + /// Loads from constant globals are not considered memory accesses for this + /// interface. Also, functions may freely modify stack space local to their + /// invocation without having to report it through these interfaces. + enum ModRefBehavior { + // DoesNotAccessMemory - This function does not perform any non-local loads + // or stores to memory. + // + // This property corresponds to the GCC 'const' attribute. + DoesNotAccessMemory, + + // AccessesArguments - This function accesses function arguments in + // non-volatile and well known ways, but does not access any other memory. + // + // Clients may call getArgumentAccesses to get specific information about + // how pointer arguments are used. + AccessesArguments, + + // AccessesArgumentsAndGlobals - This function has accesses function + // arguments and global variables in non-volatile and well-known ways, but + // does not access any other memory. + // + // Clients may call getArgumentAccesses to get specific information about + // how pointer arguments and globals are used. + AccessesArgumentsAndGlobals, + + // OnlyReadsMemory - This function does not perform any non-local stores or + // volatile loads, but may read from any memory location. + // + // This property corresponds to the GCC 'pure' attribute. + OnlyReadsMemory, + + // UnknownModRefBehavior - This indicates that the function could not be + // classified into one of the behaviors above. + UnknownModRefBehavior + }; + + /// PointerAccessInfo - This struct is used to return results for pointers, + /// globals, and the return value of a function. + struct PointerAccessInfo { + /// V - The value this record corresponds to. This may be an Argument for + /// the function, a GlobalVariable, or null, corresponding to the return + /// value for the function. + Value *V; + + /// ModRefInfo - Whether the pointer is loaded or stored to/from. + /// + ModRefResult ModRefInfo; + + /// AccessType - Specific fine-grained access information for the argument. + /// If none of these classifications is general enough, the + /// getModRefBehavior method should not return AccessesArguments*. If a + /// record is not returned for a particular argument, the argument is never + /// dead and never dereferenced. + enum AccessType { + /// ScalarAccess - The pointer is dereferenced. + /// + ScalarAccess, + + /// ArrayAccess - The pointer is indexed through as an array of elements. + /// + ArrayAccess, + + /// ElementAccess ?? P->F only? + + /// CallsThrough - Indirect calls are made through the specified function + /// pointer. + CallsThrough, + }; + }; + + /// getModRefBehavior - Return the behavior of the specified function if + /// called from the specified call site. The call site may be null in which + /// case the most generic behavior of this function should be returned. + virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS, + std::vector *Info = 0); + /// doesNotAccessMemory - If the specified function is known to never read or /// write memory, return true. If the function only reads from known-constant /// memory, it is also legal to return true. Functions that unwind the stack @@ -111,7 +198,9 @@ /// /// This property corresponds to the GCC 'const' attribute. /// - virtual bool doesNotAccessMemory(Function *F); + bool doesNotAccessMemory(Function *F) { + return getModRefBehavior(F, CallSite()) == DoesNotAccessMemory; + } /// onlyReadsMemory - If the specified function is known to only read from /// non-volatile memory (or not access memory at all), return true. Functions @@ -122,17 +211,11 @@ /// /// This property corresponds to the GCC 'pure' attribute. /// - virtual bool onlyReadsMemory(Function *F); - - - //===--------------------------------------------------------------------===// - /// Simple mod/ref information... - /// + bool onlyReadsMemory(Function *F) { + /// FIXME: If the analysis returns more precise info, we can reduce it to this. + return getModRefBehavior(F, CallSite()) == OnlyReadsMemory; + } - /// ModRefResult - Represent the result of a mod/ref query. Mod and Ref are - /// bits which may be or'd together. - /// - enum ModRefResult { NoModRef = 0, Ref = 1, Mod = 2, ModRef = 3 }; /// getModRefInfo - Return information about whether or not an instruction may /// read or write memory specified by the pointer operand. An instruction From lattner at cs.uiuc.edu Wed Dec 15 01:22:22 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 01:22:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysis.cpp AliasSetTracker.cpp BasicAliasAnalysis.cpp Message-ID: <200412150722.iBF7MM2K013669@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: AliasAnalysis.cpp updated: 1.21 -> 1.22 AliasSetTracker.cpp updated: 1.32 -> 1.33 BasicAliasAnalysis.cpp updated: 1.61 -> 1.62 --- Log message: Adjust to new alias analysis interfaces --- Diffs of the changes: (+40 -47) Index: llvm/lib/Analysis/AliasAnalysis.cpp diff -u llvm/lib/Analysis/AliasAnalysis.cpp:1.21 llvm/lib/Analysis/AliasAnalysis.cpp:1.22 --- llvm/lib/Analysis/AliasAnalysis.cpp:1.21 Wed Dec 8 15:00:59 2004 +++ llvm/lib/Analysis/AliasAnalysis.cpp Wed Dec 15 01:22:10 2004 @@ -57,14 +57,11 @@ return AA->pointsToConstantMemory(P); } -bool AliasAnalysis::doesNotAccessMemory(Function *F) { +AliasAnalysis::ModRefBehavior +AliasAnalysis::getModRefBehavior(Function *F, CallSite CS, + std::vector *Info) { assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!"); - return AA->doesNotAccessMemory(F); -} - -bool AliasAnalysis::onlyReadsMemory(Function *F) { - assert(AA && "AA didn't call InitializeAliasAnalysis in its run method!"); - return doesNotAccessMemory(F) || AA->onlyReadsMemory(F); + return AA->getModRefBehavior(F, CS, Info); } bool AliasAnalysis::hasNoModRefInfoForCalls() const { Index: llvm/lib/Analysis/AliasSetTracker.cpp diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.32 llvm/lib/Analysis/AliasSetTracker.cpp:1.33 --- llvm/lib/Analysis/AliasSetTracker.cpp:1.32 Mon Dec 6 22:03:45 2004 +++ llvm/lib/Analysis/AliasSetTracker.cpp Wed Dec 15 01:22:10 2004 @@ -113,9 +113,10 @@ CallSites.push_back(CS); if (Function *F = CS.getCalledFunction()) { - if (AA.doesNotAccessMemory(F)) + AliasAnalysis::ModRefBehavior Behavior = AA.getModRefBehavior(F, CS); + if (Behavior == AliasAnalysis::DoesNotAccessMemory) return; - else if (AA.onlyReadsMemory(F)) { + else if (Behavior == AliasAnalysis::OnlyReadsMemory) { AliasTy = MayAlias; AccessTy |= Refs; return; Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.61 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.62 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.61 Wed Dec 8 17:56:15 2004 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Wed Dec 15 01:22:10 2004 @@ -48,10 +48,17 @@ return MayAlias; } + virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS) { + return UnknownModRefBehavior; + } + + virtual void getArgumentAccesses(Function *F, CallSite CS, + std::vector &Info) { + assert(0 && "This method may not be called on this function!"); + } + virtual void getMustAliases(Value *P, std::vector &RetVals) { } virtual bool pointsToConstantMemory(const Value *P) { return false; } - virtual bool doesNotAccessMemory(Function *F) { return false; } - virtual bool onlyReadsMemory(Function *F) { return false; } virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size) { return ModRef; } @@ -94,9 +101,9 @@ /// global) or not. bool pointsToConstantMemory(const Value *P); - virtual bool doesNotAccessMemory(Function *F); - virtual bool onlyReadsMemory(Function *F); - + virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS, + std::vector *Info); + private: // CheckGEPInstructions - Check two GEP instructions with known // must-aliasing base pointers. This checks to see if the index expressions @@ -683,7 +690,8 @@ // that set errno on a domain or other error. static const char *DoesntAccessMemoryTable[] = { // LLVM intrinsics: - "llvm.frameaddress", "llvm.returnaddress", "llvm.readport", "llvm.isunordered", + "llvm.frameaddress", "llvm.returnaddress", "llvm.readport", + "llvm.isunordered", "abs", "labs", "llabs", "imaxabs", "fabs", "fabsf", "fabsl", "trunc", "truncf", "truncl", "ldexp", @@ -723,29 +731,6 @@ static const unsigned DAMTableSize = sizeof(DoesntAccessMemoryTable)/sizeof(DoesntAccessMemoryTable[0]); -/// doesNotAccessMemory - Return true if we know that the function does not -/// access memory at all. Since basicaa does no analysis, we can only do simple -/// things here. In particular, if we have an external function with the name -/// of a standard C library function, we are allowed to assume it will be -/// resolved by libc, so we can hardcode some entries in here. -bool BasicAliasAnalysis::doesNotAccessMemory(Function *F) { - if (!F->isExternal()) return false; - - static bool Initialized = false; - if (!Initialized) { - // Sort the table the first time through. - std::sort(DoesntAccessMemoryTable, DoesntAccessMemoryTable+DAMTableSize, - StringCompare()); - Initialized = true; - } - - const char **Ptr = std::lower_bound(DoesntAccessMemoryTable, - DoesntAccessMemoryTable+DAMTableSize, - F->getName().c_str(), StringCompare()); - return Ptr != DoesntAccessMemoryTable+DAMTableSize && *Ptr == F->getName(); -} - - static const char *OnlyReadsMemoryTable[] = { "atoi", "atol", "atof", "atoll", "atoq", "a64l", "bcmp", "memcmp", "memchr", "memrchr", "wmemcmp", "wmemchr", @@ -772,23 +757,33 @@ static const unsigned ORMTableSize = sizeof(OnlyReadsMemoryTable)/sizeof(OnlyReadsMemoryTable[0]); - -bool BasicAliasAnalysis::onlyReadsMemory(Function *F) { - if (doesNotAccessMemory(F)) return true; - if (!F->isExternal()) return false; + +AliasAnalysis::ModRefBehavior +BasicAliasAnalysis::getModRefBehavior(Function *F, CallSite CS, + std::vector *Info) { + if (!F->isExternal()) return UnknownModRefBehavior; static bool Initialized = false; if (!Initialized) { // Sort the table the first time through. + std::sort(DoesntAccessMemoryTable, DoesntAccessMemoryTable+DAMTableSize, + StringCompare()); std::sort(OnlyReadsMemoryTable, OnlyReadsMemoryTable+ORMTableSize, StringCompare()); Initialized = true; } - const char **Ptr = std::lower_bound(OnlyReadsMemoryTable, - OnlyReadsMemoryTable+ORMTableSize, + const char **Ptr = std::lower_bound(DoesntAccessMemoryTable, + DoesntAccessMemoryTable+DAMTableSize, F->getName().c_str(), StringCompare()); - return Ptr != OnlyReadsMemoryTable+ORMTableSize && *Ptr == F->getName(); -} - + if (Ptr != DoesntAccessMemoryTable+DAMTableSize && *Ptr == F->getName()) + return DoesNotAccessMemory; + + Ptr = std::lower_bound(OnlyReadsMemoryTable, + OnlyReadsMemoryTable+ORMTableSize, + F->getName().c_str(), StringCompare()); + if (Ptr != OnlyReadsMemoryTable+ORMTableSize && *Ptr == F->getName()) + return OnlyReadsMemory; + return UnknownModRefBehavior; +} From lattner at cs.uiuc.edu Wed Dec 15 01:22:25 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 01:22:25 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/GlobalsModRef.cpp Message-ID: <200412150722.iBF7MPIc013679@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: GlobalsModRef.cpp updated: 1.8 -> 1.9 --- Log message: Adjust to new alias analysis interfaces --- Diffs of the changes: (+8 -10) Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.8 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.9 --- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.8 Tue Dec 7 02:11:24 2004 +++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp Wed Dec 15 01:22:13 2004 @@ -101,19 +101,17 @@ } bool hasNoModRefInfoForCalls() const { return false; } - bool doesNotAccessMemory(Function *F) { + /// getModRefBehavior - Return the behavior of the specified function if + /// called from the specified call site. The call site may be null in which + /// case the most generic behavior of this function should be returned. + virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS) { if (FunctionRecord *FR = getFunctionInfo(F)) if (FR->FunctionEffect == 0) - return true; - return AliasAnalysis::doesNotAccessMemory(F); + return DoesNotAccessMemory; + else if ((FR->FunctionEffect & Mod) == 0) + return OnlyReadsMemory; + return AliasAnalysis::getModRefBehavior(F, CS); } - bool onlyReadsMemory(Function *F) { - if (FunctionRecord *FR = getFunctionInfo(F)) - if ((FR->FunctionEffect & Mod) == 0) - return true; - return AliasAnalysis::onlyReadsMemory(F); - } - virtual void deleteValue(Value *V); virtual void copyValue(Value *From, Value *To); From lattner at cs.uiuc.edu Wed Dec 15 01:22:37 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 01:22:37 -0600 Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp Message-ID: <200412150722.iBF7Mbs8013691@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Transforms/Scalar: LICM.cpp updated: 1.69 -> 1.70 --- Log message: Adjust to new interfaces --- Diffs of the changes: (+3 -2) Index: llvm/lib/Transforms/Scalar/LICM.cpp diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.69 llvm/lib/Transforms/Scalar/LICM.cpp:1.70 --- llvm/lib/Transforms/Scalar/LICM.cpp:1.69 Mon Nov 29 15:26:12 2004 +++ llvm/lib/Transforms/Scalar/LICM.cpp Wed Dec 15 01:22:25 2004 @@ -358,9 +358,10 @@ } else if (CallInst *CI = dyn_cast(&I)) { // Handle obvious cases efficiently. if (Function *Callee = CI->getCalledFunction()) { - if (AA->doesNotAccessMemory(Callee)) + AliasAnalysis::ModRefBehavior Behavior =AA->getModRefBehavior(Callee, CI); + if (Behavior == AliasAnalysis::DoesNotAccessMemory) return true; - else if (AA->onlyReadsMemory(Callee)) { + else if (Behavior == AliasAnalysis::OnlyReadsMemory) { // If this call only reads from memory and there are no writes to memory // in the loop, we can hoist or sink the call as appropriate. bool FoundMod = false; From lattner at cs.uiuc.edu Wed Dec 15 01:44:31 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 01:44:31 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/llvm-ar.cpp Message-ID: <200412150744.iBF7iV4X030842@apoc.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: llvm-ar.cpp updated: 1.23 -> 1.24 --- Log message: Do not fail an assertion on a broken archive --- Diffs of the changes: (+6 -1) Index: llvm/tools/llvm-ar/llvm-ar.cpp diff -u llvm/tools/llvm-ar/llvm-ar.cpp:1.23 llvm/tools/llvm-ar/llvm-ar.cpp:1.24 --- llvm/tools/llvm-ar/llvm-ar.cpp:1.23 Tue Dec 14 19:53:50 2004 +++ llvm/tools/llvm-ar/llvm-ar.cpp Wed Dec 15 01:44:15 2004 @@ -677,7 +677,12 @@ std::cerr << argv[0] << ": creating " << ArchivePath.toString() << "\n"; TheArchive = Archive::CreateEmpty(ArchivePath); } else { - TheArchive = Archive::OpenAndLoad(ArchivePath); + std::string Error; + TheArchive = Archive::OpenAndLoad(ArchivePath, &Error); + if (TheArchive == 0) + std::cerr << argv[0] << ": error loading '" << ArchivePath << "': " + << Error << "!\n"; + return 1; } // Make sure we're not fooling ourselves. From lattner at cs.uiuc.edu Wed Dec 15 02:16:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 02:16:04 -0600 Subject: [llvm-commits] CVS: llvm/runtime/Makefile Message-ID: <200412150816.iBF8G4fo032344@apoc.cs.uiuc.edu> Changes in directory llvm/runtime: Makefile updated: 1.22 -> 1.23 --- Log message: Disable libprofile as llvm-ar bus errors on it, and I don't want to break the nightly testers. --- Diffs of the changes: (+1 -1) Index: llvm/runtime/Makefile diff -u llvm/runtime/Makefile:1.22 llvm/runtime/Makefile:1.23 --- llvm/runtime/Makefile:1.22 Sat Oct 23 03:01:27 2004 +++ llvm/runtime/Makefile Wed Dec 15 02:15:48 2004 @@ -11,7 +11,7 @@ include $(LEVEL)/Makefile.config ifneq ($(wildcard $(LLVMGCCDIR)),) -PARALLEL_DIRS := GCCLibraries libdummy libprofile libtrace GC +PARALLEL_DIRS := GCCLibraries libdummy libtrace GC else PARALLEL_DIRS := install all :: From reid at x10sys.com Wed Dec 15 02:32:56 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 02:32:56 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412150832.CAA08699@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.17 -> 1.18 --- Log message: Fix a file overwrite bug in llvm-ar introduced by changes to createTemporaryFile semantics where it doesn't create a fully unique name if the basename doesn't exist. This functionality is now optionally provided by the boolean reuse_current parameter to createTemporaryFile and makeUnique. The default values differ because of the way these functions are used in LLVM. --- Diffs of the changes: (+12 -2) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.17 llvm/lib/System/Win32/Path.cpp:1.18 --- llvm/lib/System/Win32/Path.cpp:1.17 Tue Dec 14 22:08:15 2004 +++ llvm/lib/System/Win32/Path.cpp Wed Dec 15 02:32:45 2004 @@ -587,8 +587,8 @@ } void -Path::makeUnique() { - if (!exists()) +Path::makeUnique( bool reuse_current ) { + if (reuse_current && !exists()) return; // File doesn't exist already, just use it! Path dir (*this); @@ -602,6 +602,16 @@ path = newName; } +bool +Path::createTemporaryFile(bool reuse_current) { + // Make sure we're dealing with a file + if (!isFile()) + return false; + + // Make this into a unique file name + makeUnique( reuse_current ); +} + } } From reid at x10sys.com Wed Dec 15 02:32:57 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 02:32:57 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200412150832.CAA08702@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.17 -> 1.18 --- Log message: Fix a file overwrite bug in llvm-ar introduced by changes to createTemporaryFile semantics where it doesn't create a fully unique name if the basename doesn't exist. This functionality is now optionally provided by the boolean reuse_current parameter to createTemporaryFile and makeUnique. The default values differ because of the way these functions are used in LLVM. --- Diffs of the changes: (+2 -2) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.17 llvm/include/llvm/System/Path.h:1.18 --- llvm/include/llvm/System/Path.h:1.17 Tue Dec 14 19:50:13 2004 +++ llvm/include/llvm/System/Path.h Wed Dec 15 02:32:45 2004 @@ -494,7 +494,7 @@ /// already unique. /// @throws std::string if an unrecoverable error occurs. /// @brief Make the current path name unique in the file system. - void makeUnique(); + void makeUnique( bool reuse_current = true ); /// This method attempts to create a directory in the file system with the /// same name as the Path object. The \p create_parents parameter controls @@ -529,7 +529,7 @@ /// the newly generated temporary file name is unique in the file system. /// @throws std::string if there is an error /// @brief Create a unique temporary file - bool createTemporaryFile(); + bool createTemporaryFile(bool reuse_current = false); /// This method attempts to destroy the directory named by the last in /// the Path name. If \p remove_contents is false, an attempt will be From reid at x10sys.com Wed Dec 15 02:32:57 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 02:32:57 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200412150832.CAA08705@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.22 -> 1.23 --- Log message: Fix a file overwrite bug in llvm-ar introduced by changes to createTemporaryFile semantics where it doesn't create a fully unique name if the basename doesn't exist. This functionality is now optionally provided by the boolean reuse_current parameter to createTemporaryFile and makeUnique. The default values differ because of the way these functions are used in LLVM. --- Diffs of the changes: (+4 -4) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.22 llvm/lib/System/Unix/Path.cpp:1.23 --- llvm/lib/System/Unix/Path.cpp:1.22 Tue Dec 14 19:50:13 2004 +++ llvm/lib/System/Unix/Path.cpp Wed Dec 15 02:32:45 2004 @@ -481,13 +481,13 @@ } bool -Path::createTemporaryFile() { +Path::createTemporaryFile(bool reuse_current) { // Make sure we're dealing with a file if (!isFile()) return false; // Make this into a unique file name - makeUnique(); + makeUnique( reuse_current ); // create the file int outFile = ::open(path.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0666); @@ -600,8 +600,8 @@ } void -Path::makeUnique() { - if (!exists()) +Path::makeUnique(bool reuse_current) { + if (reuse_current && !exists()) return; // File doesn't exist already, just use it! // Append an XXXXXX pattern to the end of the file for use with mkstemp, From lattner at cs.uiuc.edu Wed Dec 15 11:00:49 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 11:00:49 -0600 Subject: [llvm-commits] CVS: llvm-www/demo/index.cgi Message-ID: <200412151700.iBFH0nnR014607@apoc.cs.uiuc.edu> Changes in directory llvm-www/demo: index.cgi updated: 1.36 -> 1.37 --- Log message: This was actually kinda working, but sending mail to at at zion.cs.uiuc.edu and cs.uiuc.edu at zion.cs.uiuc.edu. Crazy. --- Diffs of the changes: (+2 -2) Index: llvm-www/demo/index.cgi diff -u llvm-www/demo/index.cgi:1.36 llvm-www/demo/index.cgi:1.37 --- llvm-www/demo/index.cgi:1.36 Sun Dec 12 19:33:06 2004 +++ llvm-www/demo/index.cgi Wed Dec 15 11:00:37 2004 @@ -5,7 +5,7 @@ # doing remote web JO99C compilations. (It could still be used for that # purpose, though the two scripts have diverged somewhat.) # -# Last modified $Date: 2004/12/13 01:33:06 $ +# Last modified $Date: 2004/12/15 17:00:37 $ # use strict; @@ -429,7 +429,7 @@ $lg = $c->param('language'); $ip = $c->remote_addr(); chomp( $host = `host $ip` ) if $ip; - mailto( 'lattner at cs.uiuc.edu', + mailto( 'lattner at cs.uiuc.edu', "--- Query: ---\nFrom: ($ip) $host\nInput: $lines lines of $lg\n" . "C++ demangle = " . ( $c->param('cxxdemangle') ? 1 : 0 ) From lattner at cs.uiuc.edu Wed Dec 15 11:13:39 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 11:13:39 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp Message-ID: <200412151713.iBFHDdrG015250@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.62 -> 1.63 --- Log message: Fix a bug in -no-aa that caused two DSGraph tests to XPASS. --- Diffs of the changes: (+2 -1) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.62 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.63 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.62 Wed Dec 15 01:22:10 2004 +++ llvm/lib/Analysis/BasicAliasAnalysis.cpp Wed Dec 15 11:13:24 2004 @@ -48,7 +48,8 @@ return MayAlias; } - virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS) { + virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS, + std::vector *Info) { return UnknownModRefBehavior; } From lattner at cs.uiuc.edu Wed Dec 15 11:14:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 11:14:18 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412151714.iBFHEIMo015454@apoc.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.264 -> 1.265 --- Log message: Make archive rules properly depend on llvm-ar. --- Diffs of the changes: (+4 -2) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.264 llvm/Makefile.rules:1.265 --- llvm/Makefile.rules:1.264 Tue Dec 14 16:44:05 2004 +++ llvm/Makefile.rules Wed Dec 15 11:14:06 2004 @@ -591,14 +591,16 @@ BCLinkLib = $(LLVMGCC) -shared -nostdlib -Xlinker \ -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE) -$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD) +$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD) \ + $(LLVMToolDir)/llvm-ar $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \ "(internalize)" $(Verb) $(BCLinkLib) -o $(ObjDir)/$(LIBRARYNAME).o $(ObjectsBC) $(Verb) $(RM) -f $@ $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).o else -$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir +$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir \ + $(LLVMToolDir)/llvm-ar $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) $(Verb) $(RM) -f $@ $(Verb) $(LArchive) $@ $(ObjectsBC) From lattner at cs.uiuc.edu Wed Dec 15 12:14:19 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 12:14:19 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/LoadValueNumbering.cpp Message-ID: <200412151814.iBFIEJRm015629@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis: LoadValueNumbering.cpp updated: 1.22 -> 1.23 --- Log message: Eliminate a virtual method call --- Diffs of the changes: (+5 -2) Index: llvm/lib/Analysis/LoadValueNumbering.cpp diff -u llvm/lib/Analysis/LoadValueNumbering.cpp:1.22 llvm/lib/Analysis/LoadValueNumbering.cpp:1.23 --- llvm/lib/Analysis/LoadValueNumbering.cpp:1.22 Fri Sep 3 13:19:51 2004 +++ llvm/lib/Analysis/LoadValueNumbering.cpp Wed Dec 15 12:14:04 2004 @@ -144,7 +144,10 @@ Function *CF = CI->getCalledFunction(); if (CF == 0) return; // Indirect call. AliasAnalysis &AA = getAnalysis(); - if (!AA.onlyReadsMemory(CF)) return; // Nothing we can do. + AliasAnalysis::ModRefBehavior MRB = AA.getModRefBehavior(CF, CI); + if (MRB != AliasAnalysis::DoesNotAccessMemory && + MRB != AliasAnalysis::OnlyReadsMemory) + return; // Nothing we can do for now. // Scan all of the arguments of the function, looking for one that is not // global. In particular, we would prefer to have an argument or instruction @@ -193,7 +196,7 @@ // whether an intervening instruction could modify memory that is read, not // ANY memory. // - if (!AA.doesNotAccessMemory(CF)) { + if (MRB == AliasAnalysis::OnlyReadsMemory) { DominatorSet &DomSetInfo = getAnalysis(); BasicBlock *CIBB = CI->getParent(); for (unsigned i = 0; i != IdenticalCalls.size(); ++i) { From lattner at cs.uiuc.edu Wed Dec 15 14:24:04 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 14:24:04 -0600 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp Message-ID: <200412152024.iBFKO4ct018476@apoc.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Verifier.cpp updated: 1.123 -> 1.124 --- Log message: Add a verifier assertion --- Diffs of the changes: (+12 -1) Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.123 llvm/lib/VMCore/Verifier.cpp:1.124 --- llvm/lib/VMCore/Verifier.cpp:1.123 Fri Dec 3 20:30:42 2004 +++ llvm/lib/VMCore/Verifier.cpp Wed Dec 15 14:23:49 2004 @@ -128,7 +128,7 @@ } for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I) - visitGlobalValue(*I); + visitGlobalVariable(*I); // If the module is broken, abort at this time. abortIfBroken(); @@ -171,6 +171,7 @@ // Verification methods... void verifySymbolTable(SymbolTable &ST); void visitGlobalValue(GlobalValue &GV); + void visitGlobalVariable(GlobalVariable &GV); void visitFunction(Function &F); void visitBasicBlock(BasicBlock &BB); void visitPHINode(PHINode &PN); @@ -262,6 +263,16 @@ } } +void Verifier::visitGlobalVariable(GlobalVariable &GV) { + if (GV.hasInitializer()) + Assert1(GV.getInitializer()->getType() == GV.getType()->getElementType(), + "Global variable initializer type does not match global " + "variable type!", &GV); + + visitGlobalValue(GV); +} + + // verifySymbolTable - Verify that a function or module symbol table is ok // void Verifier::verifySymbolTable(SymbolTable &ST) { From reid at x10sys.com Wed Dec 15 15:58:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 15:58:14 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/llvm-ar.cpp Message-ID: <200412152158.PAA11955@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: llvm-ar.cpp updated: 1.24 -> 1.25 --- Log message: Unbreak all archive reading operations introduced by the last patch which always exited the program with exit code 1 in these cases, regardless of whether an error occurred or not. --- Diffs of the changes: (+3 -2) Index: llvm/tools/llvm-ar/llvm-ar.cpp diff -u llvm/tools/llvm-ar/llvm-ar.cpp:1.24 llvm/tools/llvm-ar/llvm-ar.cpp:1.25 --- llvm/tools/llvm-ar/llvm-ar.cpp:1.24 Wed Dec 15 01:44:15 2004 +++ llvm/tools/llvm-ar/llvm-ar.cpp Wed Dec 15 15:58:03 2004 @@ -679,10 +679,11 @@ } else { std::string Error; TheArchive = Archive::OpenAndLoad(ArchivePath, &Error); - if (TheArchive == 0) + if (TheArchive == 0) { std::cerr << argv[0] << ": error loading '" << ArchivePath << "': " << Error << "!\n"; - return 1; + return 1; + } } // Make sure we're not fooling ourselves. From alkis at cs.uiuc.edu Wed Dec 15 16:15:26 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Wed, 15 Dec 2004 16:15:26 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Makefile.test Message-ID: <200412152215.QAA12283@zion.cs.uiuc.edu> Changes in directory llvm-java/test: Makefile.test updated: 1.29 -> 1.30 --- Log message: Add LLVMGCCDIR/lib to the library search paths. --- Diffs of the changes: (+1 -1) Index: llvm-java/test/Makefile.test diff -u llvm-java/test/Makefile.test:1.29 llvm-java/test/Makefile.test:1.30 --- llvm-java/test/Makefile.test:1.29 Mon Dec 13 20:59:35 2004 +++ llvm-java/test/Makefile.test Wed Dec 15 16:15:16 2004 @@ -61,7 +61,7 @@ # rule to link bytecode with runtime %.llvm %.llvm.bc: %.linked.bc $(LibDir)/libjrt.bca $(EXTRA_OBJS) $(LOPT) $(Echo) Linking $< with the Java runtime - -$(Verb)$(GCCLD) -o=$*.llvm $< -L $(LibDir) $(EXTRA_OBJS) + -$(Verb)$(GCCLD) -o=$*.llvm $< -L $(LLVMGCCDIR)/lib -L $(LibDir) $(EXTRA_OBJS) # rule to make assembly from bytecode %.dis-ll: %.bc From reid at x10sys.com Wed Dec 15 16:21:52 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 16:21:52 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200412152221.QAA12371@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.23 -> 1.24 --- Log message: Remove automatic insertion of CFE's lib directory into the bytecode path because LLVM should be agnostic to the needs of specific front ends. --- Diffs of the changes: (+0 -7) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.23 llvm/lib/System/Unix/Path.cpp:1.24 --- llvm/lib/System/Unix/Path.cpp:1.23 Wed Dec 15 02:32:45 2004 +++ llvm/lib/System/Unix/Path.cpp Wed Dec 15 16:21:42 2004 @@ -85,13 +85,6 @@ if (env_var != 0) { getPathList(env_var,Paths); } -#ifdef LLVMGCCDIR - { - Path tmpPath(std::string(LLVMGCCDIR) + "lib/"); - if (tmpPath.readable()) - Paths.push_back(tmpPath); - } -#endif #ifdef LLVM_LIBDIR { Path tmpPath; From reid at x10sys.com Wed Dec 15 16:23:01 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 16:23:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412152223.QAA12387@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.18 -> 1.19 --- Log message: Remove the CFE's lib directory from the bytecode path because LLVM should be agnostic to the needs of any specific FE. --- Diffs of the changes: (+0 -7) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.18 llvm/lib/System/Win32/Path.cpp:1.19 --- llvm/lib/System/Win32/Path.cpp:1.18 Wed Dec 15 02:32:45 2004 +++ llvm/lib/System/Win32/Path.cpp Wed Dec 15 16:22:51 2004 @@ -156,13 +156,6 @@ if (env_var != 0) { getPathList(env_var,Paths); } -#ifdef LLVMGCCDIR - { - Path tmpPath(std::string(LLVMGCCDIR) + "lib/"); - if (tmpPath.readable()) - Paths.push_back(tmpPath); - } -#endif #ifdef LLVM_LIBDIR { Path tmpPath; From reid at x10sys.com Wed Dec 15 16:28:03 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 16:28:03 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200412152228.QAA12443@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.143 -> 1.144 --- Log message: Remove LLVMGCCDIR from the set of defines. --- Diffs of the changes: (+0 -2) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.143 llvm/autoconf/configure.ac:1.144 --- llvm/autoconf/configure.ac:1.143 Tue Dec 14 22:01:48 2004 +++ llvm/autoconf/configure.ac Wed Dec 15 16:27:51 2004 @@ -527,8 +527,6 @@ [Installation directory for man pages]) AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME, "$LLVM_CONFIGTIME", [Time at which LLVM was configured]) -AC_DEFINE_UNQUOTED([LLVMGCCDIR],"$LLVMGCCDIR", - [Installation directory of llvm-gcc]) dnl===-----------------------------------------------------------------------=== dnl=== From reid at x10sys.com Wed Dec 15 16:28:03 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 16:28:03 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200412152228.QAA12446@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.152 -> 1.153 --- Log message: Remove LLVMGCCDIR from the set of defines. --- Diffs of the changes: (+0 -5) Index: llvm/configure diff -u llvm/configure:1.152 llvm/configure:1.153 --- llvm/configure:1.152 Tue Dec 14 22:01:48 2004 +++ llvm/configure Wed Dec 15 16:27:51 2004 @@ -29437,11 +29437,6 @@ _ACEOF -cat >>confdefs.h <<_ACEOF -#define LLVMGCCDIR "$LLVMGCCDIR" -_ACEOF - - ac_config_headers="$ac_config_headers include/llvm/Config/config.h" From reid at x10sys.com Wed Dec 15 16:28:46 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 16:28:46 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200412152228.QAA12487@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.39 -> 1.40 --- Log message: Remove LLVMGCCDIR. --- Diffs of the changes: (+0 -3) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.39 llvm/include/llvm/Config/config.h.in:1.40 --- llvm/include/llvm/Config/config.h.in:1.39 Tue Dec 14 19:41:56 2004 +++ llvm/include/llvm/Config/config.h.in Wed Dec 15 16:28:35 2004 @@ -320,9 +320,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_WINDOWS_H -/* Installation directory of llvm-gcc */ -#undef LLVMGCCDIR - /* Installation directory for binary executables */ #undef LLVM_BINDIR From reid at x10sys.com Wed Dec 15 16:49:29 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 16:49:29 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200412152249.QAA12930@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.18 -> 1.19 --- Log message: Adjust documentation of GetBytecodeLibraryPaths after removing LLVMGCCDIR support from it. --- Diffs of the changes: (+25 -24) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.18 llvm/include/llvm/System/Path.h:1.19 --- llvm/include/llvm/System/Path.h:1.18 Wed Dec 15 02:32:45 2004 +++ llvm/include/llvm/System/Path.h Wed Dec 15 16:49:18 2004 @@ -99,10 +99,10 @@ /// Construct a vector of sys::Path that contains the "standard" bytecode /// library paths suitable for linking into an llvm program. This function - /// *must* return the value of LLVM_LIB_SEARCH_PATH as well as the values - /// of LLVM_LIBDIR and LLVMGCCDIR/lib (if --with-llvmgccdir was specified - /// when LLVM was configured). It also must provide the - /// System library paths as returned by GetSystemLibraryPaths. + /// *must* return the value of LLVM_LIB_SEARCH_PATH as well as the value + /// of LLVM_LIBDIR. It also must provide the System library paths as + /// returned by GetSystemLibraryPaths. + /// @see GetSystemLibraryPaths /// @brief Construct a list of directories in which bytecode could be /// found. static void GetBytecodeLibraryPaths(std::vector& Paths); @@ -353,6 +353,27 @@ /// @brief Build a list of directory's contents. bool getDirectoryContents(std::set& paths) const; + /// This method attempts to destroy the directory named by the last in + /// the Path name. If \p remove_contents is false, an attempt will be + /// made to remove just the directory that this Path object refers to + /// (the final Path component). If \p remove_contents is true, an attempt + /// will be made to remove the entire contents of the directory, + /// recursively. + /// @param destroy_contents Indicates whether the contents of a destroyed + /// directory should also be destroyed (recursively). + /// @returns false if the Path does not refer to a directory, true + /// otherwise. + /// @throws std::string if there is an error. + /// @brief Removes the file or directory from the filesystem. + bool destroyDirectory( bool destroy_contents = false ) const; + + /// This method attempts to destroy the file named by the last item in the + /// Path name. + /// @returns false if the Path does not refer to a file, true otherwise. + /// @throws std::string if there is an error. + /// @brief Destroy the file this Path refers to. + bool destroyFile() const; + /// Obtain a 'C' string for the path name. /// @returns a 'C' string containing the path name. /// @brief Returns the path as a C string. @@ -531,26 +552,6 @@ /// @brief Create a unique temporary file bool createTemporaryFile(bool reuse_current = false); - /// This method attempts to destroy the directory named by the last in - /// the Path name. If \p remove_contents is false, an attempt will be - /// made to remove just the directory that this Path object refers to - /// (the final Path component). If \p remove_contents is true, an attempt - /// will be made to remove the entire contents of the directory, - /// recursively. - /// @param destroy_contents Indicates whether the contents of a destroyed - /// directory should also be destroyed (recursively). - /// @returns false if the Path does not refer to a directory, true - /// otherwise. - /// @throws std::string if there is an error. - /// @brief Removes the file or directory from the filesystem. - bool destroyDirectory( bool destroy_contents = false ); - - /// This method attempts to destroy the file named by the last item in the - /// Path name. - /// @returns false if the Path does not refer to a file, true otherwise. - /// @throws std::string if there is an error. - /// @brief Destroy the file this Path refers to. - bool destroyFile(); /// This method renames the file referenced by \p this as \p newName. Both /// files must exist before making this call. From reid at x10sys.com Wed Dec 15 17:02:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 17:02:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200412152302.RAA13517@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.24 -> 1.25 --- Log message: Change the signatures of the destroyFile and destroyDirectory methods to const because they affect the file system, not the Path object. --- Diffs of the changes: (+2 -2) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.24 llvm/lib/System/Unix/Path.cpp:1.25 --- llvm/lib/System/Unix/Path.cpp:1.24 Wed Dec 15 16:21:42 2004 +++ llvm/lib/System/Unix/Path.cpp Wed Dec 15 17:02:10 2004 @@ -492,7 +492,7 @@ } bool -Path::destroyDirectory(bool remove_contents) { +Path::destroyDirectory(bool remove_contents) const { // Make sure we're dealing with a directory if (!isDirectory()) return false; @@ -520,7 +520,7 @@ } bool -Path::destroyFile() { +Path::destroyFile() const { if (!isFile()) return false; if (0 != unlink(path.c_str())) ThrowErrno(path + ": Can't destroy file"); From reid at x10sys.com Wed Dec 15 17:02:22 2004 From: reid at x10sys.com (Reid Spencer) Date: Wed, 15 Dec 2004 17:02:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412152302.RAA13520@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.19 -> 1.20 --- Log message: Change the signatures of the destroyFile and destroyDirectory methods to const because they affect the file system, not the Path object. --- Diffs of the changes: (+2 -2) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.19 llvm/lib/System/Win32/Path.cpp:1.20 --- llvm/lib/System/Win32/Path.cpp:1.19 Wed Dec 15 16:22:51 2004 +++ llvm/lib/System/Win32/Path.cpp Wed Dec 15 17:02:10 2004 @@ -503,7 +503,7 @@ } bool -Path::destroyDirectory(bool remove_contents) { +Path::destroyDirectory(bool remove_contents) const { // Make sure we're dealing with a directory if (!isDirectory()) return false; @@ -532,7 +532,7 @@ } bool -Path::destroyFile() { +Path::destroyFile() const { if (!isFile()) return false; DWORD attr = GetFileAttributes(path.c_str()); From lattner at cs.uiuc.edu Wed Dec 15 17:13:31 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 17:13:31 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp Message-ID: <200412152313.iBFNDVMJ027969@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/CBackend: Writer.cpp updated: 1.215 -> 1.216 --- Log message: Fix PR485: http://llvm.cs.uiuc.edu/PR485 , instead of emitting zero sized arrays, emit arrays of size 1. --- Diffs of the changes: (+1 -0) Index: llvm/lib/Target/CBackend/Writer.cpp diff -u llvm/lib/Target/CBackend/Writer.cpp:1.215 llvm/lib/Target/CBackend/Writer.cpp:1.216 --- llvm/lib/Target/CBackend/Writer.cpp:1.215 Mon Dec 13 15:52:52 2004 +++ llvm/lib/Target/CBackend/Writer.cpp Wed Dec 15 17:13:15 2004 @@ -338,6 +338,7 @@ case Type::ArrayTyID: { const ArrayType *ATy = cast(Ty); unsigned NumElements = ATy->getNumElements(); + if (NumElements == 0) NumElements = 1; return printType(Out, ATy->getElementType(), NameSoFar + "[" + utostr(NumElements) + "]"); } From lattner at cs.uiuc.edu Wed Dec 15 17:38:28 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 17:38:28 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412152338.iBFNcSw3028782@apoc.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.265 -> 1.266 --- Log message: Make %'s a bit more explicit --- Diffs of the changes: (+10 -10) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.265 llvm/Makefile.rules:1.266 --- llvm/Makefile.rules:1.265 Wed Dec 15 11:14:06 2004 +++ llvm/Makefile.rules Wed Dec 15 17:38:13 2004 @@ -938,43 +938,43 @@ $(INCFiles) : $(TBLGEN) $(TDFiles) -%GenRegisterNames.inc : %.td +$(TARGET)GenRegisterNames.inc : $(TARGET).td $(Echo) "Building $( Changes in directory llvm/lib/System/Win32: TimeValue.cpp updated: 1.6 -> 1.7 --- Log message: Expository comment submitted by Henrik Bach --- Diffs of the changes: (+3 -0) Index: llvm/lib/System/Win32/TimeValue.cpp diff -u llvm/lib/System/Win32/TimeValue.cpp:1.6 llvm/lib/System/Win32/TimeValue.cpp:1.7 --- llvm/lib/System/Win32/TimeValue.cpp:1.6 Tue Dec 14 22:28:44 2004 +++ llvm/lib/System/Win32/TimeValue.cpp Wed Dec 15 22:06:56 2004 @@ -32,6 +32,9 @@ std::string TimeValue::toString() const { #ifdef __MINGW + // This ban may be lifted by either: + // (i) a future MinGW version other than 1.0 inherents the __time64_t type, or + // (ii) configure tests for either the time_t or __time64_t type. time_t ourTime = time_t(this->toEpochTime()); struct tm *lt = ::localtime(&ourTime); #else From lattner at cs.uiuc.edu Wed Dec 15 22:56:49 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed, 15 Dec 2004 22:56:49 -0600 Subject: [llvm-commits] CVS: llvm/utils/Burg/zalloc.c Message-ID: <200412160456.iBG4unwN001377@apoc.cs.uiuc.edu> Changes in directory llvm/utils/Burg: zalloc.c updated: 1.2 -> 1.3 --- Log message: Portability fix, thanks to Markus F.X.J. Oberhumer. --- Diffs of the changes: (+2 -5) Index: llvm/utils/Burg/zalloc.c diff -u llvm/utils/Burg/zalloc.c:1.2 llvm/utils/Burg/zalloc.c:1.3 --- llvm/utils/Burg/zalloc.c:1.2 Sat Sep 21 21:40:40 2002 +++ llvm/utils/Burg/zalloc.c Wed Dec 15 22:56:34 2004 @@ -1,13 +1,10 @@ -char rcsid_zalloc[] = "$Id: zalloc.c,v 1.2 2002/09/22 02:40:40 lattner Exp $"; +char rcsid_zalloc[] = "$Id: zalloc.c,v 1.3 2004/12/16 04:56:34 lattner Exp $"; #include #include +#include #include "b.h" -extern void exit ARGS((int)); -extern void free ARGS((void *)); -extern void *malloc ARGS((unsigned)); - int fatal(const char *name, int line) { From reid at x10sys.com Thu Dec 16 01:14:30 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 01:14:30 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412160714.BAA22897@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.266 -> 1.267 --- Log message: Revert last patch which breaks PowerPC target because it fails to build the 32bit and 64bit variants. --- Diffs of the changes: (+10 -10) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.266 llvm/Makefile.rules:1.267 --- llvm/Makefile.rules:1.266 Wed Dec 15 17:38:13 2004 +++ llvm/Makefile.rules Thu Dec 16 01:14:19 2004 @@ -938,43 +938,43 @@ $(INCFiles) : $(TBLGEN) $(TDFiles) -$(TARGET)GenRegisterNames.inc : $(TARGET).td +%GenRegisterNames.inc : %.td $(Echo) "Building $( Changes in directory llvm: Makefile.rules updated: 1.267 -> 1.268 --- Log message: Fix a major bug with BUILT_SOURCES. You actually have to dereference a variable before you can filter its value. Duh! --- Diffs of the changes: (+1 -1) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.267 llvm/Makefile.rules:1.268 --- llvm/Makefile.rules:1.267 Thu Dec 16 01:14:19 2004 +++ llvm/Makefile.rules Thu Dec 16 01:15:16 2004 @@ -74,7 +74,7 @@ #------------------------------------------------------------------------ # Make sure the BUILT_SOURCES are built first #------------------------------------------------------------------------ -$(filter-out clean clean-local,UserTargets):: $(BUILT_SOURCES) +$(filter-out clean clean-local,$(UserTargets)):: $(BUILT_SOURCES) clean-local:: ifneq ($(strip $(BUILT_SOURCES)),) From reid at x10sys.com Thu Dec 16 01:36:19 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 01:36:19 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412160736.BAA23251@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.268 -> 1.269 --- Log message: Get rid of extraneous dependencies on $(BUILT_SOURCES) now that we've fixed the bug with BUILT_SOURCES being dependencies of the user targets. --- Diffs of the changes: (+6 -6) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.268 llvm/Makefile.rules:1.269 --- llvm/Makefile.rules:1.268 Thu Dec 16 01:15:16 2004 +++ llvm/Makefile.rules Thu Dec 16 01:36:08 2004 @@ -548,7 +548,7 @@ all-local:: $(LibName.LA) -$(LibName.LA): $(BUILT_SOURCES) $(ObjectsLO) $(LibDir)/.dir +$(LibName.LA): $(ObjectsLO) $(LibDir)/.dir $(Echo) Linking $(BuildMode) Shared Library $(LIBRARYNAME)$(SHLIBEXT) $(Verb) $(Link) -o $@ $(ObjectsLO) $(Verb) $(LTInstall) $@ $(LibDir) @@ -591,7 +591,7 @@ BCLinkLib = $(LLVMGCC) -shared -nostdlib -Xlinker \ -internalize-public-api-file=$(EXPORTED_SYMBOL_FILE) -$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir $(GCCLD) \ +$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir $(GCCLD) \ $(LLVMToolDir)/llvm-ar $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) \ "(internalize)" @@ -599,7 +599,7 @@ $(Verb) $(RM) -f $@ $(Verb) $(LArchive) $@ $(ObjDir)/$(LIBRARYNAME).o else -$(LibName.BCA): $(BUILT_SOURCES) $(ObjectsBC) $(LibDir)/.dir \ +$(LibName.BCA): $(ObjectsBC) $(LibDir)/.dir \ $(LLVMToolDir)/llvm-ar $(Echo) Building $(BuildMode) Bytecode Archive $(notdir $@) $(Verb) $(RM) -f $@ @@ -643,7 +643,7 @@ all-local:: $(LibName.O) -$(LibName.O): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir +$(LibName.O): $(ObjectsO) $(LibDir)/.dir $(Echo) Linking $(BuildMode) Object Library $(notdir $@) $(Verb) $(Relink) -o $@ $(ObjectsO) @@ -675,7 +675,7 @@ all-local:: $(LibName.A) -$(LibName.A): $(BUILT_SOURCES) $(ObjectsO) $(LibDir)/.dir +$(LibName.A): $(ObjectsO) $(LibDir)/.dir $(Echo) Building $(BuildMode) Archive Library $(notdir $@) -$(Verb) $(RM) -f $@ $(Verb) $(Archive) $@ $(ObjectsO) @@ -807,7 +807,7 @@ $(ToolBuildPath): $(ToolDir)/.dir endif -$(ToolBuildPath): $(BUILT_SOURCES) $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) +$(ToolBuildPath): $(ObjectsO) $(ProjLibsPaths) $(LLVMLibsPaths) $(Echo) Linking $(BuildMode) executable $(TOOLNAME) $(StripWarnMsg) $(Verb) $(Link) -o $@ $(TOOLLINKOPTS) $(ObjectsO) $(ProjLibsOptions) \ $(LLVMLibsOptions) $(ExtraLibs) $(TOOLLINKOPTSB) From reid at x10sys.com Thu Dec 16 02:00:57 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 02:00:57 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412160800.CAA23666@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.269 -> 1.270 --- Log message: Add a "make spotless" rule for environments with BUILD_OBJ_ROOT not equal to BUILD_OBJ_SRC. This will save the config.status and mklib files, then wipe out the BUILD_OBJ_ROOT, copy back config.status and mklib, and then run config.status to regenerate the makefiles. This target gives you a completely clean/fresh BUILD_OBJ_ROOT. --- Diffs of the changes: (+15 -0) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.269 llvm/Makefile.rules:1.270 --- llvm/Makefile.rules:1.269 Thu Dec 16 01:36:08 2004 +++ llvm/Makefile.rules Thu Dec 16 02:00:46 2004 @@ -81,6 +81,21 @@ -$(Verb) $(RM) -f $(BUILT_SOURCES) endif +ifneq ($(BUILD_OBJ_ROOT),$(BUILD_SRC_ROOT)) +spotless: + $(Echo) Wiping out $(BUILD_OBJ_ROOT) and rebuilding configuration. + $(Verb) if test -x config.status ; then \ + $(MV) config.status .. ; \ + $(MV) mklib .. ; \ + $(RM) -rf * ; \ + $(MV) ../config.status . ; \ + $(MV) ../mklib . ; \ + ./config.status ; \ + else \ + $(EchoCmd) "make spotless" can only be run from $(BUILD_OBJ_ROOT); \ + fi +endif + $(BUILT_SOURCES) : $(ObjMakefiles) #------------------------------------------------------------------------ From lattner at cs.uiuc.edu Thu Dec 16 10:32:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 10:32:12 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32.td PPC64.td PowerPC.td PowerPCInstrInfo.td Message-ID: <200412161632.iBGGWC9S016561@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: PPC32.td updated: 1.3 -> 1.4 PPC64.td updated: 1.4 -> 1.5 PowerPC.td updated: 1.11 -> 1.12 PowerPCInstrInfo.td updated: 1.48 -> 1.49 --- Log message: Factor out common .td file chunks. --- Diffs of the changes: (+8 -27) Index: llvm/lib/Target/PowerPC/PPC32.td diff -u llvm/lib/Target/PowerPC/PPC32.td:1.3 llvm/lib/Target/PowerPC/PPC32.td:1.4 --- llvm/lib/Target/PowerPC/PPC32.td:1.3 Tue Nov 23 14:37:41 2004 +++ llvm/lib/Target/PowerPC/PPC32.td Thu Dec 16 10:31:57 2004 @@ -21,15 +21,6 @@ include "PPC32RegisterInfo.td" include "PowerPCInstrInfo.td" -def PowerPCInstrInfo : InstrInfo { - let PHIInst = PHI; - - let TSFlagsFields = [ "VMX", "PPC64" ]; - let TSFlagsShifts = [ 0, 1 ]; - - let isLittleEndianEncoding = 1; -} - def PPC32 : Target { // Pointers on PPC32 are 32-bits in size. let PointerType = i32; Index: llvm/lib/Target/PowerPC/PPC64.td diff -u llvm/lib/Target/PowerPC/PPC64.td:1.4 llvm/lib/Target/PowerPC/PPC64.td:1.5 --- llvm/lib/Target/PowerPC/PPC64.td:1.4 Tue Nov 23 14:37:41 2004 +++ llvm/lib/Target/PowerPC/PPC64.td Thu Dec 16 10:31:57 2004 @@ -21,15 +21,6 @@ include "PPC64RegisterInfo.td" include "PowerPCInstrInfo.td" -def PowerPCInstrInfo : InstrInfo { - let PHIInst = PHI; - - let TSFlagsFields = [ "VMX", "PPC64" ]; - let TSFlagsShifts = [ 0, 1 ]; - - let isLittleEndianEncoding = 1; -} - def PPC64 : Target { // Pointers on PPC64 are 64-bits in size. let PointerType = i64; Index: llvm/lib/Target/PowerPC/PowerPC.td diff -u llvm/lib/Target/PowerPC/PowerPC.td:1.11 llvm/lib/Target/PowerPC/PowerPC.td:1.12 --- llvm/lib/Target/PowerPC/PowerPC.td:1.11 Tue Nov 23 14:37:41 2004 +++ llvm/lib/Target/PowerPC/PowerPC.td Thu Dec 16 10:31:57 2004 @@ -21,15 +21,6 @@ include "PPC64RegisterInfo.td" include "PowerPCInstrInfo.td" -def PowerPCInstrInfo : InstrInfo { - let PHIInst = PHI; - - let TSFlagsFields = [ "VMX", "PPC64" ]; - let TSFlagsShifts = [ 0, 1 ]; - - let isLittleEndianEncoding = 1; -} - def PowerPC : Target { // Pointers on PowerPC are 64-bits in size. let PointerType = i64; Index: llvm/lib/Target/PowerPC/PowerPCInstrInfo.td diff -u llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.48 llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.49 --- llvm/lib/Target/PowerPC/PowerPCInstrInfo.td:1.48 Wed Nov 24 21:53:44 2004 +++ llvm/lib/Target/PowerPC/PowerPCInstrInfo.td Thu Dec 16 10:31:57 2004 @@ -440,4 +440,12 @@ (ops GPRC:$rA, GPRC:$rS, u6imm:$SH, u6imm:$ME), "rldicr $rA, $rS, $SH, $ME">; +def PowerPCInstrInfo : InstrInfo { + let PHIInst = PHI; + + let TSFlagsFields = [ "VMX", "PPC64" ]; + let TSFlagsShifts = [ 0, 1 ]; + + let isLittleEndianEncoding = 1; +} From lattner at cs.uiuc.edu Thu Dec 16 10:47:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 10:47:18 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp Message-ID: <200412161647.iBGGlIie018331@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9AsmPrinter.cpp updated: 1.124 -> 1.125 --- Log message: Fix header --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp diff -u llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.124 llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.125 --- llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp:1.124 Sat Oct 16 21:44:45 2004 +++ llvm/lib/Target/SparcV9/SparcV9AsmPrinter.cpp Thu Dec 16 10:47:03 2004 @@ -1,4 +1,4 @@ -//===-- EmitAssembly.cpp - Emit SparcV9 Specific .s File -------------------==// +//===-- SparcV9AsmPrinter.cpp - Emit SparcV9 Specific .s File --------------==// // // The LLVM Compiler Infrastructure // From lattner at cs.uiuc.edu Thu Dec 16 10:48:08 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 10:48:08 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/Makefile SparcV9CodeEmitter.cpp Message-ID: <200412161648.iBGGm8DL018664@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: Makefile updated: 1.52 -> 1.53 SparcV9CodeEmitter.cpp updated: 1.78 -> 1.79 --- Log message: Use the rules in Makefile.rules to build SparcV9GenCodeEmitter.inc instead of custom rules. --- Diffs of the changes: (+11 -14) Index: llvm/lib/Target/SparcV9/Makefile diff -u llvm/lib/Target/SparcV9/Makefile:1.52 llvm/lib/Target/SparcV9/Makefile:1.53 --- llvm/lib/Target/SparcV9/Makefile:1.52 Sat Oct 30 04:19:36 2004 +++ llvm/lib/Target/SparcV9/Makefile Thu Dec 16 10:47:56 2004 @@ -10,8 +10,10 @@ LIBRARYNAME = LLVMSparcV9 PARALLEL_DIRS = InstrSched LiveVar ModuloScheduling RegAlloc +TARGET = SparcV9 + BUILT_SOURCES = \ - SparcV9CodeEmitter.inc \ + SparcV9GenCodeEmitter.inc \ SparcV9.burm.cpp include $(LEVEL)/Makefile.common @@ -28,10 +30,6 @@ $(Echo) "Burging `basename $<`" $(Verb) $(BURG) -I $< -o $@ -SparcV9CodeEmitter.inc: $(BUILD_SRC_DIR)/SparcV9.td $(TDFiles) $(TBLGEN) - $(Echo) "Running tblgen on SparcV9.td" - $(Verb) $(TableGen) -gen-emitter -o $@ $< - clean:: - $(Verb) $(RM) -f SparcV9CodeEmitter.inc SparcV9.burg.in1 SparcV9.burm SparcV9.burm.cpp + $(Verb) $(RM) -f SparcV9.burg.in1 SparcV9.burm SparcV9.burm.cpp Index: llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp diff -u llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.78 llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.79 --- llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp:1.78 Tue Nov 23 09:57:01 2004 +++ llvm/lib/Target/SparcV9/SparcV9CodeEmitter.cpp Thu Dec 16 10:47:56 2004 @@ -9,14 +9,13 @@ // // SPARC-specific backend for emitting machine code to memory. // -// This module also contains the code for lazily resolving the targets -// of call instructions, including the callback used to redirect calls -// to functions for which the code has not yet been generated into the -// JIT compiler. +// This module also contains the code for lazily resolving the targets of call +// instructions, including the callback used to redirect calls to functions for +// which the code has not yet been generated into the JIT compiler. // -// This file #includes SparcV9CodeEmitter.inc, which contains the code -// for getBinaryCodeForInstr(), a method that converts a MachineInstr -// into the corresponding binary machine code word. +// This file #includes SparcV9GenCodeEmitter.inc, which contains the code for +// getBinaryCodeForInstr(), a method that converts a MachineInstr into the +// corresponding binary machine code word. // //===----------------------------------------------------------------------===// @@ -300,5 +299,5 @@ } } -#include "SparcV9CodeEmitter.inc" +#include "SparcV9GenCodeEmitter.inc" From lattner at cs.uiuc.edu Thu Dec 16 11:26:59 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 11:26:59 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/Makefile Message-ID: <200412161726.iBGHQxt1022627@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/PowerPC: Makefile updated: 1.16 -> 1.17 --- Log message: Specify all of the targets built. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/PowerPC/Makefile diff -u llvm/lib/Target/PowerPC/Makefile:1.16 llvm/lib/Target/PowerPC/Makefile:1.17 --- llvm/lib/Target/PowerPC/Makefile:1.16 Wed Oct 27 18:18:45 2004 +++ llvm/lib/Target/PowerPC/Makefile Thu Dec 16 11:26:44 2004 @@ -8,7 +8,7 @@ ##===----------------------------------------------------------------------===## LEVEL = ../../.. LIBRARYNAME = LLVMPowerPC -TARGET = PowerPC +TARGET = PowerPC PPC32 PPC64 # Make sure that tblgen is run, first thing. BUILT_SOURCES = PowerPCGenInstrNames.inc PowerPCGenRegisterNames.inc \ From lattner at cs.uiuc.edu Thu Dec 16 11:29:03 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 11:29:03 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412161729.iBGHT3pC022640@apoc.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.270 -> 1.271 --- Log message: When tblgen changes, regenerate all .inc files, but do not rebuild any .o files that USE the .inc file unless the contents of the .inc file changes. This should fix the problem where reconfiguring causes all targets to be completely rebuilt (because config.h is usually modified, causing libsystem to be rebuilt, causing tblgen to be rebuilt, causing .inc files to be rebuilt, causing .o files to be rebuilt). This patch also checks in a gross hack where .o files now explicitly depend on $(BUILT_SOURCES), to avoid problems where the .inc files are not completely generated before the .o files start to compile. --- Diffs of the changes: (+78 -23) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.270 llvm/Makefile.rules:1.271 --- llvm/Makefile.rules:1.270 Thu Dec 16 02:00:46 2004 +++ llvm/Makefile.rules Thu Dec 16 11:28:50 2004 @@ -854,13 +854,13 @@ #--------------------------------------------------------- ifdef SHARED_LIBRARY -$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir +$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \ else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi -$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir +$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.c for $(BuildMode) build (PIC)" $(Verb) if $(LTCompile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACd $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.LACd" "$(ObjDir)/$*.d"; \ @@ -871,13 +871,13 @@ #--------------------------------------------------------- else -$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir +$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(Verb) if $(Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.CXXd $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.CXXd" "$(ObjDir)/$*.d"; \ else $(RM) -f "$(ObjDir)/$*.CXXd"; exit 1; fi -$(ObjDir)/%.o: %.c $(ObjDir)/.dir +$(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.c for $(BuildMode) build" $(Verb) if $(Compile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.Cd $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.Cd" "$(ObjDir)/$*.d"; \ @@ -888,13 +888,13 @@ #--------------------------------------------------------- # Create .bc files in the ObjDir directory from .cpp and .c files... #--------------------------------------------------------- -$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS) +$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS) $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)" $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \ else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi -$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS) +$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS) $(BUILT_SOURCES) $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)" $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \ @@ -905,30 +905,30 @@ ifdef SHARED_LIBRARY -$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir +$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" $(LTCompile.CXX) $< -o $@ -$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir +$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" $(LTCompile.C) $< -o $@ else -$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir +$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(Compile.CXX) $< -o $@ -$(ObjDir)/%.o: %.c $(ObjDir)/.dir +$(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(Compile.C) $< -o $@ endif -$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS) +$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS) $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)" $(BCCompile.CXX) $< -o $@ -$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS) +$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS) $(BUILT_SOURCES) $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)" $(BCCompile.C) $< -o $@ @@ -950,49 +950,103 @@ TDFiles := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(LLVM_SRC_ROOT)/lib/Target/Target.td) INCFiles := $(filter %.inc,$(BUILT_SOURCES)) +INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp) +.PRECIOUS: $(INCTMPFiles) $(INCFiles) -$(INCFiles) : $(TBLGEN) $(TDFiles) +# All of these files depend on tblgen and the .td files. +$(INCTMPFiles) : $(TBLGEN) $(TDFiles) -%GenRegisterNames.inc : %.td + +$(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \ +$(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir $(Echo) "Building $( Changes in directory llvm/lib/Target/X86: Makefile updated: 1.22 -> 1.23 X86AsmPrinter.cpp updated: 1.128 -> 1.129 --- Log message: Adjust to changes in asmwriter filenames --- Diffs of the changes: (+4 -4) Index: llvm/lib/Target/X86/Makefile diff -u llvm/lib/Target/X86/Makefile:1.22 llvm/lib/Target/X86/Makefile:1.23 --- llvm/lib/Target/X86/Makefile:1.22 Wed Oct 27 18:18:45 2004 +++ llvm/lib/Target/X86/Makefile Thu Dec 16 11:33:24 2004 @@ -12,8 +12,8 @@ # Make sure that tblgen is run, first thing. BUILT_SOURCES = X86GenRegisterInfo.h.inc X86GenRegisterNames.inc \ X86GenRegisterInfo.inc X86GenInstrNames.inc \ - X86GenInstrInfo.inc X86GenATTAsmWriter.inc \ - X86GenIntelAsmWriter.inc + X86GenInstrInfo.inc X86GenAsmWriter.inc \ + X86GenAsmWriter1.inc include $(LEVEL)/Makefile.common Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.128 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.129 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.128 Sun Nov 14 15:03:49 2004 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Thu Dec 16 11:33:24 2004 @@ -222,7 +222,7 @@ // Include the auto-generated portion of the assembly writer. -#include "X86GenIntelAsmWriter.inc" +#include "X86GenAsmWriter1.inc" /// runOnMachineFunction - This uses the printMachineInstruction() @@ -445,7 +445,7 @@ // Include the auto-generated portion of the assembly writer. -#include "X86GenATTAsmWriter.inc" +#include "X86GenAsmWriter.inc" /// runOnMachineFunction - This uses the printMachineInstruction() From lattner at cs.uiuc.edu Thu Dec 16 11:34:16 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 11:34:16 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412161734.iBGHYGGU022910@apoc.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.271 -> 1.272 --- Log message: Add spaces between rule groups to make it more obvious which ones pair Remove instrselector generation, remove Intel/ATT specifics from Makefile.rules. --- Diffs of the changes: (+10 -22) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.271 llvm/Makefile.rules:1.272 --- llvm/Makefile.rules:1.271 Thu Dec 16 11:28:50 2004 +++ llvm/Makefile.rules Thu Dec 16 11:34:04 2004 @@ -966,6 +966,7 @@ %GenRegisterNames.inc : $(ObjDir)/%GenRegisterNames.inc.tmp $(Verb) cmp -s $@ $< || cp $< $@ + $(TARGET:%=$(ObjDir)/%GenRegisterInfo.h.inc.tmp): \ $(ObjDir)/%GenRegisterInfo.h.inc.tmp : %.td $(ObjDir)/.dir $(Echo) "Building $( Changes in directory llvm: Makefile.rules updated: 1.272 -> 1.273 --- Log message: Factor all of the .inc : .inc.tmp rules into one. --- Diffs of the changes: (+8 -38) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.272 llvm/Makefile.rules:1.273 --- llvm/Makefile.rules:1.272 Thu Dec 16 11:34:04 2004 +++ llvm/Makefile.rules Thu Dec 16 11:38:56 2004 @@ -956,85 +956,55 @@ # All of these files depend on tblgen and the .td files. $(INCTMPFiles) : $(TBLGEN) $(TDFiles) +# INCFiles rule: All of the tblgen generated files are emitted to +# $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows +# us to only "touch" the real file if the contents of it change. IOW, if +# tblgen is modified, all of the .inc.tmp files are regereated, but no +# dependencies of the .inc files are, unless the contents of the .inc file +# changes. +$(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp + $(Verb) cmp -s $@ $< || cp $< $@ $(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \ $(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir $(Echo) "Building $( References: <200412161729.iBGHT3pC022640@apoc.cs.uiuc.edu> Message-ID: <1103219015.32418.152.camel@bashful.x10sys.com> On Thu, 2004-12-16 at 09:29, Chris Lattner wrote: > #--------------------------------------------------------- > ifdef SHARED_LIBRARY > > -$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir > +$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) > $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" > $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ; \ > then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \ > else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi > > -$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir > +$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) > $(Echo) "Compiling $*.c for $(BuildMode) build (PIC)" > $(Verb) if $(LTCompile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACd $< -o $@ ; \ > then $(MV) -f "$(ObjDir)/$*.LACd" "$(ObjDir)/$*.d"; \ Is it really necessary to add $(BUILT_SOURCES) back into these rules? The "all" target now properly depends on BUILT_SOURCES. > @@ -950,49 +950,103 @@ > > TDFiles := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(LLVM_SRC_ROOT)/lib/Target/Target.td) > INCFiles := $(filter %.inc,$(BUILT_SOURCES)) > +INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp) > +.PRECIOUS: $(INCTMPFiles) $(INCFiles) With .PRECIOUS you are asking for the INC and TMP files to NOT be removed by make if an error occurs while building them. In general that is a bad idea because the files might be partially constructed leading to error on the next build. > -%GenRegisterNames.inc : %.td > + > +$(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \ > +$(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir > $(Echo) "Building $( $(Verb) $(TableGen) -gen-register-enums -o $@ $< > This looks fine to me. > -%GenRegisterInfo.h.inc : %.td > +$(TARGET:%=%GenRegisterNames.inc): \ > +%GenRegisterNames.inc : $(ObjDir)/%GenRegisterNames.inc.tmp > + $(Verb) cmp -s $@ $< || cp $< $@ > + I'll do the conversion of cmp -> $(CMP) and cp -> $(CP). Rest looks good. Reid. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20041216/c7099abd/attachment.bin From sabre at nondot.org Thu Dec 16 12:04:27 2004 From: sabre at nondot.org (Chris Lattner) Date: Thu, 16 Dec 2004 12:04:27 -0600 (CST) Subject: [llvm-commits] CVS: llvm/Makefile.rules In-Reply-To: <1103219015.32418.152.camel@bashful.x10sys.com> References: <200412161729.iBGHT3pC022640@apoc.cs.uiuc.edu> <1103219015.32418.152.camel@bashful.x10sys.com> Message-ID: On Thu, 16 Dec 2004, Reid Spencer wrote: >> TDFiles := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(LLVM_SRC_ROOT)/lib/Target/Target.td) >> INCFiles := $(filter %.inc,$(BUILT_SOURCES)) >> +INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp) >> +.PRECIOUS: $(INCTMPFiles) $(INCFiles) > > With .PRECIOUS you are asking for the INC and TMP files to NOT be > removed by make if an error occurs while building them. In general that > is a bad idea because the files might be partially constructed leading > to error on the next build. Ah, that's definitely not what I want. I thought precious was to prevent make from removing intermediate files? While it has the behavior you mention, it also: "Also, if the target is an intermediate file, it will not be deleted after it is no longer needed, as is normally done." http://www.gnu.org/software/make/manual/html_mono/make.html#SEC44 If you'd like me to remove the .PRECIOUS, I definitely will. >> -%GenRegisterInfo.h.inc : %.td >> +$(TARGET:%=%GenRegisterNames.inc): \ >> +%GenRegisterNames.inc : $(ObjDir)/%GenRegisterNames.inc.tmp >> + $(Verb) cmp -s $@ $< || cp $< $@ >> + > I'll do the conversion of cmp -> $(CMP) and cp -> $(CP). Thanks! -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/ From reid at x10sys.com Thu Dec 16 11:48:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 11:48:25 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200412161748.LAA21581@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.144 -> 1.145 --- Log message: Add CMP and CP configuration variables for the unix cmp and cp programs. --- Diffs of the changes: (+2 -0) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.144 llvm/autoconf/configure.ac:1.145 --- llvm/autoconf/configure.ac:1.144 Wed Dec 15 16:27:51 2004 +++ llvm/autoconf/configure.ac Thu Dec 16 11:48:14 2004 @@ -237,6 +237,8 @@ dnl Check for the tools that the makefiles require AC_CHECK_GNU_MAKE AC_PROG_LN_S +AC_PATH_PROG(CMP, [cmp], [cmp]) +AC_PATH_PROG(CP, [cp], [cp]) AC_PATH_PROG(DATE, [date], [date]) AC_PATH_PROG(FIND, [find], [find]) AC_PATH_PROG(GREP, [grep], [grep]) From reid at x10sys.com Thu Dec 16 11:48:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 11:48:25 -0600 Subject: [llvm-commits] CVS: llvm/configure Makefile.config.in Message-ID: <200412161748.LAA21586@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.153 -> 1.154 Makefile.config.in updated: 1.43 -> 1.44 --- Log message: Add CMP and CP configuration variables for the unix cmp and cp programs. --- Diffs of the changes: (+114 -30) Index: llvm/configure diff -u llvm/configure:1.153 llvm/configure:1.154 --- llvm/configure:1.153 Wed Dec 15 16:27:51 2004 +++ llvm/configure Thu Dec 16 11:48:14 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 LLVMGCCDIR CPP CXX CXXFLAGS ac_ct_CXX LEX LEXLIB LEX_OUTPUT_ROOT FLEX YACC BISON ifGNUmake LN_S 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 CXXC! PP F77 FFLAGS ac_ct_F77 LIBTOOL ETAGSFLAGS ALLOCA MMAP_FILE LLVMGCC LLVMCC1 LLVMCC1PLUS 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 ARCH ENDIAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT ENABLE_OPTIMIZED JIT ENABLE_DOXYGEN LLVMGCCDIR 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_STR! IP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL ETAGSFLAGS ALLOCA MMAP_FILE LLVMGCC LLVMCC1 LLVMCC1PLUS 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. @@ -4494,6 +4494,86 @@ echo "${ECHO_T}no, using $LN_S" >&6 fi +# Extract the first word of "cmp", so it can be a program name with args. +set dummy cmp; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_CMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $CMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_CMP="$CMP" # 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_CMP="$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_CMP" && ac_cv_path_CMP="cmp" + ;; +esac +fi +CMP=$ac_cv_path_CMP + +if test -n "$CMP"; then + echo "$as_me:$LINENO: result: $CMP" >&5 +echo "${ECHO_T}$CMP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "cp", so it can be a program name with args. +set dummy cp; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_CP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $CP in + [\\/]* | ?:[\\/]*) + ac_cv_path_CP="$CP" # 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_CP="$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_CP" && ac_cv_path_CP="cp" + ;; +esac +fi +CP=$ac_cv_path_CP + +if test -n "$CP"; then + echo "$as_me:$LINENO: result: $CP" >&5 +echo "${ECHO_T}$CP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + # Extract the first word of "date", so it can be a program name with args. set dummy date; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -8109,7 +8189,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 10183 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -10585,7 +10665,7 @@ # Provide some information about the compiler. -echo "$as_me:10588:" \ +echo "$as_me:10668:" \ "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 @@ -11642,11 +11722,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11645: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11725: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11649: \$? = $ac_status" >&5 + echo "$as_me:11729: \$? = $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 @@ -11885,11 +11965,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11888: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11968: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11892: \$? = $ac_status" >&5 + echo "$as_me:11972: \$? = $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 @@ -11945,11 +12025,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11948: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12028: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11952: \$? = $ac_status" >&5 + echo "$as_me:12032: \$? = $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 @@ -14130,7 +14210,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:16504: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16428: \$? = $ac_status" >&5 + echo "$as_me:16508: \$? = $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 @@ -16481,11 +16561,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16484: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16564: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16488: \$? = $ac_status" >&5 + echo "$as_me:16568: \$? = $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 @@ -17842,7 +17922,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:18860: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:18784: \$? = $ac_status" >&5 + echo "$as_me:18864: \$? = $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 @@ -18837,11 +18917,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:18840: $lt_compile\"" >&5) + (eval echo "\"\$as_me:18920: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:18844: \$? = $ac_status" >&5 + echo "$as_me:18924: \$? = $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 @@ -20876,11 +20956,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:20879: $lt_compile\"" >&5) + (eval echo "\"\$as_me:20959: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:20883: \$? = $ac_status" >&5 + echo "$as_me:20963: \$? = $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 @@ -21119,11 +21199,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21122: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21202: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:21126: \$? = $ac_status" >&5 + echo "$as_me:21206: \$? = $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 @@ -21179,11 +21259,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:21182: $lt_compile\"" >&5) + (eval echo "\"\$as_me:21262: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:21186: \$? = $ac_status" >&5 + echo "$as_me:21266: \$? = $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 @@ -23364,7 +23444,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: Makefile.rules updated: 1.273 -> 1.274 --- Log message: Some minor upgrades * Convert "cmp" usage to $(CMP) * Convert "cp" usage to $(CP) * Fix some build messages to reflect what's actually going on * Add a "reconfigure" target for forcing a reconfigure. Helps with testing things like Chris's recent changes. --- Diffs of the changes: (+19 -13) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.273 llvm/Makefile.rules:1.274 --- llvm/Makefile.rules:1.273 Thu Dec 16 11:38:56 2004 +++ llvm/Makefile.rules Thu Dec 16 12:26:53 2004 @@ -101,6 +101,12 @@ #------------------------------------------------------------------------ # Make sure we're not using a stale configuration #------------------------------------------------------------------------ +reconfigure: + $(Echo) Reconfiguring $(BUILD_OBJ_ROOT) + $(Verb) cd $(BUILD_OBJ_ROOT) && \ + $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \ + $(ConfigStatusScript) + .PRECIOUS: $(ConfigStatusScript) $(ConfigStatusScript): $(ConfigureScript) $(Echo) Reconfiguring with $< @@ -124,7 +130,7 @@ Makefile: $(BUILD_SRC_DIR)/Makefile $(Echo) "Updating Makefile" $(Verb) $(MKDIR) $(@D) - $(Verb) cp -f $< $@ + $(Verb) $(CP) -f $< $@ # Copy the Makefile.* files unless we're in the root directory which avoids # the copying of Makefile.config.in or other things that should be explicitly @@ -135,7 +141,7 @@ *.in) ;; \ *) $(Echo) "Updating $(@F)" ; \ $(MKDIR) $(@D) ; \ - cp -f $< $@ ;; \ + $(CP) -f $< $@ ;; \ esac endif @@ -391,7 +397,7 @@ $(Verb) for dir in $(DIRS); do \ if [ ! -f $$dir/Makefile ]; then \ $(MKDIR) $$dir; \ - cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ + $(CP) $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ fi; \ if [ ! -f $$dir/LLVM_DO_NOT_BUILD ]; then \ ($(MAKE) -C $$dir $@ ) || exit 1; \ @@ -408,7 +414,7 @@ $(Verb) for dir in $(EXPERIMENTAL_DIRS); do \ if [ ! -f $$dir/Makefile ]; then \ $(MKDIR) $$dir; \ - cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ + $(CP) $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ fi; \ if [ ! -f $$dir/LLVM_DO_NOT_BUILD ]; then \ ($(MAKE) -C $$dir $@ ) || exit 0; \ @@ -436,7 +442,7 @@ $(ParallelTargets) : $(Verb) if [ ! -f $(@D)/Makefile ]; then \ $(MKDIR) $(@D); \ - cp $(BUILD_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \ + $(CP) $(BUILD_SRC_DIR)/$(@D)/Makefile $(@D)/Makefile; \ fi; \ if [ ! -f $$dir/LLVM_DO_NOT_BUILD ]; then \ $(MAKE) -C $(@D) $(subst $(@D)/.make,,$@) ; \ @@ -456,7 +462,7 @@ if [ -d $(BUILD_SRC_DIR)/$$dir ]; then\ if [ ! -f $$dir/Makefile ]; then \ $(MKDIR) $$dir; \ - cp $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ + $(CP) $(BUILD_SRC_DIR)/$$dir/Makefile $$dir/Makefile; \ fi; \ if [ ! -f $$dir/LLVM_DO_NOT_BUILD ]; then \ ($(MAKE) -C$$dir $@ ) || exit 1; \ @@ -910,7 +916,7 @@ $(LTCompile.CXX) $< -o $@ $(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" + $(Echo) "Compiling $*.c for $(BuildMode) build (PIC)" $(LTCompile.C) $< -o $@ else @@ -920,7 +926,7 @@ $(Compile.CXX) $< -o $@ $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) - $(Echo) "Compiling $*.cpp for $(BuildMode) build" + $(Echo) "Compiling $*.c for $(BuildMode) build" $(Compile.C) $< -o $@ endif @@ -963,7 +969,7 @@ # dependencies of the .inc files are, unless the contents of the .inc file # changes. $(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp - $(Verb) cmp -s $@ $< || cp $< $@ + $(Verb) $(CMP) -s $@ $< || $(CP) $< $@ $(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \ $(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir @@ -1323,13 +1329,13 @@ if test -d "$$from_dir/$$file"; then \ if test -d "$(BUILD_SRC_DIR)/$$file" && \ test "$$from_dir" != "$(BUILD_SRC_DIR)" ; then \ - cp -pR "$(BUILD_SRC_DIR)/$$file" "$$to_dir" || exit 1; \ + $(CP) -pR "$(BUILD_SRC_DIR)/$$file" "$$to_dir" || exit 1; \ fi; \ - cp -pR $$from_dir/$$file $$to_dir || exit 1; \ + $(CP) -pR $$from_dir/$$file $$to_dir || exit 1; \ elif test -f "$$from_dir/$$file" ; then \ - cp -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \ + $(CP) -p "$$from_dir/$$file" "$(DistDir)/$$file" || exit 1; \ elif test -L "$$from_dir/$$file" ; then \ - cp -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \ + $(CP) -pd "$$from_dir/$$file" $(DistDir)/$$file || exit 1; \ elif echo "$(DistAlways)" | grep -v "$$file" >/dev/null ; then \ $(EchoCmd) "===== WARNING: Distribution Source " \ "$$from_dir/$$file Not Found!" ; \ From reid at x10sys.com Thu Dec 16 12:47:27 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 12:47:27 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/DataTypes.h.in Message-ID: <200412161847.MAA22535@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: DataTypes.h.in updated: 1.17 -> 1.18 --- Log message: Get rid of inclusion of config.h because this file is autoconf'd. --- Diffs of the changes: (+2 -2) Index: llvm/include/llvm/Support/DataTypes.h.in diff -u llvm/include/llvm/Support/DataTypes.h.in:1.17 llvm/include/llvm/Support/DataTypes.h.in:1.18 --- llvm/include/llvm/Support/DataTypes.h.in:1.17 Wed Dec 8 23:51:11 2004 +++ llvm/include/llvm/Support/DataTypes.h.in Thu Dec 16 12:47:17 2004 @@ -21,11 +21,11 @@ #ifndef SUPPORT_DATATYPES_H #define SUPPORT_DATATYPES_H -#include "llvm/Config/config.h" - #undef HAVE_SYS_TYPES_H #undef HAVE_INTTYPES_H #undef HAVE_STDINT_H +#undef HAVE_UINT64_T +#undef HAVE_U_INT64_T #ifndef _MSC_VER From reid at x10sys.com Thu Dec 16 13:19:34 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 13:19:34 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/Linker.cpp Message-ID: <200412161919.NAA23117@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: Linker.cpp updated: 1.2 -> 1.3 --- Log message: Fix a compile error. config.h is now needed because DataTypes.h doesn't include it any more. --- Diffs of the changes: (+1 -0) Index: llvm/lib/Linker/Linker.cpp diff -u llvm/lib/Linker/Linker.cpp:1.2 llvm/lib/Linker/Linker.cpp:1.3 --- llvm/lib/Linker/Linker.cpp:1.2 Sun Dec 12 21:50:50 2004 +++ llvm/lib/Linker/Linker.cpp Thu Dec 16 13:19:24 2004 @@ -14,6 +14,7 @@ #include "llvm/Linker.h" #include "llvm/Module.h" #include "llvm/Bytecode/Reader.h" +#include "llvm/Config/config.h" #include using namespace llvm; From lattner at cs.uiuc.edu Thu Dec 16 13:32:53 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 13:32:53 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9Internals.h Message-ID: <200412161932.iBGJWrrx027816@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9Internals.h updated: 1.118 -> 1.119 --- Log message: Remove dead #include --- Diffs of the changes: (+0 -1) Index: llvm/lib/Target/SparcV9/SparcV9Internals.h diff -u llvm/lib/Target/SparcV9/SparcV9Internals.h:1.118 llvm/lib/Target/SparcV9/SparcV9Internals.h:1.119 --- llvm/lib/Target/SparcV9/SparcV9Internals.h:1.118 Sat Nov 6 18:43:24 2004 +++ llvm/lib/Target/SparcV9/SparcV9Internals.h Thu Dec 16 13:32:38 2004 @@ -22,7 +22,6 @@ #include "SparcV9RegInfo.h" #include "llvm/Type.h" #include "SparcV9RegClassInfo.h" -#include "llvm/Config/sys/types.h" namespace llvm { From lattner at cs.uiuc.edu Thu Dec 16 13:40:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 13:40:01 -0600 Subject: [llvm-commits] CVS: llvm/tools/llc/Makefile Message-ID: <200412161940.iBGJe1Vq005274@apoc.cs.uiuc.edu> Changes in directory llvm/tools/llc: Makefile updated: 1.63 -> 1.64 --- Log message: No targets actually use this library --- Diffs of the changes: (+0 -1) Index: llvm/tools/llc/Makefile diff -u llvm/tools/llc/Makefile:1.63 llvm/tools/llc/Makefile:1.64 --- llvm/tools/llc/Makefile:1.63 Thu Dec 9 23:04:13 2004 +++ llvm/tools/llc/Makefile Thu Dec 16 13:39:45 2004 @@ -17,7 +17,6 @@ LLVMSparcV9 \ LLVMX86 \ LLVMSkeleton \ - LLVMSelectionDAG \ LLVMSparcV9RegAlloc \ LLVMSparcV9InstrSched \ LLVMCodeGen \ From lattner at cs.uiuc.edu Thu Dec 16 13:40:23 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 13:40:23 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412161940.iBGJeN1J005313@apoc.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.274 -> 1.275 --- Log message: X86 doesn't actually use SelectionDAG yet. --- Diffs of the changes: (+1 -1) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.274 llvm/Makefile.rules:1.275 --- llvm/Makefile.rules:1.274 Thu Dec 16 12:26:53 2004 +++ llvm/Makefile.rules Thu Dec 16 13:40:10 2004 @@ -753,7 +753,7 @@ # What the X86 JIT requires ifdef ENABLE_X86_JIT - JIT_LIBS += LLVMX86 LLVMSelectionDAG + JIT_LIBS += LLVMX86 endif # You can enable the SparcV9 JIT on a non-SparcV9 host by setting the flag From alkis at cs.uiuc.edu Thu Dec 16 16:46:08 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu, 16 Dec 2004 16:46:08 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/Test.java Message-ID: <200412162246.QAA26005@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: Test.java updated: 1.5 -> 1.6 --- Log message: Use a getBytes(int, int, byte[], int) to print strings so that we don't use an encoding manager to do so. --- Diffs of the changes: (+6 -1) Index: llvm-java/test/Programs/SingleSource/UnitTests/Test.java diff -u llvm-java/test/Programs/SingleSource/UnitTests/Test.java:1.5 llvm-java/test/Programs/SingleSource/UnitTests/Test.java:1.6 --- llvm-java/test/Programs/SingleSource/UnitTests/Test.java:1.5 Sat Dec 11 21:30:57 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/Test.java Thu Dec 16 16:45:55 2004 @@ -9,7 +9,11 @@ public static native void println(long l); public static native void println(float f); public static native void println(double d); -// public static void println(String s) { println(s.getBytes()); } + public static void println(String s) { + byte[] bytes = new byte[s.length()]; + s.getBytes(0, s.length(), bytes, 0); + println(bytes); + } private static native void println(byte[] a); public static void main(String[] args) { @@ -24,5 +28,6 @@ println(753.46); println(-753.46); println(new byte[] { 'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd' }); + println("Hello world"); } } From alkis at cs.uiuc.edu Thu Dec 16 16:52:12 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Thu, 16 Dec 2004 16:52:12 -0600 Subject: [llvm-commits] CVS: llvm-java/test/Programs/SingleSource/UnitTests/Makefile Message-ID: <200412162252.QAA26245@zion.cs.uiuc.edu> Changes in directory llvm-java/test/Programs/SingleSource/UnitTests: Makefile updated: 1.32 -> 1.33 --- Log message: Make sure Test.h gets build first. --- Diffs of the changes: (+1 -3) Index: llvm-java/test/Programs/SingleSource/UnitTests/Makefile diff -u llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.32 llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.33 --- llvm-java/test/Programs/SingleSource/UnitTests/Makefile:1.32 Mon Dec 13 20:59:34 2004 +++ llvm-java/test/Programs/SingleSource/UnitTests/Makefile Thu Dec 16 16:52:02 2004 @@ -12,6 +12,7 @@ BYTECODE_LIBRARY=1 SHARED_LIBRARY=1 LIBRARYNAME=test +BUILT_SOURCES = Test.h include $(LEVEL)/Makefile.common @@ -21,8 +22,6 @@ include ../Makefile.singlesrc -$(EXTRA_OBJS): Test.h - Test.h: Output/Test.class $(Verb)$(Echo) Creating JNI header for class $(basename $(notdir $<)) $(Verb)$(RM) -f $@ @@ -30,4 +29,3 @@ clean:: $(Verb)rm -f Test.h - From reid at x10sys.com Thu Dec 16 17:00:16 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 17:00:16 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200412162300.RAA26437@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.32 -> 1.33 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Remove the "removeFile" function, now implemented by the sys::Path::destroyFile method. * Make the FileRemove work with a sys::Path instead of a std::string --- Diffs of the changes: (+0 -7) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.32 llvm/lib/Support/FileUtilities.cpp:1.33 --- llvm/lib/Support/FileUtilities.cpp:1.32 Tue Dec 14 19:46:54 2004 +++ llvm/lib/Support/FileUtilities.cpp Thu Dec 16 17:00:05 2004 @@ -64,13 +64,6 @@ } } -/// removeFile - Delete the specified file -/// -void llvm::removeFile(const std::string &Filename) { - std::remove(Filename.c_str()); -} - - //===----------------------------------------------------------------------===// // FDHandle class implementation // From reid at x10sys.com Thu Dec 16 17:00:16 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 17:00:16 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/FileUtilities.h Message-ID: <200412162300.RAA26440@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: FileUtilities.h updated: 1.25 -> 1.26 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Remove the "removeFile" function, now implemented by the sys::Path::destroyFile method. * Make the FileRemove work with a sys::Path instead of a std::string --- Diffs of the changes: (+5 -8) Index: llvm/include/llvm/Support/FileUtilities.h diff -u llvm/include/llvm/Support/FileUtilities.h:1.25 llvm/include/llvm/Support/FileUtilities.h:1.26 --- llvm/include/llvm/Support/FileUtilities.h:1.25 Tue Dec 14 19:46:54 2004 +++ llvm/include/llvm/Support/FileUtilities.h Thu Dec 16 17:00:05 2004 @@ -15,7 +15,7 @@ #ifndef LLVM_SUPPORT_FILEUTILITIES_H #define LLVM_SUPPORT_FILEUTILITIES_H -#include +#include "llvm/System/Path.h" namespace llvm { @@ -34,10 +34,6 @@ /// void MoveFileOverIfUpdated(const std::string &New, const std::string &Old); -/// removeFile - Delete the specified file. -/// -void removeFile(const std::string &Filename); - /// FDHandle - Simple handle class to make sure a file descriptor gets closed /// when the object is destroyed. This handle acts similarly to an /// std::auto_ptr, in that the copy constructor and assignment operators @@ -81,14 +77,15 @@ /// specified (if deleteIt is true). /// class FileRemover { - std::string Filename; + sys::Path Filename; bool DeleteIt; public: - FileRemover(const std::string &filename, bool deleteIt = true) + FileRemover(const sys::Path &filename, bool deleteIt = true) : Filename(filename), DeleteIt(deleteIt) {} ~FileRemover() { - if (DeleteIt) removeFile(Filename); + if (DeleteIt) + Filename.destroyFile(); } /// releaseFile - Take ownership of the file away from the FileRemover so it From reid at x10sys.com Thu Dec 16 17:01:44 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 17:01:44 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/ToolRunner.cpp Message-ID: <200412162301.RAA26487@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: ToolRunner.cpp updated: 1.35 -> 1.36 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Make the OutputC and OutputAsm functions work with sys::Path for the output file name instead of using std::string. * Get rid of extraneous "toString" calls. * Change "removeFile" to sys::Path::destroyFile() --- Diffs of the changes: (+14 -15) Index: llvm/lib/Support/ToolRunner.cpp diff -u llvm/lib/Support/ToolRunner.cpp:1.35 llvm/lib/Support/ToolRunner.cpp:1.36 --- llvm/lib/Support/ToolRunner.cpp:1.35 Tue Dec 14 19:51:56 2004 +++ llvm/lib/Support/ToolRunner.cpp Thu Dec 16 17:01:34 2004 @@ -44,7 +44,7 @@ ErrorFile.close(); } - removeFile(ErrorFilename.toString()); + ErrorFilename.destroyFile(); throw ToolExecutionError(OS.str()); } @@ -123,10 +123,10 @@ //===----------------------------------------------------------------------===// // LLC Implementation of AbstractIntepreter interface // -void LLC::OutputAsm(const std::string &Bytecode, std::string &OutputAsmFile) { +void LLC::OutputAsm(const std::string &Bytecode, sys::Path &OutputAsmFile) { sys::Path uniqueFile(Bytecode+".llc.s"); uniqueFile.makeUnique(); - OutputAsmFile = uniqueFile.toString(); + OutputAsmFile = uniqueFile; std::vector LLCArgs; LLCArgs.push_back (LLCPath.c_str()); @@ -152,9 +152,9 @@ } void LLC::compileProgram(const std::string &Bytecode) { - std::string OutputAsmFile; + sys::Path OutputAsmFile; OutputAsm(Bytecode, OutputAsmFile); - removeFile(OutputAsmFile); + OutputAsmFile.destroyFile(); } int LLC::ExecuteProgram(const std::string &Bytecode, @@ -164,12 +164,12 @@ const std::vector &SharedLibs, unsigned Timeout) { - std::string OutputAsmFile; + sys::Path OutputAsmFile; OutputAsm(Bytecode, OutputAsmFile); FileRemover OutFileRemover(OutputAsmFile); // Assuming LLC worked, compile the result with GCC and run it. - return gcc->ExecuteProgram(OutputAsmFile, Args, GCC::AsmFile, + return gcc->ExecuteProgram(OutputAsmFile.toString(), Args, GCC::AsmFile, InputFile, OutputFile, SharedLibs, Timeout); } @@ -266,11 +266,10 @@ return 0; } -void CBE::OutputC(const std::string &Bytecode, - std::string &OutputCFile) { +void CBE::OutputC(const std::string &Bytecode, sys::Path& OutputCFile) { sys::Path uniqueFile(Bytecode+".cbe.c"); uniqueFile.makeUnique(); - OutputCFile = uniqueFile.toString(); + OutputCFile = uniqueFile; std::vector LLCArgs; LLCArgs.push_back (LLCPath.c_str()); @@ -297,9 +296,9 @@ } void CBE::compileProgram(const std::string &Bytecode) { - std::string OutputCFile; + sys::Path OutputCFile; OutputC(Bytecode, OutputCFile); - removeFile(OutputCFile); + OutputCFile.destroyFile(); } int CBE::ExecuteProgram(const std::string &Bytecode, @@ -308,12 +307,12 @@ const std::string &OutputFile, const std::vector &SharedLibs, unsigned Timeout) { - std::string OutputCFile; + sys::Path OutputCFile; OutputC(Bytecode, OutputCFile); FileRemover CFileRemove(OutputCFile); - return gcc->ExecuteProgram(OutputCFile, Args, GCC::CFile, + return gcc->ExecuteProgram(OutputCFile.toString(), Args, GCC::CFile, InputFile, OutputFile, SharedLibs, Timeout); } @@ -398,7 +397,7 @@ std::cerr << "\n"; ); - FileRemover OutputBinaryRemover(OutputBinary.toString()); + FileRemover OutputBinaryRemover(OutputBinary); return RunProgramWithTimeout(OutputBinary.toString(), &ProgramArgs[0], InputFile, OutputFile, OutputFile, Timeout); } From reid at x10sys.com Thu Dec 16 17:01:45 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 17:01:45 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/ToolRunner.h Message-ID: <200412162301.RAA26490@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: ToolRunner.h updated: 1.15 -> 1.16 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Make the OutputC and OutputAsm functions work with sys::Path for the output file name instead of using std::string. * Get rid of extraneous "toString" calls. * Change "removeFile" to sys::Path::destroyFile() --- Diffs of the changes: (+2 -2) Index: llvm/include/llvm/Support/ToolRunner.h diff -u llvm/include/llvm/Support/ToolRunner.h:1.15 llvm/include/llvm/Support/ToolRunner.h:1.16 --- llvm/include/llvm/Support/ToolRunner.h:1.15 Wed Sep 1 17:55:35 2004 +++ llvm/include/llvm/Support/ToolRunner.h Thu Dec 16 17:01:34 2004 @@ -147,7 +147,7 @@ // necessarily compile it with GCC and run the program. This throws an // exception if LLC crashes. // - virtual void OutputC(const std::string &Bytecode, std::string &OutputCFile); + virtual void OutputC(const std::string &Bytecode, sys::Path& OutputCFile); }; @@ -184,7 +184,7 @@ // not necessarily compile it all the way and run the program. This throws // an exception if execution of LLC fails. // - void OutputAsm(const std::string &Bytecode, std::string &OutputAsmFile); + void OutputAsm(const std::string &Bytecode, sys::Path &OutputAsmFile); }; } // End llvm namespace From reid at x10sys.com Thu Dec 16 17:04:31 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 17:04:31 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200412162304.RAA26591@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.90 -> 1.91 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * removeFile() -> sys::Path::destroyFile() * remove extraneous toString() calls * convert local variables representing path names from std::string to sys::Path * Use sys::Path objects with FileRemove instead of std::string * Use sys::Path methods for construction of path names --- Diffs of the changes: (+13 -10) Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.90 llvm/tools/gccld/gccld.cpp:1.91 --- llvm/tools/gccld/gccld.cpp:1.90 Mon Dec 13 22:20:07 2004 +++ llvm/tools/gccld/gccld.cpp Thu Dec 16 17:04:20 2004 @@ -276,10 +276,11 @@ // Otherwise, create a script that will run the bytecode through the JIT. if (Native) { // Name of the Assembly Language output file - std::string AssemblyFile = OutputFilename + ".s"; + sys::Path AssemblyFile ( OutputFilename); + AssemblyFile.appendSuffix("s"); // Mark the output files for removal if we get an interrupt. - sys::RemoveFileOnSignal(sys::Path(AssemblyFile)); + sys::RemoveFileOnSignal(AssemblyFile); sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. @@ -293,17 +294,19 @@ // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateAssembly(AssemblyFile, RealBytecodeOutput, llc); + GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, AssemblyFile, Libraries, gcc, envp ); + GenerateNative(OutputFilename, AssemblyFile.toString(), + Libraries, gcc, envp ); // Remove the assembly language file. - removeFile (AssemblyFile); + AssemblyFile.destroyFile();; } else if (NativeCBE) { - std::string CFile = OutputFilename + ".cbe.c"; + sys::Path CFile (OutputFilename); + CFile.appendSuffix("cbe.c"); // Mark the output files for removal if we get an interrupt. - sys::RemoveFileOnSignal(sys::Path(CFile)); + sys::RemoveFileOnSignal(CFile); sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. @@ -317,12 +320,12 @@ // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateCFile(CFile, RealBytecodeOutput, llc); + GenerateCFile(CFile.toString(), RealBytecodeOutput, llc); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, CFile, Libraries, gcc, envp ); + GenerateNative(OutputFilename, CFile.toString(), Libraries, gcc, envp ); // Remove the assembly language file. - removeFile(CFile); + CFile.destroyFile(); } else { EmitShellScript(argv); From reid at x10sys.com Thu Dec 16 17:04:31 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 17:04:31 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.cpp CrashDebugger.cpp ExecutionDriver.cpp Miscompilation.cpp OptimizerDriver.cpp Message-ID: <200412162304.RAA26602@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: BugDriver.cpp updated: 1.39 -> 1.40 CrashDebugger.cpp updated: 1.38 -> 1.39 ExecutionDriver.cpp updated: 1.49 -> 1.50 Miscompilation.cpp updated: 1.57 -> 1.58 OptimizerDriver.cpp updated: 1.25 -> 1.26 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * removeFile() -> sys::Path::destroyFile() * remove extraneous toString() calls * convert local variables representing path names from std::string to sys::Path * Use sys::Path objects with FileRemove instead of std::string * Use sys::Path methods for construction of path names --- Diffs of the changes: (+28 -24) Index: llvm/tools/bugpoint/BugDriver.cpp diff -u llvm/tools/bugpoint/BugDriver.cpp:1.39 llvm/tools/bugpoint/BugDriver.cpp:1.40 --- llvm/tools/bugpoint/BugDriver.cpp:1.39 Sun Dec 12 21:01:03 2004 +++ llvm/tools/bugpoint/BugDriver.cpp Thu Dec 16 17:04:20 2004 @@ -175,7 +175,7 @@ // Make sure the reference output file gets deleted on exit from this // function, if appropriate. - FileRemover RemoverInstance(ReferenceOutputFile, CreatedOutput); + FileRemover RemoverInstance(sys::Path(ReferenceOutputFile), CreatedOutput); // Diff the output of the raw program against the reference output. If it // matches, then we have a miscompilation bug. Index: llvm/tools/bugpoint/CrashDebugger.cpp diff -u llvm/tools/bugpoint/CrashDebugger.cpp:1.38 llvm/tools/bugpoint/CrashDebugger.cpp:1.39 --- llvm/tools/bugpoint/CrashDebugger.cpp:1.38 Wed Sep 1 17:55:37 2004 +++ llvm/tools/bugpoint/CrashDebugger.cpp Thu Dec 16 17:04:20 2004 @@ -49,23 +49,25 @@ ReducePassList::TestResult ReducePassList::doTest(std::vector &Prefix, std::vector &Suffix) { - std::string PrefixOutput; + sys::Path PrefixOutput; Module *OrigProgram = 0; if (!Prefix.empty()) { std::cout << "Checking to see if these passes crash: " << getPassesString(Prefix) << ": "; - if (BD.runPasses(Prefix, PrefixOutput)) + std::string PfxOutput; + if (BD.runPasses(Prefix, PfxOutput)) return KeepPrefix; + PrefixOutput.setFile(PfxOutput); OrigProgram = BD.Program; - BD.Program = ParseInputFile(PrefixOutput); + BD.Program = ParseInputFile(PrefixOutput.toString()); if (BD.Program == 0) { std::cerr << BD.getToolName() << ": Error reading bytecode file '" << PrefixOutput << "'!\n"; exit(1); } - removeFile(PrefixOutput); + PrefixOutput.destroyFile(); } std::cout << "Checking to see if these passes crash: " Index: llvm/tools/bugpoint/ExecutionDriver.cpp diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.49 llvm/tools/bugpoint/ExecutionDriver.cpp:1.50 --- llvm/tools/bugpoint/ExecutionDriver.cpp:1.49 Tue Dec 14 19:53:08 2004 +++ llvm/tools/bugpoint/ExecutionDriver.cpp Thu Dec 16 17:04:20 2004 @@ -161,7 +161,7 @@ } // Remove the temporary bytecode file when we are done. - FileRemover BytecodeFileRemover(BytecodeFile.toString()); + FileRemover BytecodeFileRemover(BytecodeFile); // Actually compile the program! Interpreter->compileProgram(BytecodeFile.toString()); @@ -195,7 +195,7 @@ } // Remove the temporary bytecode file when we are done. - FileRemover BytecodeFileRemover(BytecodeFile, CreatedBytecode); + FileRemover BytecodeFileRemover(sys::Path(BytecodeFile), CreatedBytecode); if (OutputFile.empty()) OutputFile = "bugpoint-execution-output"; @@ -252,7 +252,7 @@ std::string BugDriver::compileSharedObject(const std::string &BytecodeFile) { assert(Interpreter && "Interpreter should have been created already!"); - std::string OutputCFile; + sys::Path OutputCFile; // Using CBE cbe->OutputC(BytecodeFile, OutputCFile); @@ -268,11 +268,12 @@ #endif std::string SharedObjectFile; - if (gcc->MakeSharedObject(OutputCFile, GCC::CFile, SharedObjectFile)) + if (gcc->MakeSharedObject(OutputCFile.toString(), GCC::CFile, + SharedObjectFile)) exit(1); // Remove the intermediate C file - removeFile(OutputCFile); + OutputCFile.destroyFile(); return "./" + SharedObjectFile; } @@ -288,19 +289,20 @@ bool ProgramExitedNonzero; // Execute the program, generating an output file... - std::string Output = executeProgram("", BytecodeFile, SharedObject, 0, - &ProgramExitedNonzero); + sys::Path Output (executeProgram("", BytecodeFile, SharedObject, 0, + &ProgramExitedNonzero)); // If we're checking the program exit code, assume anything nonzero is bad. if (CheckProgramExitCode && ProgramExitedNonzero) { - removeFile(Output); - if (RemoveBytecode) removeFile(BytecodeFile); + Output.destroyFile(); + if (RemoveBytecode) + sys::Path(BytecodeFile).destroyFile(); return true; } std::string Error; bool FilesDifferent = false; - if (DiffFiles(ReferenceOutputFile, Output, &Error)) { + if (DiffFiles(ReferenceOutputFile, Output.toString(), &Error)) { if (!Error.empty()) { std::cerr << "While diffing output: " << Error << '\n'; exit(1); @@ -309,10 +311,10 @@ } // Remove the generated output. - removeFile(Output); + Output.destroyFile(); // Remove the bytecode file if we are supposed to. - if (RemoveBytecode) removeFile(BytecodeFile); + if (RemoveBytecode) sys::Path(BytecodeFile).destroyFile(); return FilesDifferent; } Index: llvm/tools/bugpoint/Miscompilation.cpp diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.57 llvm/tools/bugpoint/Miscompilation.cpp:1.58 --- llvm/tools/bugpoint/Miscompilation.cpp:1.57 Tue Dec 14 19:53:08 2004 +++ llvm/tools/bugpoint/Miscompilation.cpp Thu Dec 16 17:04:20 2004 @@ -93,7 +93,7 @@ // If the prefix maintains the predicate by itself, only keep the prefix! if (BD.diffProgram(BytecodeResult)) { std::cout << " nope.\n"; - removeFile(BytecodeResult); + sys::Path(BytecodeResult).destroyFile(); return KeepPrefix; } std::cout << " yup.\n"; // No miscompilation! @@ -107,7 +107,7 @@ << BytecodeResult << "'!\n"; exit(1); } - removeFile(BytecodeResult); // No longer need the file on disk + sys::Path(BytecodeResult).destroyFile(); // No longer need the file on disk // Don't check if there are no passes in the suffix. if (Suffix.empty()) @@ -760,9 +760,9 @@ std::cerr << ": still failing!\n"; else std::cerr << ": didn't fail.\n"; - removeFile(TestModuleBC.toString()); - removeFile(SafeModuleBC.toString()); - removeFile(SharedObject); + TestModuleBC.destroyFile(); + SafeModuleBC.destroyFile(); + sys::Path(SharedObject).destroyFile(); return Result; } Index: llvm/tools/bugpoint/OptimizerDriver.cpp diff -u llvm/tools/bugpoint/OptimizerDriver.cpp:1.25 llvm/tools/bugpoint/OptimizerDriver.cpp:1.26 --- llvm/tools/bugpoint/OptimizerDriver.cpp:1.25 Tue Dec 14 19:53:08 2004 +++ llvm/tools/bugpoint/OptimizerDriver.cpp Thu Dec 16 17:04:20 2004 @@ -143,7 +143,7 @@ // If we are supposed to delete the bytecode file or if the passes crashed, // remove it now. This may fail if the file was never created, but that's ok. if (DeleteOutput || !ExitedOK) - removeFile(OutputFilename); + sys::Path(OutputFilename).destroyFile(); if (!Quiet) { if (ExitedOK) @@ -194,6 +194,6 @@ << BytecodeResult << "'!\n"; exit(1); } - removeFile(BytecodeResult); // No longer need the file on disk + sys::Path(BytecodeResult).destroyFile(); // No longer need the file on disk return Ret; } From reid at x10sys.com Thu Dec 16 17:04:31 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 17:04:31 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200412162304.RAA26605@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.12 -> 1.13 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * removeFile() -> sys::Path::destroyFile() * remove extraneous toString() calls * convert local variables representing path names from std::string to sys::Path * Use sys::Path objects with FileRemove instead of std::string * Use sys::Path methods for construction of path names --- Diffs of the changes: (+13 -10) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.12 llvm/tools/llvm-ld/llvm-ld.cpp:1.13 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.12 Mon Dec 13 22:20:08 2004 +++ llvm/tools/llvm-ld/llvm-ld.cpp Thu Dec 16 17:04:20 2004 @@ -448,10 +448,11 @@ // Otherwise, create a script that will run the bytecode through the JIT. if (Native) { // Name of the Assembly Language output file - std::string AssemblyFile = OutputFilename + ".s"; + sys::Path AssemblyFile ( OutputFilename); + AssemblyFile.appendSuffix("s"); // Mark the output files for removal if we get an interrupt. - sys::RemoveFileOnSignal(sys::Path(AssemblyFile)); + sys::RemoveFileOnSignal(AssemblyFile); sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. @@ -465,17 +466,19 @@ // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateAssembly(AssemblyFile, RealBytecodeOutput, llc); + GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, AssemblyFile, Libraries, gcc, envp); + GenerateNative(OutputFilename, AssemblyFile.toString(), Libraries, + gcc, envp); // Remove the assembly language file. - removeFile (AssemblyFile); + AssemblyFile.destroyFile(); } else if (NativeCBE) { - std::string CFile = OutputFilename + ".cbe.c"; + sys::Path CFile (OutputFilename); + CFile.appendSuffix("cbe.c"); // Mark the output files for removal if we get an interrupt. - sys::RemoveFileOnSignal(sys::Path(CFile)); + sys::RemoveFileOnSignal(CFile); sys::RemoveFileOnSignal(sys::Path(OutputFilename)); // Determine the locations of the llc and gcc programs. @@ -489,12 +492,12 @@ // Generate an assembly language file for the bytecode. if (Verbose) std::cout << "Generating Assembly Code\n"; - GenerateCFile(CFile, RealBytecodeOutput, llc); + GenerateCFile(CFile.toString(), RealBytecodeOutput, llc); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, CFile, Libraries, gcc, envp); + GenerateNative(OutputFilename, CFile.toString(), Libraries, gcc, envp); // Remove the assembly language file. - removeFile(CFile); + CFile.destroyFile(); } else { EmitShellScript(argv); From tbrethou at cs.uiuc.edu Thu Dec 16 17:07:29 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Thu, 16 Dec 2004 17:07:29 -0600 (CST) Subject: [llvm-commits] CVS: llvm/tools/llc/Makefile Message-ID: <200412162307.RAA11911@kain.cs.uiuc.edu> Changes in directory llvm/tools/llc: Makefile updated: 1.64 -> 1.65 --- Log message: Linking in all of ScalarOpts. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llc/Makefile diff -u llvm/tools/llc/Makefile:1.64 llvm/tools/llc/Makefile:1.65 --- llvm/tools/llc/Makefile:1.64 Thu Dec 16 13:39:45 2004 +++ llvm/tools/llc/Makefile Thu Dec 16 17:07:13 2004 @@ -24,7 +24,7 @@ LLVMSparcV9LiveVar \ LLVMipa.a \ LLVMTransforms.a \ - LLVMScalarOpts.a \ + LLVMScalarOpts \ LLVMAnalysis.a \ LLVMTransformUtils.a \ LLVMBCReader \ From tbrethou at cs.uiuc.edu Thu Dec 16 17:07:53 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Thu, 16 Dec 2004 17:07:53 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Message-ID: <200412162307.RAA11933@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9TargetMachine.cpp updated: 1.129 -> 1.130 --- Log message: Removed LICM and GCSE. --- Diffs of the changes: (+3 -3) Index: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp diff -u llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.129 llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.130 --- llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.129 Sun Dec 12 11:40:28 2004 +++ llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Thu Dec 16 17:07:36 2004 @@ -179,9 +179,9 @@ PM.add(createLowerSelectPass()); // Run basic LLVM dataflow optimizations, to clean up after pre-selection. - PM.add(createReassociatePass()); - PM.add(createLICMPass()); - PM.add(createGCSEPass()); + //PM.add(createReassociatePass()); + //PM.add(createLICMPass()); + //PM.add(createGCSEPass()); // If the user's trying to read the generated code, they'll need to see the // transformed input. From tbrethou at cs.uiuc.edu Thu Dec 16 17:13:33 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Thu, 16 Dec 2004 17:13:33 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Message-ID: <200412162313.RAA12398@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9TargetMachine.cpp updated: 1.130 -> 1.131 --- Log message: Removing commented out lines. --- Diffs of the changes: (+3 -8) Index: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp diff -u llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.130 llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.131 --- llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.130 Thu Dec 16 17:07:36 2004 +++ llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Thu Dec 16 17:13:16 2004 @@ -178,10 +178,8 @@ PM.add(createPreSelectionPass(*this)); PM.add(createLowerSelectPass()); - // Run basic LLVM dataflow optimizations, to clean up after pre-selection. - //PM.add(createReassociatePass()); - //PM.add(createLICMPass()); - //PM.add(createGCSEPass()); + // Clean up after pre-selection. + PM.add(createReassociatePass()); // If the user's trying to read the generated code, they'll need to see the // transformed input. @@ -269,11 +267,8 @@ PM.add(createPreSelectionPass(TM)); PM.add(createLowerSelectPass()); - // Run basic LLVM dataflow optimizations, to clean up after pre-selection. + // Clean up after pre-selection. PM.add(createReassociatePass()); - // FIXME: these passes crash the FunctionPassManager when being added... - //PM.add(createLICMPass()); - //PM.add(createGCSEPass()); // If the user's trying to read the generated code, they'll need to see the // transformed input. From tbrethou at cs.uiuc.edu Thu Dec 16 17:16:29 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Thu, 16 Dec 2004 17:16:29 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Message-ID: <200412162316.RAA13032@kain.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV9: SparcV9TargetMachine.cpp updated: 1.131 -> 1.132 --- Log message: Chris is a pain ;) Removing reassociate. --- Diffs of the changes: (+0 -6) Index: llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp diff -u llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.131 llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.132 --- llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp:1.131 Thu Dec 16 17:13:16 2004 +++ llvm/lib/Target/SparcV9/SparcV9TargetMachine.cpp Thu Dec 16 17:16:16 2004 @@ -178,9 +178,6 @@ PM.add(createPreSelectionPass(*this)); PM.add(createLowerSelectPass()); - // Clean up after pre-selection. - PM.add(createReassociatePass()); - // If the user's trying to read the generated code, they'll need to see the // transformed input. if (PrintMachineCode) @@ -267,9 +264,6 @@ PM.add(createPreSelectionPass(TM)); PM.add(createLowerSelectPass()); - // Clean up after pre-selection. - PM.add(createReassociatePass()); - // If the user's trying to read the generated code, they'll need to see the // transformed input. if (PrintMachineCode) From lattner at cs.uiuc.edu Thu Dec 16 18:08:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 18:08:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelSimple.cpp Message-ID: <200412170008.iBH0815V020267@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelSimple.cpp updated: 1.301 -> 1.302 --- Log message: Create a stack slot for the return address lazily instead of eagerly. This save small amounts of time for functions that don't call llvm.returnaddress or llvm.frameaddress (which is almost all functions). --- Diffs of the changes: (+8 -4) Index: llvm/lib/Target/X86/X86ISelSimple.cpp diff -u llvm/lib/Target/X86/X86ISelSimple.cpp:1.301 llvm/lib/Target/X86/X86ISelSimple.cpp:1.302 --- llvm/lib/Target/X86/X86ISelSimple.cpp:1.301 Mon Dec 13 11:23:11 2004 +++ llvm/lib/Target/X86/X86ISelSimple.cpp Thu Dec 16 18:07:46 2004 @@ -96,6 +96,9 @@ /// the entire function. /// bool runOnFunction(Function &Fn) { + // Lazily create a stack slot for the return address if needed. + ReturnAddressIndex = -1; + // First pass over the function, lower any unknown intrinsic functions // with the IntrinsicLowering class. LowerUnknownIntrinsicFunctionCalls(Fn); @@ -108,10 +111,6 @@ BB = &F->front(); - // Set up a frame object for the return address. This is used by the - // llvm.returnaddress & llvm.frameaddress intrinisics. - ReturnAddressIndex = F->getFrameInfo()->CreateFixedObject(4, -4); - // Copy incoming arguments off of the stack... LoadArgumentsToVirtualRegs(Fn); @@ -1765,6 +1764,11 @@ case Intrinsic::frameaddress: TmpReg1 = getReg(CI); if (cast(CI.getOperand(1))->isNullValue()) { + if (ReturnAddressIndex == -1) { + // Set up a frame object for the return address. + ReturnAddressIndex = F->getFrameInfo()->CreateFixedObject(4, -4); + } + if (ID == Intrinsic::returnaddress) { // Just load the return address addFrameReference(BuildMI(BB, X86::MOV32rm, 4, TmpReg1), From lattner at cs.uiuc.edu Thu Dec 16 18:47:06 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu, 16 Dec 2004 18:47:06 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelSimple.cpp Message-ID: <200412170047.iBH0l6ac020367@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86ISelSimple.cpp updated: 1.302 -> 1.303 --- Log message: Change the sentinal --- Diffs of the changes: (+2 -2) Index: llvm/lib/Target/X86/X86ISelSimple.cpp diff -u llvm/lib/Target/X86/X86ISelSimple.cpp:1.302 llvm/lib/Target/X86/X86ISelSimple.cpp:1.303 --- llvm/lib/Target/X86/X86ISelSimple.cpp:1.302 Thu Dec 16 18:07:46 2004 +++ llvm/lib/Target/X86/X86ISelSimple.cpp Thu Dec 16 18:46:51 2004 @@ -97,7 +97,7 @@ /// bool runOnFunction(Function &Fn) { // Lazily create a stack slot for the return address if needed. - ReturnAddressIndex = -1; + ReturnAddressIndex = 0; // First pass over the function, lower any unknown intrinsic functions // with the IntrinsicLowering class. @@ -1764,7 +1764,7 @@ case Intrinsic::frameaddress: TmpReg1 = getReg(CI); if (cast(CI.getOperand(1))->isNullValue()) { - if (ReturnAddressIndex == -1) { + if (ReturnAddressIndex == 0) { // Set up a frame object for the return address. ReturnAddressIndex = F->getFrameInfo()->CreateFixedObject(4, -4); } From reid at x10sys.com Thu Dec 16 19:46:52 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 19:46:52 -0600 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200412170146.TAA29206@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.36 -> 1.37 --- Log message: Disable bugpoint and llvm-db tools for Win32. They can't be supported on that platform without a lot of work because they depend on process image copy behavior of fork(2). --- Diffs of the changes: (+10 -2) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.36 llvm/tools/Makefile:1.37 --- llvm/tools/Makefile:1.36 Mon Dec 13 17:15:32 2004 +++ llvm/tools/Makefile Thu Dec 16 19:46:41 2004 @@ -9,8 +9,16 @@ LEVEL := .. PARALLEL_DIRS := llvm-as llvm-dis opt gccas llc llvm-link lli gccld llvm-stub \ - analyze extract bugpoint llvm-nm llvm-prof llvm-db \ - llvm-ar llvm-ranlib llvm-bcanalyzer llvmc llvm-ld + analyze extract llvm-nm llvm-prof llvm-ar llvm-ranlib \ + llvm-bcanalyzer llvmc llvm-ld + +# The bugpoint and llvm-db tools are not portable to Win32 because they depend +# 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. +ifneq($(OS),Win32) +PARALLEL_DIRS += bugpoint llvm-db +endif EXTRA_DIST := Makefile.JIT From reid at x10sys.com Thu Dec 16 20:06:47 2004 From: reid at x10sys.com (Reid Spencer) Date: Thu, 16 Dec 2004 20:06:47 -0600 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200412170206.UAA29715@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.37 -> 1.38 --- Log message: Makefile.JIT doesn't exist any more so it doesn't need to be distributed. --- Diffs of the changes: (+0 -2) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.37 llvm/tools/Makefile:1.38 --- llvm/tools/Makefile:1.37 Thu Dec 16 19:46:41 2004 +++ llvm/tools/Makefile Thu Dec 16 20:06:36 2004 @@ -20,8 +20,6 @@ PARALLEL_DIRS += bugpoint llvm-db endif -EXTRA_DIST := Makefile.JIT - include $(LEVEL)/Makefile.config ifeq ($(ARCH), Sparc) From alkis at cs.uiuc.edu Fri Dec 17 01:39:18 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Fri, 17 Dec 2004 01:39:18 -0600 Subject: [llvm-commits] CVS: llvm-java/include/llvm/Java/types.def Message-ID: <200412170739.BAA01888@zion.cs.uiuc.edu> Changes in directory llvm-java/include/llvm/Java: types.def added (r1.1) --- Log message: Add types.def to help definining stuff for all java primitive types. --- Diffs of the changes: (+29 -0) Index: llvm-java/include/llvm/Java/types.def diff -c /dev/null llvm-java/include/llvm/Java/types.def:1.1 *** /dev/null Fri Dec 17 01:39:17 2004 --- llvm-java/include/llvm/Java/types.def Fri Dec 17 01:39:07 2004 *************** *** 0 **** --- 1,29 ---- + //===-- llvm/Java/types.def - File that describes Java primitives -*- C++ -*-=// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file contains descriptions of the various Java primitive types. This + // is used as a central place for enumerating the different primitive types. + // + //===----------------------------------------------------------------------===// + + // NOTE: NO INCLUDE GUARD DESIRED! + + // Provide definitions of macros so that users of this file do not have to + // define everything to use it... + + HANDLE_TYPE(boolean) + HANDLE_TYPE(byte) + HANDLE_TYPE(char) + HANDLE_TYPE(short) + HANDLE_TYPE(int) + HANDLE_TYPE(long) + HANDLE_TYPE(float) + HANDLE_TYPE(double) + + #undef HANDLE_TYPE From alkis at cs.uiuc.edu Fri Dec 17 01:40:03 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Fri, 17 Dec 2004 01:40:03 -0600 Subject: [llvm-commits] CVS: llvm-java/runtime/runtime.c Message-ID: <200412170740.BAA01918@zion.cs.uiuc.edu> Changes in directory llvm-java/runtime: runtime.c updated: 1.12 -> 1.13 --- Log message: Define get*arrayelements release*arrayelements for all primitive types. --- Diffs of the changes: (+51 -45) Index: llvm-java/runtime/runtime.c diff -u llvm-java/runtime/runtime.c:1.12 llvm-java/runtime/runtime.c:1.13 --- llvm-java/runtime/runtime.c:1.12 Sun Dec 12 02:43:15 2004 +++ llvm-java/runtime/runtime.c Fri Dec 17 01:39:52 2004 @@ -1,3 +1,4 @@ + #include #include @@ -71,40 +72,45 @@ /* The implementation of JNI functions */ -struct llvm_java_bytearray { - struct llvm_java_object_base object_base; - jint length; - jbyte data[0]; -}; - -static jint llvm_java_GetArrayLength(JNIEnv* env, jarray array) { - return ((struct llvm_java_bytearray*) array)->length; -} +#define HANDLE_TYPE(TYPE) \ + struct llvm_java_##TYPE##array { \ + struct llvm_java_object_base object_base; \ + jint length; \ + j##TYPE data[0]; \ + }; +#include "types.def" -static jbyte* llvm_java_GetByteArrayElements(JNIEnv* env, - jarray array, - jboolean* isCopy) { - if (isCopy) - *isCopy = JNI_FALSE; - return ((struct llvm_java_bytearray*) array)->data; +static jint llvm_java_get_array_length(JNIEnv* env, jarray array) { + return ((struct llvm_java_booleanarray*) array)->length; } -static void llvm_java_ReleaseByteArrayElements(JNIEnv* env, - jarray array, - jbyte* elements, - jint mode) { - switch (mode) { - case 0: - case JNI_COMMIT: - case JNI_ABORT: - // Since we return a the live array we don't need to copy anything - // or delete the elememnts. - return; - default: - abort(); +#define HANDLE_TYPE(TYPE) \ + static j ## TYPE* llvm_java_get_##TYPE##_array_elements( \ + JNIEnv* env, \ + jarray array, \ + jboolean* isCopy) { \ + if (isCopy) \ + *isCopy = JNI_FALSE; \ + return ((struct llvm_java_ ##TYPE## array*) array)->data; \ } -} +#include "types.def" +#define HANDLE_TYPE(TYPE) \ + static void llvm_java_release_ ##TYPE## _array_elements( \ + JNIEnv* env, \ + jarray array, \ + j##TYPE* elements, \ + jint mode) { \ + switch (mode) { \ + case 0: \ + case JNI_COMMIT: \ + case JNI_ABORT: \ + return; \ + default: \ + abort(); \ + } \ + } +#include "types.def" /* The JNI interface definition */ static const struct JNINativeInterface llvm_java_JNINativeInterface = { @@ -279,7 +285,7 @@ NULL, NULL, NULL, /* 170 */ - &llvm_java_GetArrayLength, + &llvm_java_get_array_length, NULL, NULL, NULL, @@ -291,21 +297,21 @@ NULL, /* 180 */ NULL, NULL, - NULL, - &llvm_java_GetByteArrayElements, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, /* 190 */ - NULL, - &llvm_java_ReleaseByteArrayElements, - NULL, - NULL, - NULL, - NULL, - NULL, + &llvm_java_get_boolean_array_elements, + &llvm_java_get_byte_array_elements, + &llvm_java_get_char_array_elements, + &llvm_java_get_short_array_elements, + &llvm_java_get_int_array_elements, + &llvm_java_get_long_array_elements, + &llvm_java_get_float_array_elements, + &llvm_java_get_double_array_elements, + &llvm_java_release_boolean_array_elements, + &llvm_java_release_byte_array_elements, + &llvm_java_release_char_array_elements, + &llvm_java_release_short_array_elements, + &llvm_java_release_int_array_elements, + &llvm_java_release_float_array_elements, + &llvm_java_release_double_array_elements, NULL, NULL, NULL, /* 200 */ From reid at x10sys.com Fri Dec 17 01:45:14 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 17 Dec 2004 01:45:14 -0600 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200412170745.BAA01987@zion.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.275 -> 1.276 --- Log message: Complete the implementation of the spotless rule and make it not depend on the .. directory. --- Diffs of the changes: (+12 -6) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.275 llvm/Makefile.rules:1.276 --- llvm/Makefile.rules:1.275 Thu Dec 16 13:40:10 2004 +++ llvm/Makefile.rules Fri Dec 17 01:45:03 2004 @@ -83,14 +83,20 @@ ifneq ($(BUILD_OBJ_ROOT),$(BUILD_SRC_ROOT)) spotless: - $(Echo) Wiping out $(BUILD_OBJ_ROOT) and rebuilding configuration. $(Verb) if test -x config.status ; then \ - $(MV) config.status .. ; \ - $(MV) mklib .. ; \ + $(EchoCmd) Wiping out $(BUILD_OBJ_ROOT) ; \ + $(MKDIR) .spotless.save ; \ + $(MV) config.status .spotless.save ; \ + $(MV) mklib .spotless.save ; \ + $(MV) projects .spotless.save ; \ $(RM) -rf * ; \ - $(MV) ../config.status . ; \ - $(MV) ../mklib . ; \ - ./config.status ; \ + $(MV) .spotless.save/config.status . ; \ + $(MV) .spotless.save/mklib . ; \ + $(MV) .spotless.save/projects . ; \ + $(RM) -rf .spotless.save ; \ + $(EchoCmd) Rebuilding configuration of $(BUILD_OBJ_ROOT) ; \ + $(ConfigStatusScript) --recheck $(ConfigureScriptFLAGS) && \ + $(ConfigStatusScript) ; \ else \ $(EchoCmd) "make spotless" can only be run from $(BUILD_OBJ_ROOT); \ fi From reid at x10sys.com Fri Dec 17 01:46:55 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 17 Dec 2004 01:46:55 -0600 Subject: [llvm-commits] CVS: llvm/docs/MakefileGuide.html Message-ID: <200412170746.BAA02037@zion.cs.uiuc.edu> Changes in directory llvm/docs: MakefileGuide.html updated: 1.21 -> 1.22 --- Log message: Describe the new "reconfigure" and "spotless" targets. --- Diffs of the changes: (+25 -1) Index: llvm/docs/MakefileGuide.html diff -u llvm/docs/MakefileGuide.html:1.21 llvm/docs/MakefileGuide.html:1.22 --- llvm/docs/MakefileGuide.html:1.21 Wed Dec 8 12:13:51 2004 +++ llvm/docs/MakefileGuide.html Fri Dec 17 01:46:45 2004 @@ -54,6 +54,8 @@

  • install
  • preconditions
  • printvars
  • +
  • reconfigure
  • +
  • spotless
  • tags
  • uninstall
  • @@ -520,6 +522,28 @@ + +
    +

    This utility target will force a reconfigure of LLVM or your project. It + simply runs $(BUILD_OBJ_ROOT)/config.status --recheck to rerun the + configuration tests and rebuild the configured files. This isn't generally + useful as the makefiles will reconfigure themselves whenever its necessary. +

    +
    + + + +
    +

    This utility target, only available when $(BUILD_OBJ_ROOT) is not + the same as $(BUILD_SRC_ROOT), will completely clean the + $(BUILD_OBJ_ROOT) directoy by removing its content entirely and + reconfiguring the directory. This returns the $(BUILD_OBJ_ROOT) + directory to a completely fresh state. All content in the directory except + configured files and top-level makefiles will be lost. + Use with caution.

    +
    + +

    This target will generate a TAGS file in the top-level source @@ -953,7 +977,7 @@ Reid Spencer
    The LLVM Compiler Infrastructure
    - Last modified: $Date: 2004/12/08 18:13:51 $ + Last modified: $Date: 2004/12/17 07:46:45 $ From reid at x10sys.com Fri Dec 17 02:00:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 17 Dec 2004 02:00:04 -0600 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200412170800.CAA02200@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.38 -> 1.39 --- Log message: Fix this file to actually work. ifneq was incorrectly used. Subtract out llvm-db and bugpoint for Win32 rather than add them in subtr --- Diffs of the changes: (+6 -9) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.38 llvm/tools/Makefile:1.39 --- llvm/tools/Makefile:1.38 Thu Dec 16 20:06:36 2004 +++ llvm/tools/Makefile Fri Dec 17 01:59:53 2004 @@ -10,20 +10,17 @@ LEVEL := .. PARALLEL_DIRS := llvm-as llvm-dis opt gccas llc llvm-link lli gccld llvm-stub \ analyze extract llvm-nm llvm-prof llvm-ar llvm-ranlib \ - llvm-bcanalyzer llvmc llvm-ld + llvm-bcanalyzer llvmc llvm-ld llvm-db bugpoint + +include $(LEVEL)/Makefile.config # The bugpoint and llvm-db tools are not portable to Win32 because they depend # 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. -ifneq($(OS),Win32) -PARALLEL_DIRS += bugpoint llvm-db -endif - -include $(LEVEL)/Makefile.config -ifeq ($(ARCH), Sparc) -PARALLEL_DIRS := $(filter-out llee, $(PARALLEL_DIRS)) +ifneq ($(OS),Win32) +PARALLEL_DIRS := $(filter-out bugpoint llvm-db,$(PARALLEL_DIRS)) endif -include $(LEVEL)/Makefile.common +include $(BUILD_SRC_ROOT)/Makefile.rules From reid at x10sys.com Fri Dec 17 02:00:51 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 17 Dec 2004 02:00:51 -0600 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200412170800.CAA02214@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.39 -> 1.40 --- Log message: Reverse the logic for Win32 to ensure that bugpoint and llvm-db are NOT built on this platform. --- Diffs of the changes: (+1 -1) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.39 llvm/tools/Makefile:1.40 --- llvm/tools/Makefile:1.39 Fri Dec 17 01:59:53 2004 +++ llvm/tools/Makefile Fri Dec 17 02:00:40 2004 @@ -19,7 +19,7 @@ # rewritten to not depend on fork at which time they should be added back to # the list above. -ifneq ($(OS),Win32) +ifeq ($(OS),Win32) PARALLEL_DIRS := $(filter-out bugpoint llvm-db,$(PARALLEL_DIRS)) endif From lattner at cs.uiuc.edu Fri Dec 17 11:03:09 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Dec 2004 11:03:09 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/AliasAnalysis.h Message-ID: <200412171703.iBHH3979027604@apoc.cs.uiuc.edu> Changes in directory llvm/include/llvm/Analysis: AliasAnalysis.h updated: 1.18 -> 1.19 --- Log message: Make code fit in 80 cols --- Diffs of the changes: (+3 -2) Index: llvm/include/llvm/Analysis/AliasAnalysis.h diff -u llvm/include/llvm/Analysis/AliasAnalysis.h:1.18 llvm/include/llvm/Analysis/AliasAnalysis.h:1.19 --- llvm/include/llvm/Analysis/AliasAnalysis.h:1.18 Wed Dec 15 01:21:39 2004 +++ llvm/include/llvm/Analysis/AliasAnalysis.h Fri Dec 17 11:02:54 2004 @@ -185,7 +185,7 @@ /// called from the specified call site. The call site may be null in which /// case the most generic behavior of this function should be returned. virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS, - std::vector *Info = 0); + std::vector *Info = 0); /// doesNotAccessMemory - If the specified function is known to never read or /// write memory, return true. If the function only reads from known-constant @@ -212,7 +212,8 @@ /// This property corresponds to the GCC 'pure' attribute. /// bool onlyReadsMemory(Function *F) { - /// FIXME: If the analysis returns more precise info, we can reduce it to this. + /// FIXME: If the analysis returns more precise info, we can reduce it to + /// this. return getModRefBehavior(F, CallSite()) == OnlyReadsMemory; } From lattner at cs.uiuc.edu Fri Dec 17 11:11:55 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Dec 2004 11:11:55 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll Message-ID: <200412171711.iBHHBteI029687@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/GlobalsModRef: purecse.ll updated: 1.1 -> 1.2 --- Log message: Change the test to check to see that CSE happens not dead call elim --- Diffs of the changes: (+1 -1) Index: llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll diff -u llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll:1.1 llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll:1.2 --- llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll:1.1 Tue Jul 27 01:35:11 2004 +++ llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll Fri Dec 17 11:11:41 2004 @@ -1,6 +1,6 @@ ; Test that pure functions are cse'd away -; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine -adce| llvm-dis | not grep call +; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | not grep sub int %pure(int %X) { %Y = add int %X, 1 From lattner at cs.uiuc.edu Fri Dec 17 11:12:36 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Dec 2004 11:12:36 -0600 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/GlobalsModRef.cpp Message-ID: <200412171712.iBHHCad1029697@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Analysis/IPA: GlobalsModRef.cpp updated: 1.9 -> 1.10 --- Log message: Actually overload the virtual method. This fixes Regression/Analysis/GlobalsModRef/purecse.ll. Isn't this what the -Woverload-whatever flag would warn about :) --- Diffs of the changes: (+2 -1) Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.9 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.10 --- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.9 Wed Dec 15 01:22:13 2004 +++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp Fri Dec 17 11:12:24 2004 @@ -104,7 +104,8 @@ /// getModRefBehavior - Return the behavior of the specified function if /// called from the specified call site. The call site may be null in which /// case the most generic behavior of this function should be returned. - virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS) { + virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS, + std::vector *Info) { if (FunctionRecord *FR = getFunctionInfo(F)) if (FR->FunctionEffect == 0) return DoesNotAccessMemory; From lattner at cs.uiuc.edu Fri Dec 17 11:14:12 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Dec 2004 11:14:12 -0600 Subject: [llvm-commits] CVS: llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll Message-ID: <200412171714.iBHHECtE029727@apoc.cs.uiuc.edu> Changes in directory llvm/test/Regression/Analysis/GlobalsModRef: purecse.ll updated: 1.2 -> 1.3 --- Log message: Make this testcase a bit more challanging --- Diffs of the changes: (+9 -1) Index: llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll diff -u llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll:1.2 llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll:1.3 --- llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll:1.2 Fri Dec 17 11:11:41 2004 +++ llvm/test/Regression/Analysis/GlobalsModRef/purecse.ll Fri Dec 17 11:14:00 2004 @@ -7,9 +7,17 @@ ret int %Y } -int %test(int %X) { +int %test1(int %X) { %A = call int %pure(int %X) %B = call int %pure(int %X) %C = sub int %A, %B ret int %C } + +int %test2(int %X, int* %P) { + %A = call int %pure(int %X) + store int %X, int* %P ;; Does not invalidate 'pure' call. + %B = call int %pure(int %X) + %C = sub int %A, %B + ret int %C +} From reid at x10sys.com Fri Dec 17 12:08:06 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 17 Dec 2004 10:08:06 -0800 Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/GlobalsModRef.cpp In-Reply-To: <200412171712.iBHHCad1029697@apoc.cs.uiuc.edu> References: <200412171712.iBHHCad1029697@apoc.cs.uiuc.edu> Message-ID: <1103306885.18677.31.camel@bashful.x10sys.com> Indeed :) On Fri, 2004-12-17 at 09:12, Chris Lattner wrote: > Changes in directory llvm/lib/Analysis/IPA: > > GlobalsModRef.cpp updated: 1.9 -> 1.10 > --- > Log message: > > Actually overload the virtual method. This fixes > Regression/Analysis/GlobalsModRef/purecse.ll. Isn't this what the > -Woverload-whatever flag would warn about :) > > > --- > Diffs of the changes: (+2 -1) > > Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp > diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.9 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.10 > --- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.9 Wed Dec 15 01:22:13 2004 > +++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp Fri Dec 17 11:12:24 2004 > @@ -104,7 +104,8 @@ > /// getModRefBehavior - Return the behavior of the specified function if > /// called from the specified call site. The call site may be null in which > /// case the most generic behavior of this function should be returned. > - virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS) { > + virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS, > + std::vector *Info) { > if (FunctionRecord *FR = getFunctionInfo(F)) > if (FR->FunctionEffect == 0) > return DoesNotAccessMemory; > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits at cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvm-commits -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.cs.uiuc.edu/pipermail/llvm-commits/attachments/20041217/eeb1824e/attachment.bin From reid at x10sys.com Fri Dec 17 12:56:40 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 17 Dec 2004 12:56:40 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/Intercept.cpp Message-ID: <200412171856.MAA32065@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: Intercept.cpp updated: 1.20 -> 1.21 --- Log message: Only #include sys/stat.h if we're on linux where we have the PR274: http://llvm.cs.uiuc.edu/PR274 problem. --- Diffs of the changes: (+2 -0) Index: llvm/lib/ExecutionEngine/JIT/Intercept.cpp diff -u llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.20 llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.21 --- llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.20 Fri Dec 3 17:02:55 2004 +++ llvm/lib/ExecutionEngine/JIT/Intercept.cpp Fri Dec 17 12:56:29 2004 @@ -18,7 +18,9 @@ #include "JIT.h" #include "llvm/System/DynamicLibrary.h" #include +#if defined(__linux__) #include +#endif using namespace llvm; // AtExitHandlers - List of functions to call when the program exits, From lattner at cs.uiuc.edu Fri Dec 17 13:07:18 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Dec 2004 13:07:18 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp Message-ID: <200412171907.iBHJ7Iqf002291@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/SparcV8: SparcV8ISelSimple.cpp updated: 1.86 -> 1.87 --- Log message: Remove unused #include --- Diffs of the changes: (+1 -1) Index: llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp diff -u llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.86 llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.87 --- llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp:1.86 Tue Dec 14 02:21:02 2004 +++ llvm/lib/Target/SparcV8/SparcV8ISelSimple.cpp Fri Dec 17 13:07:04 2004 @@ -17,6 +17,7 @@ #include "llvm/Instructions.h" #include "llvm/Pass.h" #include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" #include "llvm/CodeGen/IntrinsicLowering.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineFrameInfo.h" @@ -24,7 +25,6 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/SSARegMap.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Support/GetElementPtrTypeIterator.h" #include "llvm/Support/InstVisitor.h" #include "llvm/Support/CFG.h" using namespace llvm; From reid at x10sys.com Fri Dec 17 13:09:27 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 17 Dec 2004 13:09:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/Intercept.cpp Message-ID: <200412171909.NAA32391@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine/JIT: Intercept.cpp updated: 1.21 -> 1.22 --- Log message: Move the #include of sys/stat.h inside the linux "hack" for the stat family of functions so it gets noticed if we ever remove this. --- Diffs of the changes: (+1 -3) Index: llvm/lib/ExecutionEngine/JIT/Intercept.cpp diff -u llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.21 llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.22 --- llvm/lib/ExecutionEngine/JIT/Intercept.cpp:1.21 Fri Dec 17 12:56:29 2004 +++ llvm/lib/ExecutionEngine/JIT/Intercept.cpp Fri Dec 17 13:09:16 2004 @@ -18,9 +18,6 @@ #include "JIT.h" #include "llvm/System/DynamicLibrary.h" #include -#if defined(__linux__) -#include -#endif using namespace llvm; // AtExitHandlers - List of functions to call when the program exits, @@ -50,6 +47,7 @@ // that the dynamic linker can't see. For more info, search for // 'libc_nonshared.a' on Google, or read http://llvm.cs.uiuc.edu/PR274. #if defined(__linux__) +#include void *FunctionPointers[] = { (void *) stat, (void *) fstat, From tbrethou at cs.uiuc.edu Fri Dec 17 14:58:51 2004 From: tbrethou at cs.uiuc.edu (Tanya Brethour) Date: Fri, 17 Dec 2004 14:58:51 -0600 (CST) Subject: [llvm-commits] CVS: llvm/utils/NightlyTest.pl Message-ID: <200412172058.OAA02314@kain.cs.uiuc.edu> Changes in directory llvm/utils: NightlyTest.pl updated: 1.82 -> 1.83 --- Log message: Always print out DejagnuTest results to stdout so that it gets emailed to the nightly test manager. Eventually Dejagnu should be merged into the added/removed tests. --- Diffs of the changes: (+2 -0) Index: llvm/utils/NightlyTest.pl diff -u llvm/utils/NightlyTest.pl:1.82 llvm/utils/NightlyTest.pl:1.83 --- llvm/utils/NightlyTest.pl:1.82 Tue Dec 14 16:42:59 2004 +++ llvm/utils/NightlyTest.pl Fri Dec 17 14:58:34 2004 @@ -445,6 +445,8 @@ CopyFile("test/testrun.sum", $DejagnuSum); $DejagnuTestResults = GetDejagnuTestResults($DejagnuSum, $DejagnuLog); + print $DejagnuTestResults; + } else { $DejagnuTestResults = "Skipped by user choice."; $DejagnuTime = "0.0"; From gaeke at cs.uiuc.edu Fri Dec 17 16:21:03 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Fri, 17 Dec 2004 16:21:03 -0600 (CST) Subject: [llvm-commits] CVS: reopt/tools/reopt-llc/Makefile Message-ID: <200412172221.QAA18270@kain.cs.uiuc.edu> Changes in directory reopt/tools/reopt-llc: Makefile updated: 1.6 -> 1.7 --- Log message: Update reopt-llc makefile based on LLVM's LLC makefile. --- Diffs of the changes: (+5 -6) Index: reopt/tools/reopt-llc/Makefile diff -u reopt/tools/reopt-llc/Makefile:1.6 reopt/tools/reopt-llc/Makefile:1.7 --- reopt/tools/reopt-llc/Makefile:1.6 Mon Nov 29 14:38:27 2004 +++ reopt/tools/reopt-llc/Makefile Fri Dec 17 16:20:51 2004 @@ -1,30 +1,29 @@ LEVEL = ../.. TOOLNAME = reopt-llc -# LLVMCBackend LLVMLIBS = \ - LLVMSparcV9ModuloSched \ + LLVMSparcV9ModuloSched \ LLVMSparcV9 \ + LLVMSkeleton \ LLVMSparcV9RegAlloc \ LLVMSparcV9InstrSched \ - LLVMTarget.a \ LLVMCodeGen \ + LLVMTarget.a \ LLVMSparcV9LiveVar \ LLVMInstrumentation \ LLVMProfilePaths \ LLVMipo.a \ LLVMipa.a \ LLVMTransforms.a \ - LLVMScalarOpts.a \ + LLVMScalarOpts \ LLVMAnalysis.a \ LLVMTransformUtils.a \ LLVMBCReader \ LLVMBCWriter \ - LLVMbzip2 \ LLVMCore \ LLVMSupport.a \ + LLVMbzip2 \ LLVMSystem.a - TOOLLINKOPTS = $(PLATFORMLIBDL) include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Fri Dec 17 16:42:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Fri, 17 Dec 2004 16:42:01 -0600 Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86InstrBuilder.h Message-ID: <200412172242.iBHMg1Mx012348@apoc.cs.uiuc.edu> Changes in directory llvm/lib/Target/X86: X86InstrBuilder.h updated: 1.13 -> 1.14 --- Log message: Remove unused enum value --- Diffs of the changes: (+2 -2) Index: llvm/lib/Target/X86/X86InstrBuilder.h diff -u llvm/lib/Target/X86/X86InstrBuilder.h:1.13 llvm/lib/Target/X86/X86InstrBuilder.h:1.14 --- llvm/lib/Target/X86/X86InstrBuilder.h:1.13 Thu Oct 14 23:43:20 2004 +++ llvm/lib/Target/X86/X86InstrBuilder.h Fri Dec 17 16:41:46 2004 @@ -34,7 +34,6 @@ /// also include the offset of a global value. struct X86AddressMode { enum { - UnknownBase, RegBase, FrameIndexBase, } BaseType; @@ -49,7 +48,8 @@ unsigned Disp; GlobalValue *GV; - X86AddressMode() : BaseType(UnknownBase), GV(NULL) {} + X86AddressMode() : BaseType(RegBase), Scale(1), IndexReg(0), Disp(0), + GV(NULL) {} }; /// addDirectMem - This function is used to add a direct memory reference to the From reid at x10sys.com Fri Dec 17 18:14:35 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 17 Dec 2004 18:14:35 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Path.h Message-ID: <200412180014.SAA03584@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Path.h updated: 1.19 -> 1.20 --- Log message: Correct the name of the method. CopyFiles -> CopyFile. --- Diffs of the changes: (+1 -1) Index: llvm/include/llvm/System/Path.h diff -u llvm/include/llvm/System/Path.h:1.19 llvm/include/llvm/System/Path.h:1.20 --- llvm/include/llvm/System/Path.h:1.19 Wed Dec 15 16:49:18 2004 +++ llvm/include/llvm/System/Path.h Fri Dec 17 18:14:24 2004 @@ -592,7 +592,7 @@ /// file specified by Dest. If an error occurs, Dest is removed. /// @throws std::string if an error opening or writing the files occurs. /// @brief Copy one file to another. - void CopyFiles(const Path& Dest, const Path& Src); + void CopyFile(const Path& Dest, const Path& Src); } inline std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath) { From reid at x10sys.com Fri Dec 17 18:19:43 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 17 Dec 2004 18:19:43 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200412180019.SAA03648@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.13 -> 1.14 --- Log message: The CopyFile function got moved into the sys namespace. --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.13 llvm/tools/llvm-ld/llvm-ld.cpp:1.14 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.13 Thu Dec 16 17:04:20 2004 +++ llvm/tools/llvm-ld/llvm-ld.cpp Fri Dec 17 18:19:32 2004 @@ -313,7 +313,7 @@ std::cerr << "Could not find llvm-stub.exe executable!\n"; exit(1); } - if (CopyFile(OutputFilename, llvmstub)) { + if (sys::CopyFile(OutputFilename, llvmstub)) { std::cerr << "Could not copy the llvm-stub.exe executable!\n"; exit(1); } From reid at x10sys.com Fri Dec 17 18:19:43 2004 From: reid at x10sys.com (Reid Spencer) Date: Fri, 17 Dec 2004 18:19:43 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200412180019.SAA03651@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.91 -> 1.92 --- Log message: The CopyFile function got moved into the sys namespace. --- Diffs of the changes: (+1 -1) Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.91 llvm/tools/gccld/gccld.cpp:1.92 --- llvm/tools/gccld/gccld.cpp:1.91 Thu Dec 16 17:04:20 2004 +++ llvm/tools/gccld/gccld.cpp Fri Dec 17 18:19:32 2004 @@ -124,7 +124,7 @@ std::cerr << "Could not find llvm-stub.exe executable!\n"; exit(1); } - if (CopyFile(OutputFilename, llvmstub)) { + if (sys::CopyFile(OutputFilename, llvmstub)) { std::cerr << "Could not copy the llvm-stub.exe executable!\n"; exit(1); } From alkis at cs.uiuc.edu Fri Dec 17 18:23:18 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Fri, 17 Dec 2004 18:23:18 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp In-Reply-To: <200412180019.SAA03648@zion.cs.uiuc.edu> References: <200412180019.SAA03648@zion.cs.uiuc.edu> Message-ID: <200412171823.18304.alkis@cs.uiuc.edu> On Friday 17 December 2004 18:19, Reid Spencer wrote: > Changes in directory llvm/tools/llvm-ld: > > llvm-ld.cpp updated: 1.13 -> 1.14 > --- > Log message: > > The CopyFile function got moved into the sys namespace. > > > --- > Diffs of the changes: (+1 -1) > > Index: llvm/tools/llvm-ld/llvm-ld.cpp > diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.13 > llvm/tools/llvm-ld/llvm-ld.cpp:1.14 --- > llvm/tools/llvm-ld/llvm-ld.cpp:1.13 Thu Dec 16 17:04:20 2004 > +++ llvm/tools/llvm-ld/llvm-ld.cpp Fri Dec 17 18:19:32 2004 > @@ -313,7 +313,7 @@ > std::cerr << "Could not find llvm-stub.exe executable!\n"; > exit(1); > } > - if (CopyFile(OutputFilename, llvmstub)) { > + if (sys::CopyFile(OutputFilename, llvmstub)) { > std::cerr << "Could not copy the llvm-stub.exe executable!\n"; > exit(1); > } Is this going to work? sys::CopyFile returns void... BTW, do you have a windows machine handy to test this on? -- Alkis From alkis at cs.uiuc.edu Fri Dec 17 18:47:48 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Fri, 17 Dec 2004 18:47:48 -0600 Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp Message-ID: <200412180047.SAA24382@niobe.cs.uiuc.edu> Changes in directory llvm-java/lib/Compiler: Compiler.cpp updated: 1.181 -> 1.182 --- Log message: Factor out common code for pushing/popping off the operand stack --- Diffs of the changes: (+139 -128) Index: llvm-java/lib/Compiler/Compiler.cpp diff -u llvm-java/lib/Compiler/Compiler.cpp:1.181 llvm-java/lib/Compiler/Compiler.cpp:1.182 --- llvm-java/lib/Compiler/Compiler.cpp:1.181 Mon Dec 13 20:57:54 2004 +++ llvm-java/lib/Compiler/Compiler.cpp Fri Dec 17 18:47:33 2004 @@ -136,6 +136,18 @@ } private: + void push(Value* value) { + assert(currentOpStack_ && "Current operand stack not set!"); + assert(currentBB_ && "Current basic block not set!"); + currentOpStack_->push(value, currentBB_); + } + + Value* pop() { + assert(currentOpStack_ && "Current operand stack not set!"); + assert(currentBB_ && "Current basic block not set!"); + return currentOpStack_->pop(currentBB_); + } + /// Schedule a method for compilation. Returns true if this is the /// first time this function was scheduled. bool scheduleFunction(Function* function) { @@ -1492,31 +1504,30 @@ void do_aconst_null() { ClassFile* root = ClassFile::get("java/lang/Object"); - currentOpStack_->push(llvm::Constant::getNullValue( - PointerType::get(getClassInfo(root).type)), - currentBB_); + push(llvm::Constant::getNullValue( + PointerType::get(getClassInfo(root).type))); } void do_iconst(int value) { - currentOpStack_->push(ConstantSInt::get(Type::IntTy, value), currentBB_); + push(ConstantSInt::get(Type::IntTy, value)); } void do_lconst(long long value) { - currentOpStack_->push(ConstantSInt::get(Type::LongTy, value), currentBB_); + push(ConstantSInt::get(Type::LongTy, value)); } void do_fconst(float value) { - currentOpStack_->push(ConstantFP::get(Type::FloatTy, value), currentBB_); + push(ConstantFP::get(Type::FloatTy, value)); } void do_dconst(double value) { - currentOpStack_->push(ConstantFP::get(Type::DoubleTy, value), currentBB_); + push(ConstantFP::get(Type::DoubleTy, value)); } void do_ldc(unsigned index) { Constant* c = cf_->getConstant(index); assert(getConstant(c) && "Java constant not handled!"); - currentOpStack_->push(getConstant(c), currentBB_); + push(getConstant(c)); } void do_ldc2(unsigned index) { @@ -1531,7 +1542,7 @@ void do_load_common(unsigned index) { Value* val = currentLocals_->load(index, currentBB_); - currentOpStack_->push(val, currentBB_); + push(val); } void do_iaload() { do_aload_common(); } @@ -1544,8 +1555,8 @@ void do_saload() { do_aload_common(); } void do_aload_common() { - Value* index = currentOpStack_->pop(currentBB_); - Value* arrayRef = currentOpStack_->pop(currentBB_); + Value* index = pop(); + Value* arrayRef = pop(); std::vector indices; indices.reserve(3); @@ -1555,7 +1566,7 @@ Value* elementPtr = new GetElementPtrInst(arrayRef, indices, TMP, currentBB_); Value* result = new LoadInst(elementPtr, TMP, currentBB_); - currentOpStack_->push(result, currentBB_); + push(result); } void do_istore(unsigned index) { do_store_common(index); } @@ -1565,7 +1576,7 @@ void do_astore(unsigned index) { do_store_common(index); } void do_store_common(unsigned index) { - Value* val = currentOpStack_->pop(currentBB_); + Value* val = pop(); currentLocals_->store(index, val, currentBB_); } @@ -1583,11 +1594,11 @@ void do_sastore() { do_astore_common(Type::ShortTy); } void do_astore_common(Type* castTo = NULL) { - Value* value = currentOpStack_->pop(currentBB_); + Value* value = pop(); if (castTo) value = new CastInst(value, castTo, TMP, currentBB_); - Value* index = currentOpStack_->pop(currentBB_); - Value* arrayRef = currentOpStack_->pop(currentBB_); + Value* index = pop(); + Value* arrayRef = pop(); std::vector indices; indices.reserve(3); @@ -1600,122 +1611,122 @@ } void do_pop() { - currentOpStack_->pop(currentBB_); + pop(); } void do_pop2() { - Value* v1 = currentOpStack_->pop(currentBB_); + Value* v1 = pop(); if (isOneSlotValue(v1)) - currentOpStack_->pop(currentBB_); + pop(); } void do_dup() { - Value* val = currentOpStack_->pop(currentBB_); - currentOpStack_->push(val, currentBB_); - currentOpStack_->push(val, currentBB_); + Value* val = pop(); + push(val); + push(val); } void do_dup_x1() { - Value* v1 = currentOpStack_->pop(currentBB_); - Value* v2 = currentOpStack_->pop(currentBB_); - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); + Value* v1 = pop(); + Value* v2 = pop(); + push(v1); + push(v2); + push(v1); } void do_dup_x2() { - Value* v1 = currentOpStack_->pop(currentBB_); - Value* v2 = currentOpStack_->pop(currentBB_); + Value* v1 = pop(); + Value* v2 = pop(); if (isOneSlotValue(v2)) { - Value* v3 = currentOpStack_->pop(currentBB_); - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v3, currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); + Value* v3 = pop(); + push(v1); + push(v3); + push(v2); + push(v1); } else { - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); + push(v1); + push(v2); + push(v1); } } void do_dup2() { - Value* v1 = currentOpStack_->pop(currentBB_); + Value* v1 = pop(); if (isOneSlotValue(v1)) { - Value* v2 = currentOpStack_->pop(currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); + Value* v2 = pop(); + push(v2); + push(v1); + push(v2); + push(v1); } else { - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v1, currentBB_); + push(v1); + push(v1); } } void do_dup2_x1() { - Value* v1 = currentOpStack_->pop(currentBB_); - Value* v2 = currentOpStack_->pop(currentBB_); + Value* v1 = pop(); + Value* v2 = pop(); if (isOneSlotValue(v1)) { - Value* v3 = currentOpStack_->pop(currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v3, currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); + Value* v3 = pop(); + push(v2); + push(v1); + push(v3); + push(v2); + push(v1); } else { - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); + push(v1); + push(v2); + push(v1); } } void do_dup2_x2() { - Value* v1 = currentOpStack_->pop(currentBB_); - Value* v2 = currentOpStack_->pop(currentBB_); + Value* v1 = pop(); + Value* v2 = pop(); if (isOneSlotValue(v1)) { - Value* v3 = currentOpStack_->pop(currentBB_); + Value* v3 = pop(); if (isOneSlotValue(v3)) { - Value* v4 = currentOpStack_->pop(currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v4, currentBB_); - currentOpStack_->push(v3, currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); + Value* v4 = pop(); + push(v2); + push(v1); + push(v4); + push(v3); + push(v2); + push(v1); } else { - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v3, currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); + push(v2); + push(v1); + push(v3); + push(v2); + push(v1); } } else { if (isOneSlotValue(v2)) { - Value* v3 = currentOpStack_->pop(currentBB_); - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v3, currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); + Value* v3 = pop(); + push(v1); + push(v3); + push(v2); + push(v1); } else { - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v2, currentBB_); - currentOpStack_->push(v1, currentBB_); + push(v1); + push(v2); + push(v1); } } } void do_swap() { - Value* v1 = currentOpStack_->pop(currentBB_); - Value* v2 = currentOpStack_->pop(currentBB_); - currentOpStack_->push(v1, currentBB_); - currentOpStack_->push(v2, currentBB_); + Value* v1 = pop(); + Value* v2 = pop(); + push(v1); + push(v2); } void do_iadd() { do_binary_op_common(Instruction::Add); } @@ -1749,9 +1760,9 @@ void do_dneg() { do_neg_common(); } void do_neg_common() { - Value* v1 = currentOpStack_->pop(currentBB_); + Value* v1 = pop(); Value* r = BinaryOperator::createNeg(v1, TMP, currentBB_); - currentOpStack_->push(r, currentBB_); + push(r); } void do_ishl() { do_shift_common(Instruction::Shl); } @@ -1765,25 +1776,25 @@ void do_shift_unsigned_common() { // Cast value to be shifted into its unsigned version. do_swap(); - Value* v = currentOpStack_->pop(currentBB_); + Value* v = pop(); v = new CastInst(v, v->getType()->getUnsignedVersion(), TMP, currentBB_); - currentOpStack_->push(v, currentBB_); + push(v); do_swap(); do_shift_common(Instruction::Shr); - v = currentOpStack_->pop(currentBB_); + v = pop(); // Cast shifted value back to its original signed version. v = new CastInst(v, v->getType()->getSignedVersion(), TMP, currentBB_); - currentOpStack_->push(v, currentBB_); + push(v); } void do_shift_common(Instruction::OtherOps op) { - Value* a = currentOpStack_->pop(currentBB_); - Value* v = currentOpStack_->pop(currentBB_); + Value* a = pop(); + Value* v = pop(); a = new CastInst(a, Type::UByteTy, TMP, currentBB_); Value* r = new ShiftInst(op, v, a, TMP, currentBB_); - currentOpStack_->push(r, currentBB_); + push(r); } void do_iand() { do_binary_op_common(Instruction::And); } @@ -1794,10 +1805,10 @@ void do_lxor() { do_binary_op_common(Instruction::Xor); } void do_binary_op_common(Instruction::BinaryOps op) { - Value* v2 = currentOpStack_->pop(currentBB_); - Value* v1 = currentOpStack_->pop(currentBB_); + Value* v2 = pop(); + Value* v1 = pop(); Value* r = BinaryOperator::create(op, v1, v2, TMP, currentBB_); - currentOpStack_->push(r, currentBB_); + push(r); } void do_iinc(unsigned index, int amount) { @@ -1824,21 +1835,21 @@ void do_i2s() { do_truncate_common(Type::ShortTy); } void do_cast_common(Type* type) { - Value* v1 = currentOpStack_->pop(currentBB_); + Value* v1 = pop(); v1 = new CastInst(v1, type, TMP, currentBB_); - currentOpStack_->push(v1, currentBB_); + push(v1); } void do_truncate_common(Type* type) { - Value* v1 = currentOpStack_->pop(currentBB_); + Value* v1 = pop(); v1 = new CastInst(v1, type, TMP, currentBB_); v1 = new CastInst(v1, Type::IntTy, TMP, currentBB_); - currentOpStack_->push(v1, currentBB_); + push(v1); } void do_lcmp() { - Value* v2 = currentOpStack_->pop(currentBB_); - Value* v1 = currentOpStack_->pop(currentBB_); + Value* v2 = pop(); + Value* v1 = pop(); Value* c = BinaryOperator::createSetGT(v1, v2, TMP, currentBB_); Value* r = new SelectInst(c, ConstantSInt::get(Type::IntTy, 1), ConstantSInt::get(Type::IntTy, 0), TMP, @@ -1846,7 +1857,7 @@ c = BinaryOperator::createSetLT(v1, v2, TMP, currentBB_); r = new SelectInst(c, ConstantSInt::get(Type::IntTy, -1), r, TMP, currentBB_); - currentOpStack_->push(r, currentBB_); + push(r); } void do_fcmpl() { do_cmp_common(-1); } @@ -1855,8 +1866,8 @@ void do_dcmpg() { do_cmp_common(1); } void do_cmp_common(int valueIfUnordered) { - Value* v2 = currentOpStack_->pop(currentBB_); - Value* v1 = currentOpStack_->pop(currentBB_); + Value* v2 = pop(); + Value* v1 = pop(); Value* c = BinaryOperator::createSetGT(v1, v2, TMP, currentBB_); Value* r = new SelectInst(c, ConstantSInt::get(Type::IntTy, 1), ConstantSInt::get(Type::IntTy, 0), TMP, @@ -1870,7 +1881,7 @@ v1, v2, TMP, currentBB_); r = new SelectInst(c, ConstantSInt::get(Type::IntTy, valueIfUnordered), r, TMP, currentBB_); - currentOpStack_->push(r, currentBB_); + push(r); } void do_ifeq(unsigned t, unsigned f) { @@ -1931,8 +1942,8 @@ } void do_if_common(Instruction::BinaryOps cc, unsigned t, unsigned f) { - Value* v2 = currentOpStack_->pop(currentBB_); - Value* v1 = currentOpStack_->pop(currentBB_); + Value* v2 = pop(); + Value* v1 = pop(); if (v1->getType() != v2->getType()) v1 = new CastInst(v1, v2->getType(), TMP, currentBB_); Value* c = new SetCondInst(cc, v1, v2, TMP, currentBB_); @@ -1952,7 +1963,7 @@ void do_areturn() { do_return_common(); } void do_return_common() { - Value* r = currentOpStack_->pop(currentBB_); + Value* r = pop(); const Type* retTy = currentBB_->getParent()->getReturnType(); new ReturnInst(new CastInst(r, retTy, TMP, currentBB_), currentBB_); } @@ -1972,7 +1983,7 @@ } void do_switch(unsigned defTarget, const SwitchCases& sw) { - Value* v = currentOpStack_->pop(currentBB_); + Value* v = pop(); SwitchInst* in = new SwitchInst(v, bbBuilder_->getBasicBlock(defTarget), currentBB_); for (unsigned i = 0, e = sw.size(); i != e; ++i) @@ -1982,11 +1993,11 @@ void do_getstatic(unsigned index) { Value* v = new LoadInst(getStaticField(index), TMP, currentBB_); - currentOpStack_->push(v, currentBB_); + push(v); } void do_putstatic(unsigned index) { - Value* v = currentOpStack_->pop(currentBB_); + Value* v = pop(); Value* ptr = getStaticField(index); const Type* fieldTy = cast(ptr->getType())->getElementType(); if (v->getType() != fieldTy) @@ -1995,14 +2006,14 @@ } void do_getfield(unsigned index) { - Value* p = currentOpStack_->pop(currentBB_); + Value* p = pop(); Value* v = new LoadInst(getField(index, p), TMP, currentBB_); - currentOpStack_->push(v, currentBB_); + push(v); } void do_putfield(unsigned index) { - Value* v = currentOpStack_->pop(currentBB_); - Value* p = currentOpStack_->pop(currentBB_); + Value* v = pop(); + Value* p = pop(); Value* fp = getField(index, p); const Type* ft = cast(fp->getType())->getElementType(); v = new CastInst(v, ft, TMP, currentBB_); @@ -2018,7 +2029,7 @@ new CallInst(fun, params, "", currentBB_); else { Value* r = new CallInst(fun, params, TMP, currentBB_); - currentOpStack_->push(r, currentBB_); + push(r); } } @@ -2026,7 +2037,7 @@ unsigned numParams = funTy->getNumParams(); std::vector params(numParams); while (numParams--) { - Value* p = currentOpStack_->pop(currentBB_); + Value* p = pop(); params[numParams] = p->getType() == funTy->getParamType(numParams) ? p : @@ -2254,7 +2265,7 @@ PointerType::get(ClassInfo::ObjectBaseTy), PointerType::get(VTableInfo::VTableBaseTy), NULL); new CallInst(f, objBase, vtable, "", currentBB_); - currentOpStack_->push(objRef, currentBB_); + push(objRef); } Value* getArrayLengthPtr(Value* arrayRef) const { @@ -2276,7 +2287,7 @@ } void do_newarray(JType type) { - Value* count = currentOpStack_->pop(currentBB_); + Value* count = pop(); count = new CastInst(count, Type::UIntTy, TMP, currentBB_); const ClassInfo& ci = getPrimitiveArrayInfo(type); @@ -2286,7 +2297,7 @@ } void do_anewarray(unsigned index) { - Value* count = currentOpStack_->pop(currentBB_); + Value* count = pop(); count = new CastInst(count, Type::UIntTy, TMP, currentBB_); ConstantClass* classRef = cf_->getConstantClass(index); @@ -2335,22 +2346,22 @@ PointerType::get(ClassInfo::ObjectBaseTy), PointerType::get(VTableInfo::VTableBaseTy), NULL); new CallInst(f, objBase, vtable, "", currentBB_); - currentOpStack_->push(objRef, currentBB_); + push(objRef); } void do_arraylength() { - Value* arrayRef = currentOpStack_->pop(currentBB_); + Value* arrayRef = pop(); const ClassInfo& ci = getObjectArrayInfo(); arrayRef = new CastInst(arrayRef, PointerType::get(ci.type), TMP, currentBB_); Value* lengthPtr = getArrayLengthPtr(arrayRef); Value* length = new LoadInst(lengthPtr, TMP, currentBB_); length = new CastInst(length, Type::IntTy, TMP, currentBB_); - currentOpStack_->push(length, currentBB_); + push(length); } void do_athrow() { - Value* objRef = currentOpStack_->pop(currentBB_); + Value* objRef = pop(); objRef = new CastInst(objRef, PointerType::get(ClassInfo::ObjectBaseTy), TMP, currentBB_); Function* f = module_.getOrInsertFunction( @@ -2367,7 +2378,7 @@ const VTableInfo* vi = NULL; tie(ci, vi) = getInfo(classRef->getName()->str()); - Value* objRef = currentOpStack_->pop(currentBB_); + Value* objRef = pop(); Value* objBase = new CastInst(objRef, PointerType::get(ClassInfo::ObjectBaseTy), TMP, currentBB_); @@ -2385,7 +2396,7 @@ // FIXME: if b is false we must throw a ClassCast exception Value* objCast = new CastInst(objRef, PointerType::get(ci->type), TMP, currentBB_); - currentOpStack_->push(objCast, currentBB_); + push(objCast); } void do_instanceof(unsigned index) { @@ -2395,7 +2406,7 @@ const VTableInfo* vi = NULL; tie(ci, vi) = getInfo(classRef->getName()->str()); - Value* objRef = currentOpStack_->pop(currentBB_); + Value* objRef = pop(); Value* objBase = new CastInst(objRef, PointerType::get(ClassInfo::ObjectBaseTy), TMP, currentBB_); @@ -2406,7 +2417,7 @@ PointerType::get(VTableInfo::VTableBaseTy), TMP, currentBB_); Value* r = new CallInst(f, objBase, vtable, TMP, currentBB_); - currentOpStack_->push(r, currentBB_); + push(r); } void do_monitorenter() { From jeffc at jolt-lang.org Sat Dec 18 00:42:26 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 00:42:26 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Path.cpp Message-ID: <200412180642.AAA07942@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Path.cpp updated: 1.20 -> 1.21 --- Log message: Fix win32 breakage --- Diffs of the changes: (+1 -0) Index: llvm/lib/System/Win32/Path.cpp diff -u llvm/lib/System/Win32/Path.cpp:1.20 llvm/lib/System/Win32/Path.cpp:1.21 --- llvm/lib/System/Win32/Path.cpp:1.20 Wed Dec 15 17:02:10 2004 +++ llvm/lib/System/Win32/Path.cpp Sat Dec 18 00:42:15 2004 @@ -603,6 +603,7 @@ // Make this into a unique file name makeUnique( reuse_current ); + return true; } } From jeffc at jolt-lang.org Sat Dec 18 00:42:26 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 00:42:26 -0600 Subject: [llvm-commits] CVS: llvm/win32/x86/x86.vcproj Message-ID: <200412180642.AAA07945@zion.cs.uiuc.edu> Changes in directory llvm/win32/x86: x86.vcproj updated: 1.3 -> 1.4 --- Log message: Fix win32 breakage --- Diffs of the changes: (+4 -4) Index: llvm/win32/x86/x86.vcproj diff -u llvm/win32/x86/x86.vcproj:1.3 llvm/win32/x86/x86.vcproj:1.4 --- llvm/win32/x86/x86.vcproj:1.3 Sat Dec 4 13:14:38 2004 +++ llvm/win32/x86/x86.vcproj Sat Dec 18 00:42:15 2004 @@ -48,8 +48,8 @@ ..\tools\TableGen.exe -gen-register-desc -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenRegisterInfo.inc ..\tools\TableGen.exe -gen-instr-enums -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenInstrNames.inc ..\tools\TableGen.exe -gen-instr-desc -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenInstrInfo.inc -..\tools\TableGen.exe -gen-asm-writer -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenATTAsmWriter.inc -..\tools\TableGen.exe -gen-asm-writer -asmwriternum=1 -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenIntelAsmWriter.inc +..\tools\TableGen.exe -gen-asm-writer -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenAsmWriter.inc +..\tools\TableGen.exe -gen-asm-writer -asmwriternum=1 -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenAsmWriter1.inc "/> @@ -99,8 +99,8 @@ ..\tools\TableGen.exe -gen-register-desc -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenRegisterInfo.inc ..\tools\TableGen.exe -gen-instr-enums -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenInstrNames.inc ..\tools\TableGen.exe -gen-instr-desc -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenInstrInfo.inc -..\tools\TableGen.exe -gen-asm-writer -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenATTAsmWriter.inc -..\tools\TableGen.exe -gen-asm-writer -asmwriternum=1 -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenIntelAsmWriter.inc +..\tools\TableGen.exe -gen-asm-writer -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenAsmWriter.inc +..\tools\TableGen.exe -gen-asm-writer -asmwriternum=1 -I ..\..\lib\Target\X86 ..\..\lib\Target\X86\X86.td ..\..\lib\Target\X86\X86InstrInfo.td ..\..\lib\Target\X86\X86RegisterInfo.td ..\..\lib\Target\Target.td -o ..\..\tablegen_includes\X86GenAsmWriter1.inc "/> From reid at x10sys.com Sat Dec 18 00:53:21 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 18 Dec 2004 00:53:21 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/gccld.cpp Message-ID: <200412180653.AAA08181@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: gccld.cpp updated: 1.92 -> 1.93 --- Log message: sys::CopyString throws an exception on error which will be caught by gccld main function. --- Diffs of the changes: (+1 -4) Index: llvm/tools/gccld/gccld.cpp diff -u llvm/tools/gccld/gccld.cpp:1.92 llvm/tools/gccld/gccld.cpp:1.93 --- llvm/tools/gccld/gccld.cpp:1.92 Fri Dec 17 18:19:32 2004 +++ llvm/tools/gccld/gccld.cpp Sat Dec 18 00:53:10 2004 @@ -124,10 +124,7 @@ std::cerr << "Could not find llvm-stub.exe executable!\n"; exit(1); } - if (sys::CopyFile(OutputFilename, llvmstub)) { - std::cerr << "Could not copy the llvm-stub.exe executable!\n"; - exit(1); - } + sys::CopyFile(OutputFilename, llvmstub); return; #endif From reid at x10sys.com Sat Dec 18 00:54:32 2004 From: reid at x10sys.com (Reid Spencer) Date: Sat, 18 Dec 2004 00:54:32 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200412180654.AAA08267@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.14 -> 1.15 --- Log message: sys::CopyFile returns void and throws an exception on error which will be caught by llvm-ld's main function. --- Diffs of the changes: (+1 -4) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.14 llvm/tools/llvm-ld/llvm-ld.cpp:1.15 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.14 Fri Dec 17 18:19:32 2004 +++ llvm/tools/llvm-ld/llvm-ld.cpp Sat Dec 18 00:54:21 2004 @@ -313,10 +313,7 @@ std::cerr << "Could not find llvm-stub.exe executable!\n"; exit(1); } - if (sys::CopyFile(OutputFilename, llvmstub)) { - std::cerr << "Could not copy the llvm-stub.exe executable!\n"; - exit(1); - } + sys::CopyFile(OutputFilename, llvmstub); return; #endif From jeffc at jolt-lang.org Sat Dec 18 00:55:54 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 00:55:54 -0600 Subject: [llvm-commits] CVS: llvm/win32/CodeGen/CodeGen.vcproj Message-ID: <200412180655.AAA08415@zion.cs.uiuc.edu> Changes in directory llvm/win32/CodeGen: CodeGen.vcproj updated: 1.3 -> 1.4 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/CodeGen/CodeGen.vcproj diff -u llvm/win32/CodeGen/CodeGen.vcproj:1.3 llvm/win32/CodeGen/CodeGen.vcproj:1.4 --- llvm/win32/CodeGen/CodeGen.vcproj:1.3 Sat Dec 4 13:14:38 2004 +++ llvm/win32/CodeGen/CodeGen.vcproj Sat Dec 18 00:55:41 2004 @@ -28,9 +28,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/Analysis: Analysis.vcproj updated: 1.3 -> 1.4 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/Analysis/Analysis.vcproj diff -u llvm/win32/Analysis/Analysis.vcproj:1.3 llvm/win32/Analysis/Analysis.vcproj:1.4 --- llvm/win32/Analysis/Analysis.vcproj:1.3 Sat Dec 4 13:14:36 2004 +++ llvm/win32/Analysis/Analysis.vcproj Sat Dec 18 00:55:41 2004 @@ -28,9 +28,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/ExecutionEngine: ExecutionEngine.vcproj updated: 1.3 -> 1.4 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/ExecutionEngine/ExecutionEngine.vcproj diff -u llvm/win32/ExecutionEngine/ExecutionEngine.vcproj:1.3 llvm/win32/ExecutionEngine/ExecutionEngine.vcproj:1.4 --- llvm/win32/ExecutionEngine/ExecutionEngine.vcproj:1.3 Sat Dec 4 13:14:38 2004 +++ llvm/win32/ExecutionEngine/ExecutionEngine.vcproj Sat Dec 18 00:55:41 2004 @@ -28,9 +28,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/Target: Target.vcproj updated: 1.3 -> 1.4 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/Target/Target.vcproj diff -u llvm/win32/Target/Target.vcproj:1.3 llvm/win32/Target/Target.vcproj:1.4 --- llvm/win32/Target/Target.vcproj:1.3 Sat Dec 4 13:14:38 2004 +++ llvm/win32/Target/Target.vcproj Sat Dec 18 00:55:41 2004 @@ -28,9 +28,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/x86: x86.vcproj updated: 1.4 -> 1.5 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/x86/x86.vcproj diff -u llvm/win32/x86/x86.vcproj:1.4 llvm/win32/x86/x86.vcproj:1.5 --- llvm/win32/x86/x86.vcproj:1.4 Sat Dec 18 00:42:15 2004 +++ llvm/win32/x86/x86.vcproj Sat Dec 18 00:55:41 2004 @@ -28,9 +28,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/Transforms: Transforms.vcproj updated: 1.5 -> 1.6 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/Transforms/Transforms.vcproj diff -u llvm/win32/Transforms/Transforms.vcproj:1.5 llvm/win32/Transforms/Transforms.vcproj:1.6 --- llvm/win32/Transforms/Transforms.vcproj:1.5 Wed Dec 8 23:51:11 2004 +++ llvm/win32/Transforms/Transforms.vcproj Sat Dec 18 00:55:41 2004 @@ -28,9 +28,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/Support: Support.vcproj updated: 1.4 -> 1.5 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/Support/Support.vcproj diff -u llvm/win32/Support/Support.vcproj:1.4 llvm/win32/Support/Support.vcproj:1.5 --- llvm/win32/Support/Support.vcproj:1.4 Sat Dec 4 13:14:38 2004 +++ llvm/win32/Support/Support.vcproj Sat Dec 18 00:55:41 2004 @@ -29,9 +29,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/TableGen: TableGen.vcproj updated: 1.3 -> 1.4 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/TableGen/TableGen.vcproj diff -u llvm/win32/TableGen/TableGen.vcproj:1.3 llvm/win32/TableGen/TableGen.vcproj:1.4 --- llvm/win32/TableGen/TableGen.vcproj:1.3 Sat Nov 6 11:07:36 2004 +++ llvm/win32/TableGen/TableGen.vcproj Sat Dec 18 00:55:41 2004 @@ -28,9 +28,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/System: System.vcproj updated: 1.5 -> 1.6 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/System/System.vcproj diff -u llvm/win32/System/System.vcproj:1.5 llvm/win32/System/System.vcproj:1.6 --- llvm/win32/System/System.vcproj:1.5 Sat Dec 4 13:14:38 2004 +++ llvm/win32/System/System.vcproj Sat Dec 18 00:55:41 2004 @@ -28,9 +28,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/Fibonacci: Fibonacci.vcproj updated: 1.2 -> 1.3 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/Fibonacci/Fibonacci.vcproj diff -u llvm/win32/Fibonacci/Fibonacci.vcproj:1.2 llvm/win32/Fibonacci/Fibonacci.vcproj:1.3 --- llvm/win32/Fibonacci/Fibonacci.vcproj:1.2 Sat Nov 6 11:07:36 2004 +++ llvm/win32/Fibonacci/Fibonacci.vcproj Sat Dec 18 00:55:41 2004 @@ -28,9 +28,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4099;4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/VMCore: VMCore.vcproj updated: 1.4 -> 1.5 --- Log message: Rationalize warning suppression. First, 64-bit portability warnings are disabled. The specific warnings they produced were being suppressed anyway. The truncation warnings that were suppressed are now enabled, and the few that still occur ought to be fixed. The only warnings suppressed now are the "negating an unsigned is still unsigned", the validity of which Chris does not accept, and the "implicit conversion of to bool performance warning". Making the conversion explicit won't make it run any faster and this is an easier way to shut the compiler up. --- Diffs of the changes: (+3 -3) Index: llvm/win32/VMCore/VMCore.vcproj diff -u llvm/win32/VMCore/VMCore.vcproj:1.4 llvm/win32/VMCore/VMCore.vcproj:1.5 --- llvm/win32/VMCore/VMCore.vcproj:1.4 Sat Dec 4 13:14:38 2004 +++ llvm/win32/VMCore/VMCore.vcproj Sat Dec 18 00:55:41 2004 @@ -28,9 +28,9 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" - DisableSpecificWarnings="4800;4244;4267"/> + DisableSpecificWarnings="4146,4800"/> + DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/CodeGen: CodeGen.vcproj updated: 1.4 -> 1.5 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/CodeGen/CodeGen.vcproj diff -u llvm/win32/CodeGen/CodeGen.vcproj:1.4 llvm/win32/CodeGen/CodeGen.vcproj:1.5 --- llvm/win32/CodeGen/CodeGen.vcproj:1.4 Sat Dec 18 00:55:41 2004 +++ llvm/win32/CodeGen/CodeGen.vcproj Sat Dec 18 01:05:59 2004 @@ -70,7 +70,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/System: System.vcproj updated: 1.6 -> 1.7 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/System/System.vcproj diff -u llvm/win32/System/System.vcproj:1.6 llvm/win32/System/System.vcproj:1.7 --- llvm/win32/System/System.vcproj:1.6 Sat Dec 18 00:55:41 2004 +++ llvm/win32/System/System.vcproj Sat Dec 18 01:05:59 2004 @@ -71,7 +71,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/x86: x86.vcproj updated: 1.5 -> 1.6 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/x86/x86.vcproj diff -u llvm/win32/x86/x86.vcproj:1.5 llvm/win32/x86/x86.vcproj:1.6 --- llvm/win32/x86/x86.vcproj:1.5 Sat Dec 18 00:55:41 2004 +++ llvm/win32/x86/x86.vcproj Sat Dec 18 01:05:59 2004 @@ -79,7 +79,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/Target: Target.vcproj updated: 1.4 -> 1.5 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/Target/Target.vcproj diff -u llvm/win32/Target/Target.vcproj:1.4 llvm/win32/Target/Target.vcproj:1.5 --- llvm/win32/Target/Target.vcproj:1.4 Sat Dec 18 00:55:41 2004 +++ llvm/win32/Target/Target.vcproj Sat Dec 18 01:05:59 2004 @@ -70,7 +70,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/Fibonacci: Fibonacci.vcproj updated: 1.3 -> 1.4 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/Fibonacci/Fibonacci.vcproj diff -u llvm/win32/Fibonacci/Fibonacci.vcproj:1.3 llvm/win32/Fibonacci/Fibonacci.vcproj:1.4 --- llvm/win32/Fibonacci/Fibonacci.vcproj:1.3 Sat Dec 18 00:55:41 2004 +++ llvm/win32/Fibonacci/Fibonacci.vcproj Sat Dec 18 01:05:59 2004 @@ -83,7 +83,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/Transforms: Transforms.vcproj updated: 1.6 -> 1.7 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/Transforms/Transforms.vcproj diff -u llvm/win32/Transforms/Transforms.vcproj:1.6 llvm/win32/Transforms/Transforms.vcproj:1.7 --- llvm/win32/Transforms/Transforms.vcproj:1.6 Sat Dec 18 00:55:41 2004 +++ llvm/win32/Transforms/Transforms.vcproj Sat Dec 18 01:05:59 2004 @@ -70,7 +70,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/ExecutionEngine: ExecutionEngine.vcproj updated: 1.4 -> 1.5 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/ExecutionEngine/ExecutionEngine.vcproj diff -u llvm/win32/ExecutionEngine/ExecutionEngine.vcproj:1.4 llvm/win32/ExecutionEngine/ExecutionEngine.vcproj:1.5 --- llvm/win32/ExecutionEngine/ExecutionEngine.vcproj:1.4 Sat Dec 18 00:55:41 2004 +++ llvm/win32/ExecutionEngine/ExecutionEngine.vcproj Sat Dec 18 01:05:59 2004 @@ -70,7 +70,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/Analysis: Analysis.vcproj updated: 1.4 -> 1.5 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/Analysis/Analysis.vcproj diff -u llvm/win32/Analysis/Analysis.vcproj:1.4 llvm/win32/Analysis/Analysis.vcproj:1.5 --- llvm/win32/Analysis/Analysis.vcproj:1.4 Sat Dec 18 00:55:41 2004 +++ llvm/win32/Analysis/Analysis.vcproj Sat Dec 18 01:05:59 2004 @@ -70,7 +70,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/VMCore: VMCore.vcproj updated: 1.5 -> 1.6 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/VMCore/VMCore.vcproj diff -u llvm/win32/VMCore/VMCore.vcproj:1.5 llvm/win32/VMCore/VMCore.vcproj:1.6 --- llvm/win32/VMCore/VMCore.vcproj:1.5 Sat Dec 18 00:55:41 2004 +++ llvm/win32/VMCore/VMCore.vcproj Sat Dec 18 01:05:59 2004 @@ -70,7 +70,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/Support: Support.vcproj updated: 1.5 -> 1.6 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/Support/Support.vcproj diff -u llvm/win32/Support/Support.vcproj:1.5 llvm/win32/Support/Support.vcproj:1.6 --- llvm/win32/Support/Support.vcproj:1.5 Sat Dec 18 00:55:41 2004 +++ llvm/win32/Support/Support.vcproj Sat Dec 18 01:05:59 2004 @@ -71,7 +71,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/TableGen: TableGen.vcproj updated: 1.4 -> 1.5 --- Log message: Don't forget about release configuration... --- Diffs of the changes: (+1 -1) Index: llvm/win32/TableGen/TableGen.vcproj diff -u llvm/win32/TableGen/TableGen.vcproj:1.4 llvm/win32/TableGen/TableGen.vcproj:1.5 --- llvm/win32/TableGen/TableGen.vcproj:1.4 Sat Dec 18 00:55:41 2004 +++ llvm/win32/TableGen/TableGen.vcproj Sat Dec 18 01:05:59 2004 @@ -79,7 +79,7 @@ RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" + Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3" DisableSpecificWarnings="4146,4800"/> Changes in directory llvm/win32/System: System.vcproj updated: 1.7 -> 1.8 --- Log message: Improve dependency management for lib/system/win32/* files. Instead of copying the files from win32/* to platform/*, create one line files in platform that include the corresponding file in win32. This makes life much more enjoyable! The cruel irony is that NTFS has hard links just like Unix, but there's no way to get to them from the DOS prompt! --- Diffs of the changes: (+22 -2) Index: llvm/win32/System/System.vcproj diff -u llvm/win32/System/System.vcproj:1.7 llvm/win32/System/System.vcproj:1.8 --- llvm/win32/System/System.vcproj:1.7 Sat Dec 18 01:05:59 2004 +++ llvm/win32/System/System.vcproj Sat Dec 18 02:01:43 2004 @@ -4,6 +4,7 @@ Version="7.10" Name="System" ProjectGUID="{0F8407F3-FA23-4CF1-83A9-DCBE0B361489}" + RootNamespace="System" Keyword="Win32Proj"> + CommandLine="if not exist ..\..\lib\System\platform\DynamicLibrary.cpp echo #include "../win32/DynamicLibrary.cpp" >..\..\lib\System\platform\DynamicLibrary.cpp +if not exist ..\..\lib\System\platform\MappedFile.cpp echo #include "../win32/MappedFile.cpp" >..\..\lib\System\platform\MappedFile.cpp +if not exist ..\..\lib\System\platform\Memory.cpp echo #include "../win32/Memory.cpp" >..\..\lib\System\platform\Memory.cpp +if not exist ..\..\lib\System\platform\Path.cpp echo #include "../win32/Path.cpp" >..\..\lib\System\platform\Path.cpp +if not exist ..\..\lib\System\platform\Process.cpp echo #include "../win32/Process.cpp" >..\..\lib\System\platform\Process.cpp +if not exist ..\..\lib\System\platform\Program.cpp echo #include "../win32/Program.cpp" >..\..\lib\System\platform\Program.cpp +if not exist ..\..\lib\System\platform\Signals.cpp echo #include "../win32/Signals.cpp" >..\..\lib\System\platform\Signals.cpp +if not exist ..\..\lib\System\platform\SysConfig.cpp echo #include "../win32/SysConfig.cpp" >..\..\lib\System\platform\SysConfig.cpp +if not exist ..\..\lib\System\platform\TimeValue.cpp echo #include "../win32/TimeValue.cpp" >..\..\lib\System\platform\TimeValue.cpp +"/> + Name="VCPreBuildEventTool" + CommandLine="if not exist ..\..\lib\System\platform\DynamicLibrary.cpp echo #include "../win32/DynamicLibrary.cpp" >..\..\lib\System\platform\DynamicLibrary.cpp +if not exist ..\..\lib\System\platform\MappedFile.cpp echo #include "../win32/MappedFile.cpp" >..\..\lib\System\platform\MappedFile.cpp +if not exist ..\..\lib\System\platform\Memory.cpp echo #include "../win32/Memory.cpp" >..\..\lib\System\platform\Memory.cpp +if not exist ..\..\lib\System\platform\Path.cpp echo #include "../win32/Path.cpp" >..\..\lib\System\platform\Path.cpp +if not exist ..\..\lib\System\platform\Process.cpp echo #include "../win32/Process.cpp" >..\..\lib\System\platform\Process.cpp +if not exist ..\..\lib\System\platform\Program.cpp echo #include "../win32/Program.cpp" >..\..\lib\System\platform\Program.cpp +if not exist ..\..\lib\System\platform\Signals.cpp echo #include "../win32/Signals.cpp" >..\..\lib\System\platform\Signals.cpp +if not exist ..\..\lib\System\platform\SysConfig.cpp echo #include "../win32/SysConfig.cpp" >..\..\lib\System\platform\SysConfig.cpp +if not exist ..\..\lib\System\platform\TimeValue.cpp echo #include "../win32/TimeValue.cpp" >..\..\lib\System\platform\TimeValue.cpp +"/> Changes in directory reopt/test: TEST.reopt.Makefile updated: 1.31 -> 1.32 --- Log message: We need to pass LDFLAGS on the link line for some benchmarks to link correctly. --- Diffs of the changes: (+1 -1) Index: reopt/test/TEST.reopt.Makefile diff -u reopt/test/TEST.reopt.Makefile:1.31 reopt/test/TEST.reopt.Makefile:1.32 --- reopt/test/TEST.reopt.Makefile:1.31 Thu Dec 9 11:07:20 2004 +++ reopt/test/TEST.reopt.Makefile Sat Dec 18 04:25:34 2004 @@ -59,7 +59,7 @@ # compiler. $(PROGRAMS_TO_TEST:%=Output/%.reopt-llc): \ Output/%.reopt-llc: Output/%.reopt-llc.s $(REOPTIMIZER_LIB) - -$(CXX) $(CFLAGS) $(PROFILE) $< -o $@ $(REOPTIMIZER_LIB) $(REOPTIMIZER_SOLARISLIBS) + -$(CXX) $(CFLAGS) $(PROFILE) $< -o $@ $(LDFLAGS) $(REOPTIMIZER_LIB) $(REOPTIMIZER_SOLARISLIBS) @if test -x $@; then echo "PASS: reopt-link $(TESTNAME)"; \ else echo "FAIL: reopt-link $(TESTNAME)"; fi From jeffc at jolt-lang.org Sat Dec 18 20:29:13 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:13 -0600 Subject: [llvm-commits] CVS: llvm/win32/TableGen/TableGen.vcproj Message-ID: <200412190229.UAA11955@zion.cs.uiuc.edu> Changes in directory llvm/win32/TableGen: TableGen.vcproj updated: 1.5 -> 1.6 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/TableGen/TableGen.vcproj diff -u llvm/win32/TableGen/TableGen.vcproj:1.5 llvm/win32/TableGen/TableGen.vcproj:1.6 --- llvm/win32/TableGen/TableGen.vcproj:1.5 Sat Dec 18 01:05:59 2004 +++ llvm/win32/TableGen/TableGen.vcproj Sat Dec 18 20:29:00 2004 @@ -27,6 +27,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From jeffc at jolt-lang.org Sat Dec 18 20:29:13 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:13 -0600 Subject: [llvm-commits] CVS: llvm/win32/VMCore/VMCore.vcproj Message-ID: <200412190229.UAA11958@zion.cs.uiuc.edu> Changes in directory llvm/win32/VMCore: VMCore.vcproj updated: 1.6 -> 1.7 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/VMCore/VMCore.vcproj diff -u llvm/win32/VMCore/VMCore.vcproj:1.6 llvm/win32/VMCore/VMCore.vcproj:1.7 --- llvm/win32/VMCore/VMCore.vcproj:1.6 Sat Dec 18 01:05:59 2004 +++ llvm/win32/VMCore/VMCore.vcproj Sat Dec 18 20:29:00 2004 @@ -27,6 +27,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From jeffc at jolt-lang.org Sat Dec 18 20:29:14 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/Analysis/Analysis.vcproj Message-ID: <200412190229.UAA11959@zion.cs.uiuc.edu> Changes in directory llvm/win32/Analysis: Analysis.vcproj updated: 1.5 -> 1.6 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/Analysis/Analysis.vcproj diff -u llvm/win32/Analysis/Analysis.vcproj:1.5 llvm/win32/Analysis/Analysis.vcproj:1.6 --- llvm/win32/Analysis/Analysis.vcproj:1.5 Sat Dec 18 01:05:59 2004 +++ llvm/win32/Analysis/Analysis.vcproj Sat Dec 18 20:29:00 2004 @@ -27,6 +27,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From jeffc at jolt-lang.org Sat Dec 18 20:29:14 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/Support/Support.vcproj Message-ID: <200412190229.UAA11967@zion.cs.uiuc.edu> Changes in directory llvm/win32/Support: Support.vcproj updated: 1.6 -> 1.7 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/Support/Support.vcproj diff -u llvm/win32/Support/Support.vcproj:1.6 llvm/win32/Support/Support.vcproj:1.7 --- llvm/win32/Support/Support.vcproj:1.6 Sat Dec 18 01:05:59 2004 +++ llvm/win32/Support/Support.vcproj Sat Dec 18 20:29:00 2004 @@ -28,6 +28,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From jeffc at jolt-lang.org Sat Dec 18 20:29:14 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/ExecutionEngine/ExecutionEngine.vcproj Message-ID: <200412190229.UAA11964@zion.cs.uiuc.edu> Changes in directory llvm/win32/ExecutionEngine: ExecutionEngine.vcproj updated: 1.5 -> 1.6 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/ExecutionEngine/ExecutionEngine.vcproj diff -u llvm/win32/ExecutionEngine/ExecutionEngine.vcproj:1.5 llvm/win32/ExecutionEngine/ExecutionEngine.vcproj:1.6 --- llvm/win32/ExecutionEngine/ExecutionEngine.vcproj:1.5 Sat Dec 18 01:05:59 2004 +++ llvm/win32/ExecutionEngine/ExecutionEngine.vcproj Sat Dec 18 20:29:00 2004 @@ -27,6 +27,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From jeffc at jolt-lang.org Sat Dec 18 20:29:14 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/x86/x86.vcproj Message-ID: <200412190229.UAA11970@zion.cs.uiuc.edu> Changes in directory llvm/win32/x86: x86.vcproj updated: 1.6 -> 1.7 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/x86/x86.vcproj diff -u llvm/win32/x86/x86.vcproj:1.6 llvm/win32/x86/x86.vcproj:1.7 --- llvm/win32/x86/x86.vcproj:1.6 Sat Dec 18 01:05:59 2004 +++ llvm/win32/x86/x86.vcproj Sat Dec 18 20:29:00 2004 @@ -27,6 +27,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From jeffc at jolt-lang.org Sat Dec 18 20:29:14 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/System/System.vcproj Message-ID: <200412190229.UAA11973@zion.cs.uiuc.edu> Changes in directory llvm/win32/System: System.vcproj updated: 1.8 -> 1.9 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/System/System.vcproj diff -u llvm/win32/System/System.vcproj:1.8 llvm/win32/System/System.vcproj:1.9 --- llvm/win32/System/System.vcproj:1.8 Sat Dec 18 02:01:43 2004 +++ llvm/win32/System/System.vcproj Sat Dec 18 20:29:00 2004 @@ -28,6 +28,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From jeffc at jolt-lang.org Sat Dec 18 20:29:14 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/CodeGen/CodeGen.vcproj Message-ID: <200412190229.UAA11974@zion.cs.uiuc.edu> Changes in directory llvm/win32/CodeGen: CodeGen.vcproj updated: 1.5 -> 1.6 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/CodeGen/CodeGen.vcproj diff -u llvm/win32/CodeGen/CodeGen.vcproj:1.5 llvm/win32/CodeGen/CodeGen.vcproj:1.6 --- llvm/win32/CodeGen/CodeGen.vcproj:1.5 Sat Dec 18 01:05:59 2004 +++ llvm/win32/CodeGen/CodeGen.vcproj Sat Dec 18 20:29:00 2004 @@ -27,6 +27,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From jeffc at jolt-lang.org Sat Dec 18 20:29:14 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/Fibonacci/Fibonacci.vcproj Message-ID: <200412190229.UAA11979@zion.cs.uiuc.edu> Changes in directory llvm/win32/Fibonacci: Fibonacci.vcproj updated: 1.4 -> 1.5 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/Fibonacci/Fibonacci.vcproj diff -u llvm/win32/Fibonacci/Fibonacci.vcproj:1.4 llvm/win32/Fibonacci/Fibonacci.vcproj:1.5 --- llvm/win32/Fibonacci/Fibonacci.vcproj:1.4 Sat Dec 18 01:05:59 2004 +++ llvm/win32/Fibonacci/Fibonacci.vcproj Sat Dec 18 20:29:00 2004 @@ -27,6 +27,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From jeffc at jolt-lang.org Sat Dec 18 20:29:14 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/Target/Target.vcproj Message-ID: <200412190229.UAA11980@zion.cs.uiuc.edu> Changes in directory llvm/win32/Target: Target.vcproj updated: 1.5 -> 1.6 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/Target/Target.vcproj diff -u llvm/win32/Target/Target.vcproj:1.5 llvm/win32/Target/Target.vcproj:1.6 --- llvm/win32/Target/Target.vcproj:1.5 Sat Dec 18 01:05:59 2004 +++ llvm/win32/Target/Target.vcproj Sat Dec 18 20:29:00 2004 @@ -27,6 +27,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From jeffc at jolt-lang.org Sat Dec 18 20:29:14 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sat, 18 Dec 2004 20:29:14 -0600 Subject: [llvm-commits] CVS: llvm/win32/Transforms/Transforms.vcproj Message-ID: <200412190229.UAA11981@zion.cs.uiuc.edu> Changes in directory llvm/win32/Transforms: Transforms.vcproj updated: 1.7 -> 1.8 --- Log message: Enable browse information in Visual Studio --- Diffs of the changes: (+1 -0) Index: llvm/win32/Transforms/Transforms.vcproj diff -u llvm/win32/Transforms/Transforms.vcproj:1.7 llvm/win32/Transforms/Transforms.vcproj:1.8 --- llvm/win32/Transforms/Transforms.vcproj:1.7 Sat Dec 18 01:05:59 2004 +++ llvm/win32/Transforms/Transforms.vcproj Sat Dec 18 20:29:00 2004 @@ -27,6 +27,7 @@ ForceConformanceInForLoopScope="TRUE" RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" + BrowseInformation="1" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4" From llvm at cs.uiuc.edu Sun Dec 19 00:35:26 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sun, 19 Dec 2004 00:35:26 -0600 Subject: [llvm-commits] CVS: llvm/win32/lli/ Message-ID: <200412190635.AAA14832@zion.cs.uiuc.edu> Changes in directory llvm/win32/lli: --- Log message: Directory /var/cvs/llvm/llvm/win32/lli added to the repository --- Diffs of the changes: (+0 -0) From jeffc at jolt-lang.org Sun Dec 19 00:40:50 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sun, 19 Dec 2004 00:40:50 -0600 Subject: [llvm-commits] CVS: llvm/win32/Support/Support.vcproj Message-ID: <200412190640.AAA14900@zion.cs.uiuc.edu> Changes in directory llvm/win32/Support: Support.vcproj updated: 1.7 -> 1.8 --- Log message: Add lli project to Visual Studio --- Diffs of the changes: (+31 -0) Index: llvm/win32/Support/Support.vcproj diff -u llvm/win32/Support/Support.vcproj:1.7 llvm/win32/Support/Support.vcproj:1.8 --- llvm/win32/Support/Support.vcproj:1.7 Sat Dec 18 20:29:00 2004 +++ llvm/win32/Support/Support.vcproj Sun Dec 19 00:40:39 2004 @@ -182,6 +182,37 @@ Name="VCCLCompilerTool"/> + + + + + + + + + + + + + + + + + + + + Changes in directory llvm/win32/Fibonacci: Fibonacci.vcproj updated: 1.5 -> 1.6 --- Log message: Add lli project to Visual Studio --- Diffs of the changes: (+1 -1) Index: llvm/win32/Fibonacci/Fibonacci.vcproj diff -u llvm/win32/Fibonacci/Fibonacci.vcproj:1.5 llvm/win32/Fibonacci/Fibonacci.vcproj:1.6 --- llvm/win32/Fibonacci/Fibonacci.vcproj:1.5 Sat Dec 18 20:29:00 2004 +++ llvm/win32/Fibonacci/Fibonacci.vcproj Sun Dec 19 00:40:39 2004 @@ -19,7 +19,7 @@ Changes in directory llvm/win32/lli: lli.vcproj added (r1.1) --- Log message: Add lli project to Visual Studio --- Diffs of the changes: (+142 -0) Index: llvm/win32/lli/lli.vcproj diff -c /dev/null llvm/win32/lli/lli.vcproj:1.1 *** /dev/null Sun Dec 19 00:40:49 2004 --- llvm/win32/lli/lli.vcproj Sun Dec 19 00:40:39 2004 *************** *** 0 **** --- 1,142 ---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From jeffc at jolt-lang.org Sun Dec 19 00:40:51 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sun, 19 Dec 2004 00:40:51 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm.sln Message-ID: <200412190640.AAA14909@zion.cs.uiuc.edu> Changes in directory llvm/win32: llvm.sln updated: 1.2 -> 1.3 --- Log message: Add lli project to Visual Studio --- Diffs of the changes: (+25 -1) Index: llvm/win32/llvm.sln diff -u llvm/win32/llvm.sln:1.2 llvm/win32/llvm.sln:1.3 --- llvm/win32/llvm.sln:1.2 Sat Nov 6 11:07:32 2004 +++ llvm/win32/llvm.sln Sun Dec 19 00:40:39 2004 @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Support", "Support\Support.vcproj", "{28AA9146-3482-4F41-9CC6-407B1D258508}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "support", "Support\Support.vcproj", "{28AA9146-3482-4F41-9CC6-407B1D258508}" ProjectSection(ProjectDependencies) = postProject {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection @@ -72,6 +72,22 @@ ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lli", "lli\lli.vcproj", "{FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}" + ProjectSection(ProjectDependencies) = postProject + {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} + {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} + {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}" + ProjectSection(ProjectDependencies) = postProject + {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -126,6 +142,14 @@ {19514E48-456C-4B9D-8637-F2285476461E}.Debug.Build.0 = Configure|Win32 {19514E48-456C-4B9D-8637-F2285476461E}.Release.ActiveCfg = Configure|Win32 {19514E48-456C-4B9D-8637-F2285476461E}.Release.Build.0 = Configure|Win32 + {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Debug.ActiveCfg = Debug|Win32 + {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Debug.Build.0 = Debug|Win32 + {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Release.ActiveCfg = Release|Win32 + {FB6FFD68-C1E4-4DCF-AB02-36D205D5263E}.Release.Build.0 = Release|Win32 + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Debug.ActiveCfg = Debug|Win32 + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Debug.Build.0 = Debug|Win32 + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Release.ActiveCfg = Release|Win32 + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection From llvm at cs.uiuc.edu Sun Dec 19 11:52:38 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sun, 19 Dec 2004 11:52:38 -0600 Subject: [llvm-commits] CVS: llvm/win32/llc/ Message-ID: <200412191752.LAA18216@zion.cs.uiuc.edu> Changes in directory llvm/win32/llc: --- Log message: Directory /var/cvs/llvm/llvm/win32/llc added to the repository --- Diffs of the changes: (+0 -0) From jeffc at jolt-lang.org Sun Dec 19 11:53:58 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sun, 19 Dec 2004 11:53:58 -0600 Subject: [llvm-commits] CVS: llvm/win32/llc/llc.vcproj Message-ID: <200412191753.LAA18252@zion.cs.uiuc.edu> Changes in directory llvm/win32/llc: llc.vcproj added (r1.1) --- Log message: Add llc project to Visual Studio --- Diffs of the changes: (+142 -0) Index: llvm/win32/llc/llc.vcproj diff -c /dev/null llvm/win32/llc/llc.vcproj:1.1 *** /dev/null Sun Dec 19 11:53:57 2004 --- llvm/win32/llc/llc.vcproj Sun Dec 19 11:53:47 2004 *************** *** 0 **** --- 1,142 ---- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From jeffc at jolt-lang.org Sun Dec 19 11:53:58 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sun, 19 Dec 2004 11:53:58 -0600 Subject: [llvm-commits] CVS: llvm/win32/llvm.sln Message-ID: <200412191753.LAA18249@zion.cs.uiuc.edu> Changes in directory llvm/win32: llvm.sln updated: 1.3 -> 1.4 --- Log message: Add llc project to Visual Studio --- Diffs of the changes: (+13 -3) Index: llvm/win32/llvm.sln diff -u llvm/win32/llvm.sln:1.3 llvm/win32/llvm.sln:1.4 --- llvm/win32/llvm.sln:1.3 Sun Dec 19 00:40:39 2004 +++ llvm/win32/llvm.sln Sun Dec 19 11:53:47 2004 @@ -17,11 +17,9 @@ {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} = {059FBAB8-C76D-48A0-AA75-3C57BD3EAFE4} {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} = {08CEB1BB-C2A4-4587-B9A9-AEDB8FB44897} - {C59374C1-9FC0-4147-B836-327DFDC52D99} = {C59374C1-9FC0-4147-B836-327DFDC52D99} {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}" @@ -80,7 +78,6 @@ {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}" @@ -88,6 +85,15 @@ {19514E48-456C-4B9D-8637-F2285476461E} = {19514E48-456C-4B9D-8637-F2285476461E} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "llc", "llc\llc.vcproj", "{ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}" + ProjectSection(ProjectDependencies) = postProject + {28AA9146-3482-4F41-9CC6-407B1D258508} = {28AA9146-3482-4F41-9CC6-407B1D258508} + {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} = {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61} + {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} + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -150,6 +156,10 @@ {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Debug.Build.0 = Debug|Win32 {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Release.ActiveCfg = Release|Win32 {F1EFF064-8869-4DFF-8E1A-CD8F4A5F8D61}.Release.Build.0 = Release|Win32 + {ADE86BDC-B04C-43DF-B9BB-90492C7B14AC}.Debug.ActiveCfg = Debug|Win32 + {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 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection From reid at x10sys.com Sun Dec 19 11:59:44 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 11:59:44 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/SystemUtils.h Message-ID: <200412191759.LAA18392@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: SystemUtils.h updated: 1.15 -> 1.16 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Replace RunProgramWithTimeout with an inline function that calls sys::Program::ExecuteAndWait. This is now just a convenience function. --- Diffs of the changes: (+20 -19) Index: llvm/include/llvm/Support/SystemUtils.h diff -u llvm/include/llvm/Support/SystemUtils.h:1.15 llvm/include/llvm/Support/SystemUtils.h:1.16 --- llvm/include/llvm/Support/SystemUtils.h:1.15 Mon Dec 13 17:40:08 2004 +++ llvm/include/llvm/Support/SystemUtils.h Sun Dec 19 11:59:33 2004 @@ -15,7 +15,7 @@ #ifndef LLVM_SUPPORT_SYSTEMUTILS_H #define LLVM_SUPPORT_SYSTEMUTILS_H -#include "llvm/System/Path.h" +#include "llvm/System/Program.h" namespace llvm { @@ -27,26 +27,27 @@ /// 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 directory, nor /// in the PATH. If the executable cannot be found, return an empty string. -/// +/// @brief Find a named executable. sys::Path FindExecutable(const std::string &ExeName, - const std::string &ProgramPath); + const std::string &ProgramPath); -/// RunProgramWithTimeout - This function executes the specified program, with -/// the specified null-terminated argument array, with the stdin/out/err fd's -/// redirected, with a timeout specified by the last argument. This terminates -/// the calling program if there is an error executing the specified program. -/// It returns the return value of the program, or -1 if a timeout is detected. -/// -int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args, - const std::string &StdInFile = "", - const std::string &StdOutFile = "", - const std::string &StdErrFile = "", - unsigned NumSeconds = 0); - -/// ExecWait - Execute a program with the given arguments and environment and -/// wait for it to terminate. -/// -int ExecWait (const char * const argv[], const char * const envp[]); +/// RunProgramWithTimeout - This function provides an alternate interface to the +/// sys::Program::ExecuteAndWait interface. +/// @see sys:Program::ExecuteAndWait +inline int llvm::RunProgramWithTimeout(const sys::Path &ProgramPath, + const char **Args, + const sys::Path &StdInFile, + const sys::Path &StdOutFile, + const sys::Path &StdErrFile, + unsigned NumSeconds = 0) { + const sys::Path* redirects[3]; + redirects[0] = &StdInFile; + redirects[1] = &StdOutFile; + redirects[2] = &StdErrFile; + + return + sys::Program::ExecuteAndWait(ProgramPath, Args, 0, redirects, NumSeconds); +} } // End llvm namespace From reid at x10sys.com Sun Dec 19 11:59:56 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 11:59:56 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Support/ToolRunner.h Message-ID: <200412191759.LAA18403@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Support: ToolRunner.h updated: 1.16 -> 1.17 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Turn path instance variables into sys::Path instead of std::string --- Diffs of the changes: (+4 -4) Index: llvm/include/llvm/Support/ToolRunner.h diff -u llvm/include/llvm/Support/ToolRunner.h:1.16 llvm/include/llvm/Support/ToolRunner.h:1.17 --- llvm/include/llvm/Support/ToolRunner.h:1.16 Thu Dec 16 17:01:34 2004 +++ llvm/include/llvm/Support/ToolRunner.h Sun Dec 19 11:59:45 2004 @@ -44,8 +44,8 @@ // GCC abstraction // class GCC { - std::string GCCPath; // The path to the gcc executable - GCC(const std::string &gccPath) : GCCPath(gccPath) { } + sys::Path GCCPath; // The path to the gcc executable + GCC(const sys::Path &gccPath) : GCCPath(gccPath) { } public: enum FileType { AsmFile, CFile }; @@ -118,11 +118,11 @@ // CBE Implementation of AbstractIntepreter interface // class CBE : public AbstractInterpreter { - std::string LLCPath; // The path to the `llc' executable + sys::Path LLCPath; // The path to the `llc' executable std::vector ToolArgs; // Extra args to pass to LLC GCC *gcc; public: - CBE(const std::string &llcPath, GCC *Gcc, + CBE(const sys::Path &llcPath, GCC *Gcc, const std::vector *Args) : LLCPath(llcPath), gcc(Gcc) { ToolArgs.clear (); if (Args) { ToolArgs = *Args; } From reid at x10sys.com Sun Dec 19 12:00:08 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 12:00:08 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Program.h Message-ID: <200412191800.MAA18450@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Program.h updated: 1.3 -> 1.4 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Incorporate the abilities of RunPRogramWithTimeout into sys::Program::ExecuteAndWait so that redirection and a timeout are optionally supported. --- Diffs of the changes: (+15 -4) Index: llvm/include/llvm/System/Program.h diff -u llvm/include/llvm/System/Program.h:1.3 llvm/include/llvm/System/Program.h:1.4 --- llvm/include/llvm/System/Program.h:1.3 Mon Dec 13 22:17:12 2004 +++ llvm/include/llvm/System/Program.h Sun Dec 19 11:59:57 2004 @@ -56,15 +56,26 @@ /// @brief Executes the program with the given set of \p args. static int ExecuteAndWait( const Path& path, ///< The path to the program to execute - const std::vector& args, + const char** args, ///< A vector of strings that are passed to the program. - ///< The first element should *not* be the name of the program. - const char ** env = 0 + ///< The first element should be the name of the program. The list + ///< *must* be terminated by a null char* entry. + const char ** env = 0, ///< An optional vector of strings to use for the program's ///< environment. If not provided, the current program's environment ///< will be used. + const sys::Path** redirects = 0, + ///< An optional array of pointers to Paths. If the array is null, + ///< no redirection is done. The array should have a size of at least + ///< three. If the pointer in the array are not null, then the + ///< inferior process's stdin(0), stdout(1), and stderr(2) will be + ///< redirected to the corresponding Paths. + unsigned secondsToWait = 0 + ///< If non-zero, this specifies the amount of time to wait for the + ///< child process to exit. If the time expires, the child is killed + ///< and this call returns. If zero, this function will wait until + ///< the child finishes or forever if it doesn't. ); - /// @} }; } } From reid at x10sys.com Sun Dec 19 12:00:20 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 12:00:20 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/SystemUtils.cpp Message-ID: <200412191800.MAA18464@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SystemUtils.cpp updated: 1.37 -> 1.38 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Remove unneeded header files. * Move RedirectFD static function to lib/System/Unix/Program.cpp * Delete RunProgramWithTimeout, now implemented by sys::Program::ExecuteAndWait. RunProgramWithTimeout is now a convenience func. --- Diffs of the changes: (+5 -115) Index: llvm/lib/Support/SystemUtils.cpp diff -u llvm/lib/Support/SystemUtils.cpp:1.37 llvm/lib/Support/SystemUtils.cpp:1.38 --- llvm/lib/Support/SystemUtils.cpp:1.37 Mon Dec 13 22:18:15 2004 +++ llvm/lib/Support/SystemUtils.cpp Sun Dec 19 12:00:09 2004 @@ -14,14 +14,6 @@ #include "llvm/Support/SystemUtils.h" #include "llvm/System/Program.h" -#include "llvm/Config/fcntl.h" -#include "llvm/Config/sys/wait.h" -#include -#include -#include -#include -#include -#include using namespace llvm; @@ -41,122 +33,20 @@ /// into the same directory, but that directory is neither the current /// directory, nor in the PATH. If the executable cannot be found, return an /// empty string. -/// +/// #undef FindExecutable // needed on windows :( sys::Path llvm::FindExecutable(const std::string &ExeName, - const std::string &ProgramPath) { - // First check the directory that the calling program is in. We can do this + const std::string &ProgramPath) { + // First check the directory that the calling program is in. We can do this // if ProgramPath contains at least one / character, indicating that it is a // relative path to bugpoint itself. - // sys::Path Result ( ProgramPath ); Result.elideFile(); - if (!Result.isEmpty()) { Result.appendFile(ExeName); - if (Result.executable()) return Result; + if (Result.executable()) + return Result; } return sys::Program::FindProgramByName(ExeName); } - -static void RedirectFD(const std::string &File, int FD) { - if (File.empty()) return; // Noop - - // Open the file - int InFD = open(File.c_str(), FD == 0 ? O_RDONLY : O_WRONLY|O_CREAT, 0666); - if (InFD == -1) { - std::cerr << "Error opening file '" << File << "' for " - << (FD == 0 ? "input" : "output") << "!\n"; - exit(1); - } - - dup2(InFD, FD); // Install it as the requested FD - close(InFD); // Close the original FD -} - -static bool Timeout = false; -static void TimeOutHandler(int Sig) { - Timeout = true; -} - -/// RunProgramWithTimeout - This function executes the specified program, with -/// the specified null-terminated argument array, with the stdin/out/err fd's -/// redirected, with a timeout specified by the last argument. This terminates -/// the calling program if there is an error executing the specified program. -/// It returns the return value of the program, or -1 if a timeout is detected. -/// -int llvm::RunProgramWithTimeout(const std::string &ProgramPath, - const char **Args, - const std::string &StdInFile, - const std::string &StdOutFile, - const std::string &StdErrFile, - unsigned NumSeconds) { -#ifdef HAVE_SYS_WAIT_H - int Child = fork(); - switch (Child) { - case -1: - std::cerr << "ERROR forking!\n"; - exit(1); - case 0: // Child - RedirectFD(StdInFile, 0); // Redirect file descriptors... - RedirectFD(StdOutFile, 1); - if (StdOutFile != StdErrFile) - RedirectFD(StdErrFile, 2); - else - dup2(1, 2); - - execv(ProgramPath.c_str(), (char *const *)Args); - std::cerr << "Error executing program: '" << ProgramPath; - for (; *Args; ++Args) - std::cerr << " " << *Args; - std::cerr << "'\n"; - exit(1); - - default: break; - } - - // Make sure all output has been written while waiting - std::cout << std::flush; - - // Install a timeout handler. - Timeout = false; - struct sigaction Act, Old; - Act.sa_sigaction = 0; - Act.sa_handler = TimeOutHandler; - sigemptyset(&Act.sa_mask); - Act.sa_flags = 0; - sigaction(SIGALRM, &Act, &Old); - - // Set the timeout if one is set. - if (NumSeconds) - alarm(NumSeconds); - - int Status; - while (wait(&Status) != Child) - if (errno == EINTR) { - if (Timeout) { - // Kill the child. - kill(Child, SIGKILL); - - if (wait(&Status) != Child) - std::cerr << "Something funny happened waiting for the child!\n"; - - alarm(0); - sigaction(SIGALRM, &Old, 0); - return -1; // Timeout detected - } else { - std::cerr << "Error waiting for child process!\n"; - exit(1); - } - } - - alarm(0); - sigaction(SIGALRM, &Old, 0); - return Status; - -#else - std::cerr << "RunProgramWithTimeout not implemented on this platform!\n"; - return -1; -#endif -} From reid at x10sys.com Sun Dec 19 12:00:32 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 12:00:32 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/ToolRunner.cpp Message-ID: <200412191800.MAA18475@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: ToolRunner.cpp updated: 1.36 -> 1.37 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Pass sys::Path instead of std::string for paths * Correct the types of arguments passed to RunProgramWithTimeout due to its interface using sys::Path instead of std::string * Replace "/dev/null" (not portable) with empty string which sys::Program::ExecuteAndWait recognizes as "redirect to bit bucket" --- Diffs of the changes: (+27 -24) Index: llvm/lib/Support/ToolRunner.cpp diff -u llvm/lib/Support/ToolRunner.cpp:1.36 llvm/lib/Support/ToolRunner.cpp:1.37 --- llvm/lib/Support/ToolRunner.cpp:1.36 Thu Dec 16 17:01:34 2004 +++ llvm/lib/Support/ToolRunner.cpp Sun Dec 19 12:00:21 2004 @@ -22,7 +22,7 @@ ToolExecutionError::~ToolExecutionError() throw() { } -static void ProcessFailure(std::string ProgPath, const char** Args) { +static void ProcessFailure(sys::Path ProgPath, const char** Args) { std::ostringstream OS; OS << "\nError running tool:\n "; for (const char **Arg = Args; *Arg; ++Arg) @@ -32,8 +32,8 @@ // Rerun the compiler, capturing any error messages to print them. sys::Path ErrorFilename("error_messages"); ErrorFilename.makeUnique(); - RunProgramWithTimeout(ProgPath, Args, "/dev/null", ErrorFilename.c_str(), - ErrorFilename.c_str()); + RunProgramWithTimeout(ProgPath, Args, sys::Path(""), ErrorFilename, + ErrorFilename); // Print out the error messages generated by GCC if possible... std::ifstream ErrorFile(ErrorFilename.c_str()); @@ -102,8 +102,9 @@ std::cerr << " " << LLIArgs[i]; std::cerr << "\n"; ); - return RunProgramWithTimeout(LLIPath, &LLIArgs[0], - InputFile, OutputFile, OutputFile, Timeout); + return RunProgramWithTimeout(sys::Path(LLIPath), &LLIArgs[0], + sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), + Timeout); } // LLI create method - Try to find the LLI executable @@ -146,9 +147,9 @@ std::cerr << " " << LLCArgs[i]; std::cerr << "\n"; ); - if (RunProgramWithTimeout(LLCPath, &LLCArgs[0], "/dev/null", "/dev/null", - "/dev/null")) - ProcessFailure(LLCPath, &LLCArgs[0]); + if (RunProgramWithTimeout(sys::Path(LLCPath), &LLCArgs[0], + sys::Path(), sys::Path(), sys::Path())) + ProcessFailure(sys::Path(LLCPath), &LLCArgs[0]); } void LLC::compileProgram(const std::string &Bytecode) { @@ -248,8 +249,9 @@ std::cerr << "\n"; ); DEBUG(std::cerr << "\nSending output to " << OutputFile << "\n"); - return RunProgramWithTimeout(LLIPath, &JITArgs[0], - InputFile, OutputFile, OutputFile, Timeout); + return RunProgramWithTimeout(sys::Path(LLIPath), &JITArgs[0], + sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), + Timeout); } /// createJIT - Try to find the LLI executable @@ -290,8 +292,8 @@ std::cerr << " " << LLCArgs[i]; std::cerr << "\n"; ); - if (RunProgramWithTimeout(LLCPath, &LLCArgs[0], "/dev/null", "/dev/null", - "/dev/null")) + if (RunProgramWithTimeout(LLCPath, &LLCArgs[0], sys::Path(), sys::Path(), + sys::Path())) ProcessFailure(LLCPath, &LLCArgs[0]); } @@ -321,14 +323,14 @@ CBE *AbstractInterpreter::createCBE(const std::string &ProgramPath, std::string &Message, const std::vector *Args) { - std::string LLCPath = FindExecutable("llc", ProgramPath).toString(); - if (LLCPath.empty()) { + sys::Path LLCPath = FindExecutable("llc", ProgramPath); + if (LLCPath.isEmpty()) { Message = "Cannot find `llc' in executable directory or PATH!\n"; return 0; } - Message = "Found llc: " + LLCPath + "\n"; + Message = "Found llc: " + LLCPath.toString() + "\n"; GCC *gcc = GCC::create(ProgramPath, Message); if (!gcc) { std::cerr << Message << "\n"; @@ -376,8 +378,8 @@ GCCArgs.push_back(0); // NULL terminator std::cout << "" << std::flush; - if (RunProgramWithTimeout(GCCPath, &GCCArgs[0], "/dev/null", "/dev/null", - "/dev/null")) { + if (RunProgramWithTimeout(GCCPath, &GCCArgs[0], sys::Path(), sys::Path(), + sys::Path())) { ProcessFailure(GCCPath, &GCCArgs[0]); exit(1); } @@ -398,8 +400,9 @@ ); FileRemover OutputBinaryRemover(OutputBinary); - return RunProgramWithTimeout(OutputBinary.toString(), &ProgramArgs[0], - InputFile, OutputFile, OutputFile, Timeout); + return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], + sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), + Timeout); } int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, @@ -431,8 +434,8 @@ }; std::cout << "" << std::flush; - if (RunProgramWithTimeout(GCCPath, GCCArgs, "/dev/null", "/dev/null", - "/dev/null")) { + if (RunProgramWithTimeout(GCCPath, GCCArgs, sys::Path(), sys::Path(), + sys::Path())) { ProcessFailure(GCCPath, GCCArgs); return 1; } @@ -442,12 +445,12 @@ /// create - Try to find the `gcc' executable /// GCC *GCC::create(const std::string &ProgramPath, std::string &Message) { - std::string GCCPath = FindExecutable("gcc", ProgramPath).toString(); - if (GCCPath.empty()) { + sys::Path GCCPath = FindExecutable("gcc", ProgramPath); + if (GCCPath.isEmpty()) { Message = "Cannot find `gcc' in executable directory or PATH!\n"; return 0; } - Message = "Found gcc: " + GCCPath + "\n"; + Message = "Found gcc: " + GCCPath.toString() + "\n"; return new GCC(GCCPath); } From reid at x10sys.com Sun Dec 19 12:00:43 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 12:00:43 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/DynamicLibrary.cpp Message-ID: <200412191800.MAA18488@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: DynamicLibrary.cpp updated: 1.2 -> 1.3 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Add a needed include. --- Diffs of the changes: (+1 -0) Index: llvm/lib/System/Unix/DynamicLibrary.cpp diff -u llvm/lib/System/Unix/DynamicLibrary.cpp:1.2 llvm/lib/System/Unix/DynamicLibrary.cpp:1.3 --- llvm/lib/System/Unix/DynamicLibrary.cpp:1.2 Mon Nov 29 04:39:46 2004 +++ llvm/lib/System/Unix/DynamicLibrary.cpp Sun Dec 19 12:00:32 2004 @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "Unix.h" +#include "sys/stat.h" namespace llvm { using namespace sys; From reid at x10sys.com Sun Dec 19 12:00:55 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 12:00:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Program.cpp Message-ID: <200412191800.MAA18499@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Program.cpp updated: 1.7 -> 1.8 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : Move the functionality of RunProgramWithTimeout into the ExecuteAndWait function: support a timeout and I/O redirects --- Diffs of the changes: (+99 -22) Index: llvm/lib/System/Unix/Program.cpp diff -u llvm/lib/System/Unix/Program.cpp:1.7 llvm/lib/System/Unix/Program.cpp:1.8 --- llvm/lib/System/Unix/Program.cpp:1.7 Mon Dec 13 22:18:51 2004 +++ llvm/lib/System/Unix/Program.cpp Sun Dec 19 12:00:44 2004 @@ -23,6 +23,7 @@ #ifdef HAVE_SYS_WAIT_H #include #endif +#include extern char** environ; @@ -76,27 +77,39 @@ return Path(); } -// +static void RedirectFD(const std::string &File, int FD) { + if (File.empty()) return; // Noop + + // Open the file + int InFD = open(File.c_str(), FD == 0 ? O_RDONLY : O_WRONLY|O_CREAT, 0666); + if (InFD == -1) { + ThrowErrno("Cannot open file '" + File + "' for " + + (FD == 0 ? "input" : "output") + "!\n"); + } + + dup2(InFD, FD); // Install it as the requested FD + close(InFD); // Close the original FD +} + +static bool Timeout = false; +static void TimeOutHandler(int Sig) { + Timeout = true; +} + int Program::ExecuteAndWait(const Path& path, - const std::vector& args, - const char ** envp ) { + const char** args, + const char** envp, + const Path** redirects, + unsigned secondsToWait +) { if (!path.executable()) throw path.toString() + " is not executable"; #ifdef HAVE_SYS_WAIT_H - // Create local versions of the parameters that can be passed into execve() - // without creating const problems. - const char* argv[ args.size() + 2 ]; - unsigned index = 0; - std::string progname(path.getLast()); - argv[index++] = progname.c_str(); - for (unsigned i = 0; i < args.size(); i++) - argv[index++] = args[i].c_str(); - argv[index] = 0; - // Create a child process. - switch (fork()) { + int child = fork(); + switch (child) { // An error occured: Return to the caller. case -1: ThrowErrno(std::string("Couldn't execute program '") + path.toString() + @@ -105,10 +118,36 @@ // Child process: Execute the program. case 0: { + // Redirect file descriptors... + if (redirects) { + if (redirects[0]) + if (redirects[0]->isEmpty()) + RedirectFD("/dev/null",0); + else + RedirectFD(redirects[0]->toString(), 0); + if (redirects[1]) + if (redirects[1]->isEmpty()) + RedirectFD("/dev/null",1); + else + RedirectFD(redirects[1]->toString(), 1); + if (redirects[1] && redirects[2] && + *(redirects[1]) != *(redirects[2])) { + if (redirects[2]->isEmpty()) + RedirectFD("/dev/null",2); + else + RedirectFD(redirects[2]->toString(), 2); + } else { + dup2(1, 2); + } + } + + // Set up the environment char** env = environ; if (envp != 0) env = (char**) envp; - execve (path.c_str(), (char** const)argv, env); + + // Execute! + execve (path.c_str(), (char** const)args, env); // If the execve() failed, we should exit and let the parent pick up // our non-zero exit status. exit (errno); @@ -119,11 +158,50 @@ break; } + // Make sure stderr and stdout have been flushed + std::cerr << std::flush; + std::cout << std::flush; + fsync(1); + fsync(2); + + struct sigaction Act, Old; + + // Install a timeout handler. + if (secondsToWait) { + Timeout = false; + Act.sa_sigaction = 0; + Act.sa_handler = TimeOutHandler; + sigemptyset(&Act.sa_mask); + Act.sa_flags = 0; + sigaction(SIGALRM, &Act, &Old); + alarm(secondsToWait); + } + // Parent process: Wait for the child process to terminate. int status; - if ((::wait (&status)) == -1) - ThrowErrno(std::string("Failed waiting for program '") + path.toString() - + "'"); + while (wait(&status) != child) + if (secondsToWait && errno == EINTR) { + // Kill the child. + kill(child, SIGKILL); + + // Turn off the alarm and restore the signal handler + alarm(0); + sigaction(SIGALRM, &Old, 0); + + // Wait for child to die + if (wait(&status) != child) + ThrowErrno("Child timedout but wouldn't die"); + + return -1; // Timeout detected + } else { + ThrowErrno("Error waiting for child process"); + } + + // We exited normally without timeout, so turn off the timer. + if (secondsToWait) { + alarm(0); + sigaction(SIGALRM, &Old, 0); + } // If the program exited normally with a zero exit status, return success! if (WIFEXITED (status)) @@ -131,13 +209,12 @@ else if (WIFSIGNALED(status)) throw std::string("Program '") + path.toString() + "' received terminating signal."; - else - return 0; #else - throw std::string("Program::ExecuteAndWait not implemented on this platform!\n"); + throw std::string( + "Program::ExecuteAndWait not implemented on this platform!\n"); #endif - + return 0; } } From reid at x10sys.com Sun Dec 19 12:01:07 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 12:01:07 -0600 Subject: [llvm-commits] CVS: llvm/tools/gccld/GenerateCode.cpp Message-ID: <200412191801.MAA18529@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccld: GenerateCode.cpp updated: 1.41 -> 1.42 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Support changes in sys::Program::ExecuteAndWait interface --- Diffs of the changes: (+16 -14) Index: llvm/tools/gccld/GenerateCode.cpp diff -u llvm/tools/gccld/GenerateCode.cpp:1.41 llvm/tools/gccld/GenerateCode.cpp:1.42 --- llvm/tools/gccld/GenerateCode.cpp:1.41 Mon Dec 13 22:20:07 2004 +++ llvm/tools/gccld/GenerateCode.cpp Sun Dec 19 12:00:56 2004 @@ -242,13 +242,13 @@ const std::string &InputFilename, const sys::Path &llc) { // Run LLC to convert the bytecode file into assembly code. - std::vector args; + std::vector args; args.push_back("-f"); args.push_back("-o"); - args.push_back(OutputFilename); - args.push_back(InputFilename); + args.push_back(OutputFilename.c_str()); + args.push_back(InputFilename.c_str()); - return sys::Program::ExecuteAndWait(llc, args); + return sys::Program::ExecuteAndWait(llc, &args[0]); } /// GenerateAssembly - generates a native assembly language source file from the @@ -257,13 +257,13 @@ const std::string &InputFile, const sys::Path &llc ) { // Run LLC to convert the bytecode file into C. - std::vector args; + std::vector args; args.push_back("-march=c"); args.push_back("-f"); args.push_back("-o"); - args.push_back(OutputFile); - args.push_back(InputFile); - return sys::Program::ExecuteAndWait(llc, args); + args.push_back(OutputFile.c_str()); + args.push_back(InputFile.c_str()); + return sys::Program::ExecuteAndWait(llc, &args[0]); } /// GenerateNative - generates a native assembly language source file from the @@ -308,20 +308,22 @@ // We can't just assemble and link the file with the system assembler // and linker because we don't know where to put the _start symbol. // GCC mysteriously knows how to do it. - std::vector args; + std::vector args; args.push_back("-fno-strict-aliasing"); args.push_back("-O3"); args.push_back("-o"); - args.push_back(OutputFilename); - args.push_back(InputFilename); + args.push_back(OutputFilename.c_str()); + args.push_back(InputFilename.c_str()); // Add in the libraries to link. for (unsigned index = 0; index < Libraries.size(); index++) { - if (Libraries[index] != "crtend") - args.push_back("-l" + Libraries[index]); + if (Libraries[index] != "crtend") { + args.push_back("-l"); + args.push_back(Libraries[index].c_str()); + } } // Run the compiler to assembly and link together the program. - return sys::Program::ExecuteAndWait(gcc, args, (const char**)clean_env); + return sys::Program::ExecuteAndWait(gcc, &args[0], (const char**)clean_env); } From reid at x10sys.com Sun Dec 19 12:01:08 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 12:01:08 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp Message-ID: <200412191801.MAA18532@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ld: llvm-ld.cpp updated: 1.15 -> 1.16 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Support changes in sys::Program::ExecuteAndWait interface --- Diffs of the changes: (+16 -14) Index: llvm/tools/llvm-ld/llvm-ld.cpp diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.15 llvm/tools/llvm-ld/llvm-ld.cpp:1.16 --- llvm/tools/llvm-ld/llvm-ld.cpp:1.15 Sat Dec 18 00:54:21 2004 +++ llvm/tools/llvm-ld/llvm-ld.cpp Sun Dec 19 12:00:56 2004 @@ -218,13 +218,13 @@ const std::string &InputFilename, const sys::Path &llc) { // Run LLC to convert the bytecode file into assembly code. - std::vector args; + std::vector args; args.push_back( "-f"); args.push_back( "-o"); - args.push_back( OutputFilename); - args.push_back( InputFilename); + args.push_back( OutputFilename.c_str() ); + args.push_back( InputFilename.c_str() ); - return sys::Program::ExecuteAndWait(llc,args); + return sys::Program::ExecuteAndWait(llc,&args[0]); } /// GenerateAssembly - generates a native assembly language source file from the @@ -233,13 +233,13 @@ const std::string &InputFile, const sys::Path &llc) { // Run LLC to convert the bytecode file into C. - std::vector args; + std::vector args; args.push_back( "-march=c"); args.push_back( "-f"); args.push_back( "-o"); - args.push_back( OutputFile); - args.push_back( InputFile); - return sys::Program::ExecuteAndWait(llc, args); + args.push_back( OutputFile.c_str() ); + args.push_back( InputFile.c_str() ); + return sys::Program::ExecuteAndWait(llc, &args[0]); } /// GenerateNative - generates a native assembly language source file from the @@ -285,20 +285,22 @@ // We can't just assemble and link the file with the system assembler // and linker because we don't know where to put the _start symbol. // GCC mysteriously knows how to do it. - std::vector args; + std::vector args; args.push_back("-fno-strict-aliasing"); args.push_back("-O3"); args.push_back("-o"); - args.push_back(OutputFilename); - args.push_back(InputFilename); + args.push_back(OutputFilename.c_str()); + args.push_back(InputFilename.c_str()); // Add in the libraries to link. for (unsigned index = 0; index < Libraries.size(); index++) - if (Libraries[index] != "crtend") - args.push_back("-l" + Libraries[index]); + if (Libraries[index] != "crtend") { + args.push_back("-l"); + args.push_back(Libraries[index].c_str()); + } // Run the compiler to assembly and link together the program. - return sys::Program::ExecuteAndWait(gcc, args, (const char**)clean_env); + return sys::Program::ExecuteAndWait(gcc, &args[0], (const char**)clean_env); } /// EmitShellScript - Output the wrapper file that invokes the JIT on the LLVM From reid at x10sys.com Sun Dec 19 12:01:08 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 12:01:08 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.cpp CompilerDriver.h Message-ID: <200412191801.MAA18537@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: CompilerDriver.cpp updated: 1.22 -> 1.23 CompilerDriver.h updated: 1.15 -> 1.16 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Support changes in sys::Program::ExecuteAndWait interface --- Diffs of the changes: (+16 -11) Index: llvm/tools/llvmc/CompilerDriver.cpp diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.22 llvm/tools/llvmc/CompilerDriver.cpp:1.23 --- llvm/tools/llvmc/CompilerDriver.cpp:1.22 Mon Dec 13 02:53:36 2004 +++ llvm/tools/llvmc/CompilerDriver.cpp Sun Dec 19 12:00:56 2004 @@ -28,9 +28,9 @@ void WriteAction(CompilerDriver::Action* action ) { std::cerr << action->program.c_str(); - std::vector::iterator I = action->args.begin(); + std::vector::const_iterator I = action->args.begin(); while (I != action->args.end()) { - std::cerr << " " + *I; + std::cerr << " " << *I; ++I; } std::cerr << "\n"; @@ -38,9 +38,9 @@ void DumpAction(CompilerDriver::Action* action) { std::cerr << "command = " << action->program.c_str(); - std::vector::iterator I = action->args.begin(); + std::vector::const_iterator I = action->args.begin(); while (I != action->args.end()) { - std::cerr << " " + *I; + std::cerr << " " << *I; ++I; } std::cerr << "\n"; @@ -392,18 +392,23 @@ "' is not executable."); // Invoke the program + const char** Args = (const char**) + alloca(sizeof(const char*)*action->args.size()); + for (unsigned i = 0; i != action->args.size(); ++i) { + Args[i] = action->args[i].c_str(); + } if (isSet(TIME_ACTIONS_FLAG)) { Timer timer(action->program.toString()); timer.startTimer(); int resultCode = - sys::Program::ExecuteAndWait(action->program,action->args); + sys::Program::ExecuteAndWait(action->program,Args); timer.stopTimer(); timer.print(timer,std::cerr); return resultCode == 0; } else return 0 == - sys::Program::ExecuteAndWait(action->program, action->args); + sys::Program::ExecuteAndWait(action->program, Args); } return true; } @@ -560,7 +565,7 @@ /// PRE-PROCESSING / TRANSLATION / OPTIMIZATION / ASSEMBLY phases // for each input item SetVector LinkageItems; - std::vector LibFiles; + StringVector LibFiles; InputList::const_iterator I = InpList.begin(); for (InputList::const_iterator I = InpList.begin(), E = InpList.end(); I != E; ++I ) { @@ -817,7 +822,7 @@ link->args.push_back(I->toString()); // Add in all the libraries we found. - for (std::vector::const_iterator I=LibFiles.begin(), + for (StringVector::const_iterator I=LibFiles.begin(), E=LibFiles.end(); I != E; ++I ) link->args.push_back(std::string("-l")+*I); Index: llvm/tools/llvmc/CompilerDriver.h diff -u llvm/tools/llvmc/CompilerDriver.h:1.15 llvm/tools/llvmc/CompilerDriver.h:1.16 --- llvm/tools/llvmc/CompilerDriver.h:1.15 Tue Nov 23 17:40:06 2004 +++ llvm/tools/llvmc/CompilerDriver.h Sun Dec 19 12:00:56 2004 @@ -81,9 +81,9 @@ /// language. struct Action { Action() : flags(0) {} - sys::Path program; ///< The program to execve - StringVector args; ///< Arguments to the program - unsigned flags; ///< Action specific flags + sys::Path program; ///< The program to execve + StringVector args; ///< Arguments to the program + unsigned flags; ///< Action specific flags void set(unsigned fl ) { flags |= fl; } void clear(unsigned fl) { flags &= (FLAGS_MASK ^ fl); } bool isSet(unsigned fl) { return (flags&fl) != 0; } From gaeke at cs.uiuc.edu Sun Dec 19 12:58:29 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Sun, 19 Dec 2004 12:58:29 -0600 (CST) Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Program.cpp Message-ID: <200412191858.MAA03022@kain.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Program.cpp updated: 1.8 -> 1.9 --- Log message: Make references to 'struct sigaction' compile under Solaris. --- Diffs of the changes: (+1 -0) Index: llvm/lib/System/Unix/Program.cpp diff -u llvm/lib/System/Unix/Program.cpp:1.8 llvm/lib/System/Unix/Program.cpp:1.9 --- llvm/lib/System/Unix/Program.cpp:1.8 Sun Dec 19 12:00:44 2004 +++ llvm/lib/System/Unix/Program.cpp Sun Dec 19 12:58:11 2004 @@ -19,6 +19,7 @@ #include #include "Unix.h" #include +#include #include #ifdef HAVE_SYS_WAIT_H #include From brukman at cs.uiuc.edu Sun Dec 19 13:27:22 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Sun, 19 Dec 2004 13:27:22 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/DynamicLibrary.cpp Message-ID: <200412191927.NAA20205@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: DynamicLibrary.cpp updated: 1.3 -> 1.4 --- Log message: Use <> for system #include files --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/Unix/DynamicLibrary.cpp diff -u llvm/lib/System/Unix/DynamicLibrary.cpp:1.3 llvm/lib/System/Unix/DynamicLibrary.cpp:1.4 --- llvm/lib/System/Unix/DynamicLibrary.cpp:1.3 Sun Dec 19 12:00:32 2004 +++ llvm/lib/System/Unix/DynamicLibrary.cpp Sun Dec 19 13:27:11 2004 @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// #include "Unix.h" -#include "sys/stat.h" +#include namespace llvm { using namespace sys; From gaeke at cs.uiuc.edu Sun Dec 19 15:08:25 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Sun, 19 Dec 2004 15:08:25 -0600 (CST) Subject: [llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.cpp Message-ID: <200412192108.PAA02860@kain.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: CompilerDriver.cpp updated: 1.23 -> 1.24 --- Log message: Make this compile on Solaris. --- Diffs of the changes: (+1 -0) Index: llvm/tools/llvmc/CompilerDriver.cpp diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.23 llvm/tools/llvmc/CompilerDriver.cpp:1.24 --- llvm/tools/llvmc/CompilerDriver.cpp:1.23 Sun Dec 19 12:00:56 2004 +++ llvm/tools/llvmc/CompilerDriver.cpp Sun Dec 19 15:08:07 2004 @@ -21,6 +21,7 @@ #include "llvm/ADT/SetVector.h" #include "llvm/ADT/StringExtras.h" #include +#include using namespace llvm; From brukman at cs.uiuc.edu Sun Dec 19 18:16:49 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Sun, 19 Dec 2004 18:16:49 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Path.cpp Message-ID: <200412200016.SAA15037@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Path.cpp updated: 1.25 -> 1.26 --- Log message: * Use "" for LLVM include files, not <> * llvm/Config/alloca.h already #includes config.h * Minor readability/stylistic changes --- Diffs of the changes: (+3 -5) Index: llvm/lib/System/Unix/Path.cpp diff -u llvm/lib/System/Unix/Path.cpp:1.25 llvm/lib/System/Unix/Path.cpp:1.26 --- llvm/lib/System/Unix/Path.cpp:1.25 Wed Dec 15 17:02:10 2004 +++ llvm/lib/System/Unix/Path.cpp Sun Dec 19 18:16:38 2004 @@ -16,8 +16,7 @@ //=== is guaranteed to work on *all* UNIX variants. //===----------------------------------------------------------------------===// -#include -#include +#include "llvm/Config/alloca.h" #include "Unix.h" #include #include @@ -27,9 +26,7 @@ namespace llvm { using namespace sys; -Path::Path(const std::string& unverified_path) - : path(unverified_path) -{ +Path::Path(const std::string& unverified_path) : path(unverified_path) { if (unverified_path.empty()) return; if (this->isValid()) @@ -64,6 +61,7 @@ Paths.push_back(tmpPath); } + void Path::GetSystemLibraryPaths(std::vector& Paths) { #ifdef LTDL_SHLIBPATH_VAR From reid at x10sys.com Sun Dec 19 18:58:25 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 18:58:25 -0600 Subject: [llvm-commits] CVS: llvm/autoconf/configure.ac Message-ID: <200412200058.SAA16153@zion.cs.uiuc.edu> Changes in directory llvm/autoconf: configure.ac updated: 1.145 -> 1.146 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Add checks for sbrk and getpagesize functions * Alphebetize the checks for functions --- Diffs of the changes: (+3 -2) Index: llvm/autoconf/configure.ac diff -u llvm/autoconf/configure.ac:1.145 llvm/autoconf/configure.ac:1.146 --- llvm/autoconf/configure.ac:1.145 Thu Dec 16 11:48:14 2004 +++ llvm/autoconf/configure.ac Sun Dec 19 18:58:14 2004 @@ -411,8 +411,9 @@ dnl=== dnl===-----------------------------------------------------------------------=== -AC_CHECK_FUNCS([backtrace getcwd gettimeofday isatty getrusage mkstemp mktemp]) -AC_CHECK_FUNCS([mkdtemp realpath strdup strtoq strtoll]) +AC_CHECK_FUNCS([backtrace getcwd getpagesize getrusage gettimeofday isatty ]) +AC_CHECK_FUNCS([mkdtemp mkstemp mktemp ]) +AC_CHECK_FUNCS([realpath strdup strtoq strtoll sysconf ]) AC_C_PRINTF_A AC_FUNC_ALLOCA AC_FUNC_RAND48 From llvm at cs.uiuc.edu Sun Dec 19 18:58:40 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sun, 19 Dec 2004 18:58:40 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/sys/mman.h resource.h stat.h time.h types.h wait.h Message-ID: <200412200058.SAA16176@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config/sys: mman.h (r1.5) removed resource.h (r1.6) removed stat.h (r1.6) removed time.h (r1.6) removed types.h (r1.5) removed wait.h (r1.5) removed --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : This file is no longer needed as system dependent functions have been encapsulated into lib/System. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Sun Dec 19 18:58:52 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 18:58:52 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Memory.h Message-ID: <200412200058.SAA16189@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Memory.h updated: 1.2 -> 1.3 --- Log message: Wrap long lines --- Diffs of the changes: (+3 -2) Index: llvm/include/llvm/System/Memory.h diff -u llvm/include/llvm/System/Memory.h:1.2 llvm/include/llvm/System/Memory.h:1.3 --- llvm/include/llvm/System/Memory.h:1.2 Mon Sep 13 17:38:12 2004 +++ llvm/include/llvm/System/Memory.h Sun Dec 19 18:58:41 2004 @@ -48,11 +48,12 @@ static MemoryBlock AllocateRWX(unsigned NumBytes); /// This method releases a block of Read/Write/Execute memory that was - /// allocated with the AllocateRWX method. It should not be used to release - /// any memory block allocated any other way. + /// allocated with the AllocateRWX method. It should not be used to + /// release any memory block allocated any other way. /// @throws std::string if an error occurred. /// @brief Release Read/Write/Execute memory. static void ReleaseRWX(MemoryBlock& block); + /// @} }; } From reid at x10sys.com Sun Dec 19 18:59:04 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 18:59:04 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/System/Process.h Message-ID: <200412200059.SAA16202@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/System: Process.h updated: 1.1 -> 1.2 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Add GetMallocUsage as a wrapper around mallinfo() * Add GetTotalMemoryUsage to get approximate RSS size * Add GetTimeUsage to get elapsed/system/user time --- Diffs of the changes: (+31 -0) Index: llvm/include/llvm/System/Process.h diff -u llvm/include/llvm/System/Process.h:1.1 llvm/include/llvm/System/Process.h:1.2 --- llvm/include/llvm/System/Process.h:1.1 Fri Sep 10 23:18:05 2004 +++ llvm/include/llvm/System/Process.h Sun Dec 19 18:58:53 2004 @@ -14,6 +14,8 @@ #ifndef LLVM_SYSTEM_PROCESS_H #define LLVM_SYSTEM_PROCESS_H +#include "llvm/System/TimeValue.h" + namespace llvm { namespace sys { @@ -32,6 +34,35 @@ /// @brief Get the virtual memory page size static unsigned GetPageSize(); + /// This static function will return the total amount of memory allocated + /// by the process. This only counts the memory allocated via the malloc, + /// calloc and realloc functions and includes any "free" holes in the + /// allocated space. + /// @throws nothing + /// @brief Return process memory usage. + static uint64_t GetMallocUsage(); + + /// This static function will return the total memory usage of the + /// process. This includes code, data, stack and mapped pages usage. Notei + /// that the value returned here is not necessarily the Running Set Size, + /// it is the total virtual memory usage, regardless of mapped state of + /// that memory. + static uint64_t GetTotalMemoryUsage(); + + /// This static function will set \p user_time to the amount of CPU time + /// spent in user (non-kernel) mode and \p sys_time to the amount of CPU + /// time spent in system (kernel) mode. If the operating system does not + /// support collection of these metrics, a zero TimeValue will be for both + /// values. + static void GetTimeUsage( + TimeValue& elapsed, + ///< Returns the TimeValue::now() giving current time + TimeValue& user_time, + ///< Returns the current amount of user time for the process + TimeValue& sys_time + ///< Returns the current amount of system time for the process + ); + /// @} }; } From reid at x10sys.com Sun Dec 19 18:59:15 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 18:59:15 -0600 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200412200059.SAA16221@zion.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.154 -> 1.155 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Add checks for sbrk and getpagesize functions * Alphebetize the checks for functions --- Diffs of the changes: (+105 -2) Index: llvm/configure diff -u llvm/configure:1.154 llvm/configure:1.155 --- llvm/configure:1.154 Thu Dec 16 11:48:14 2004 +++ llvm/configure Sun Dec 19 18:59:04 2004 @@ -26697,8 +26697,111 @@ +for ac_func in backtrace getcwd getpagesize getrusage gettimeofday isatty +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 backtrace getcwd gettimeofday isatty getrusage mkstemp mktemp +for ac_func in mkdtemp mkstemp mktemp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -26804,7 +26907,7 @@ -for ac_func in mkdtemp realpath strdup strtoq strtoll +for ac_func in realpath strdup strtoq strtoll sysconf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 From reid at x10sys.com Sun Dec 19 18:59:27 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 18:59:27 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Linux/Process.cpp Message-ID: <200412200059.SAA16235@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Linux: Process.cpp updated: 1.1 -> 1.2 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : No need for Unix/SUS/Process.cpp any more, just ifdef it. --- Diffs of the changes: (+1 -1) Index: llvm/lib/System/Linux/Process.cpp diff -u llvm/lib/System/Linux/Process.cpp:1.1 llvm/lib/System/Linux/Process.cpp:1.2 --- llvm/lib/System/Linux/Process.cpp:1.1 Fri Sep 10 23:59:30 2004 +++ llvm/lib/System/Linux/Process.cpp Sun Dec 19 18:59:16 2004 @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// // Include the generic Unix implementation -#include "../Unix/SUS/Process.cpp" +#include "../Unix/Process.cpp" //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only Linux specific code From reid at x10sys.com Sun Dec 19 18:59:39 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 18:59:39 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Unix/Process.cpp Message-ID: <200412200059.SAA16251@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Unix: Process.cpp updated: 1.1 -> 1.2 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Implement GetMallocUsage to get usage of malloc heap * Implement GetMemoryUsage to get total memory usage of process * Implement GetTimeUsage to get elapsed/user/system time --- Diffs of the changes: (+78 -6) Index: llvm/lib/System/Unix/Process.cpp diff -u llvm/lib/System/Unix/Process.cpp:1.1 llvm/lib/System/Unix/Process.cpp:1.2 --- llvm/lib/System/Unix/Process.cpp:1.1 Fri Sep 10 23:56:56 2004 +++ llvm/lib/System/Unix/Process.cpp Sun Dec 19 18:59:28 2004 @@ -11,7 +11,16 @@ // //===----------------------------------------------------------------------===// -#include +#include "Unix.h" +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_RESOURCE_H +#include +#endif +#ifdef HAVE_MALLOC_H +#include +#endif //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only generic UNIX code that @@ -22,13 +31,76 @@ using namespace sys; unsigned -Process::GetPageSize() { - // NOTE: The getpagesize function doesn't exist in POSIX 1003.1 and is - // "deprecated" in SUSv2. Platforms including this implementation should - // consider sysconf(_SC_PAGE_SIZE) if its available. - static const int page_size = getpagesize(); +Process::GetPageSize() +{ +#if defined(HAVE_GETPAGESIZE) + static const int page_size = ::getpagesize(); +#elif defined(HAVE_SYSCONF) + static long page_size = ::sysconf(_SC_PAGE_SIZE); +#else +#warning Cannot get the page size on this machine +#endif return static_cast(page_size); } +#if defined(HAVE_SBRK) +static char* som = reinterpret_cast(::sbrk(0)); +#endif + +uint64_t +Process::GetMallocUsage() +{ +#ifdef HAVE_MALLINFO + struct mallinfo mi; + mi = ::mallinfo(); + return mi.uordblks; +#elif HAVE_SBRK + // Note this is only an approximation and more closely resembles + // the value returned by mallinfo in the arena field. + char * eom = sbrk(0); + if (eom != ((char*)-1) && som != ((char*)-1)) + return eom - som; + else + return 0; +#else +#warning Cannot get malloc info on this platform + return 0; +#endif +} + +uint64_t +Process::GetTotalMemoryUsage() +{ +#ifdef HAVE_MALLINFO + struct mallinfo mi = ::mallinfo(); + return mi.uordblks + mi.hblkhd; +#else +#warning Cannot get total memory size on this platform + return 0; +#endif +} + +void +Process::GetTimeUsage(TimeValue& elapsed, TimeValue& user_time, + TimeValue& sys_time) +{ + elapsed = TimeValue::now(); +#ifdef HAVE_GETRUSAGE + struct rusage usage; + ::getrusage(RUSAGE_SELF, &usage); + user_time.seconds( usage.ru_utime.tv_sec ); + user_time.microseconds( usage.ru_utime.tv_usec ); + sys_time.seconds( usage.ru_stime.tv_sec ); + sys_time.microseconds( usage.ru_stime.tv_usec ); +#else +#warning Cannot get usage times on this platform + user_time.seconds(0); + user_time.microseconds(0); + sys_time.seconds(0); + sys_time.microseconds(0); +#endif +} + + } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Sun Dec 19 18:59:39 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 18:59:39 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Process.cpp Message-ID: <200412200059.SAA16254@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Process.cpp updated: 1.2 -> 1.3 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Implement GetMallocUsage to get usage of malloc heap * Implement GetMemoryUsage to get total memory usage of process * Implement GetTimeUsage to get elapsed/user/system time --- Diffs of the changes: (+43 -0) Index: llvm/lib/System/Win32/Process.cpp diff -u llvm/lib/System/Win32/Process.cpp:1.2 llvm/lib/System/Win32/Process.cpp:1.3 --- llvm/lib/System/Win32/Process.cpp:1.2 Tue Nov 16 01:00:23 2004 +++ llvm/lib/System/Win32/Process.cpp Sun Dec 19 18:59:28 2004 @@ -41,5 +41,48 @@ return PageSize; } +void* +uint64_t +Process::GetMallocUsage() +{ +#ifdef HAVE_MALLINFO + struct mallinfo mi = ::mallinfo(); + return mi.uordblks; +#warning Cannot get malloc info on this platform + return 0; +#endif +} + +uint64_t +Process::GetTotalMemoryUsage() +{ +#ifdef HAVE_MALLINFO + struct mallinfo mi = ::mallinfo(); + return mi.uordblks + mi.hblkhd +#else +#warning Cannot get total memory size on this platform + return 0; +#endif +} + +void +Process::GetTimeUsage( + TimeValue& elapsed, TimeValue& user_time, TimeValue& sys_time) +{ + elapsed = TimeValue::now(); + + unsigned __int64 ProcCreate, ProcExit, KernelTime, UserTime; + GetProcessTimes(GetCurrentProcess(), (FILETIME*)&ProcCreate, + (FILETIME*)&ProcExit, (FILETIME*)&KernelTime, + (FILETIME*)&UserTime + ); + + // FILETIME's are # of 100 nanosecond ticks (1/10th of a microsecond) + user_time.seconds( UserTime / 10000000 ); + user_time.nanoseconds( (UserTime % 10000000) * 100 ); + sys_time.seconds( KernelTime / 10000000 ); + user_time.nanoseconds( (UserTime % 10000000) * 100 ); +} + } // vim: sw=2 smartindent smarttab tw=80 autoindent expandtab From reid at x10sys.com Sun Dec 19 18:59:15 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 18:59:15 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200412200059.SAA16224@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.35 -> 1.36 --- Log message: For PR351: http://llvm.cs.uiuc.edu/PR351 : * Move system dependent implementation out of this file. * Make implementation use sys::Process::GetMallocUsage where necessary. * Make implementation use sys::Process::GetTimeUsage where necessary. --- Diffs of the changes: (+14 -60) Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.35 llvm/lib/Support/Timer.cpp:1.36 --- llvm/lib/Support/Timer.cpp:1.35 Mon Dec 13 21:55:21 2004 +++ llvm/lib/Support/Timer.cpp Sun Dec 19 18:59:04 2004 @@ -13,16 +13,11 @@ #include "llvm/Support/Timer.h" #include "llvm/Support/CommandLine.h" -#include -#include -#include +#include "llvm/System/Process.h" #include +#include #include -#include "llvm/Config/sys/resource.h" -#include "llvm/Config/sys/time.h" -#include "llvm/Config/unistd.h" -#include "llvm/Config/malloc.h" -#include "llvm/Config/windows.h" + using namespace llvm; // GetLibSupportInfoOutputFile - Return a file stream to print our output on. @@ -42,12 +37,10 @@ } namespace { -#ifdef HAVE_MALLINFO cl::opt TrackSpace("track-memory", cl::desc("Enable -time-passes memory " "tracking (this may be slow)"), cl::Hidden); -#endif cl::opt InfoOutputFilename("info-output-file", cl::value_desc("filename"), @@ -98,65 +91,26 @@ } } -static long getMemUsage() { -#ifdef HAVE_MALLINFO - if (TrackSpace) { - struct mallinfo MI = mallinfo(); - return MI.uordblks/*+MI.hblkhd*/; - } -#endif - return 0; -} - struct TimeRecord { double Elapsed, UserTime, SystemTime; long MemUsed; }; static TimeRecord getTimeRecord(bool Start) { -#if defined(HAVE_WINDOWS_H) - unsigned __int64 ProcCreate, ProcExit, KernelTime, UserTime, CurTime; - - GetProcessTimes(GetCurrentProcess(), (FILETIME*)&ProcCreate, - (FILETIME*)&ProcExit, (FILETIME*)&KernelTime, - (FILETIME*)&UserTime); - GetSystemTimeAsFileTime((FILETIME*)&CurTime); - - // FILETIME's are # of 100 nanosecond ticks. - double ScaleFactor = 1.0/(10*1000*1000); - TimeRecord Result; - Result.Elapsed = (CurTime-ProcCreate)*ScaleFactor; // Wall time - Result.UserTime = UserTime*ScaleFactor; - Result.SystemTime = KernelTime*ScaleFactor; - return Result; -#elif defined(HAVE_GETRUSAGE) - struct rusage RU; - struct timeval T; - long MemUsed = 0; - if (Start) { - MemUsed = getMemUsage(); - if (getrusage(RUSAGE_SELF, &RU)) - perror("getrusage call failed: -time-passes info incorrect!"); - } - gettimeofday(&T, 0); - if (!Start) { - if (getrusage(RUSAGE_SELF, &RU)) - perror("getrusage call failed: -time-passes info incorrect!"); - MemUsed = getMemUsage(); - } + sys::TimeValue now(0,0); + sys::TimeValue user(0,0); + sys::TimeValue sys(0,0); + + sys::Process::GetTimeUsage(now,user,sys); + + Result.Elapsed = now.seconds() + now.microseconds() / 1000000.0; + Result.UserTime = user.seconds() + user.microseconds() / 1000000.0; + Result.UserTime = sys.seconds() + sys.microseconds() / 1000000.0; + Result.MemUsed = sys::Process::GetMallocUsage(); - TimeRecord Result; - Result.Elapsed = T.tv_sec + T.tv_usec/1000000.0; - Result.UserTime = RU.ru_utime.tv_sec + RU.ru_utime.tv_usec/1000000.0; - Result.SystemTime = RU.ru_stime.tv_sec + RU.ru_stime.tv_usec/1000000.0; - Result.MemUsed = MemUsed; return Result; -#else - // Can't get resource usage. - return TimeRecord(); -#endif } static std::vector ActiveTimers; @@ -202,7 +156,7 @@ /// currently active timers, which will be printed when the timer group prints /// void Timer::addPeakMemoryMeasurement() { - long MemUsed = getMemUsage(); + long MemUsed = sys::Process::GetMallocUsage(); for (std::vector::iterator I = ActiveTimers.begin(), E = ActiveTimers.end(); I != E; ++I) From jeffc at jolt-lang.org Sun Dec 19 21:23:57 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sun, 19 Dec 2004 21:23:57 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Archive/ArchiveReader.cpp ArchiveWriter.cpp Message-ID: <200412200323.VAA17767@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Archive: ArchiveReader.cpp updated: 1.36 -> 1.37 ArchiveWriter.cpp updated: 1.12 -> 1.13 --- Log message: Fix problems uncovered by VC++ (first time compiled by VC++) --- Diffs of the changes: (+1 -2) Index: llvm/lib/Bytecode/Archive/ArchiveReader.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.36 llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.37 --- llvm/lib/Bytecode/Archive/ArchiveReader.cpp:1.36 Sun Dec 12 21:22:31 2004 +++ llvm/lib/Bytecode/Archive/ArchiveReader.cpp Sun Dec 19 21:23:46 2004 @@ -90,7 +90,6 @@ // a '/' and blanks. std::string pathname; - unsigned index; switch (Hdr->name[0]) { case '#': if (Hdr->name[1] == '1' && Hdr->name[2] == '/') { Index: llvm/lib/Bytecode/Archive/ArchiveWriter.cpp diff -u llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.12 llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.13 --- llvm/lib/Bytecode/Archive/ArchiveWriter.cpp:1.12 Tue Dec 14 19:51:56 2004 +++ llvm/lib/Bytecode/Archive/ArchiveWriter.cpp Sun Dec 19 21:23:46 2004 @@ -293,7 +293,7 @@ ARFile.write(data,fSize); // Make sure the member is an even length - if (ARFile.tellp() & 1 == 1) + if ((ARFile.tellp() & 1) == 1) ARFile << ARFILE_PAD; // Free the compressed data, if necessary From jeffc at jolt-lang.org Sun Dec 19 21:23:57 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sun, 19 Dec 2004 21:23:57 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200412200323.VAA17762@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.149 -> 1.150 --- Log message: Fix problems uncovered by VC++ (first time compiled by VC++) --- Diffs of the changes: (+2 -1) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.149 llvm/lib/Bytecode/Reader/Reader.cpp:1.150 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.149 Thu Dec 9 00:19:44 2004 +++ llvm/lib/Bytecode/Reader/Reader.cpp Sun Dec 19 21:23:46 2004 @@ -19,6 +19,7 @@ #include "Reader.h" #include "llvm/Bytecode/BytecodeHandler.h" #include "llvm/BasicBlock.h" +#include "llvm/Config/alloca.h" #include "llvm/Constants.h" #include "llvm/Instructions.h" #include "llvm/SymbolTable.h" @@ -1501,7 +1502,7 @@ error("String constant data invalid!"); // Read character data. The type tells us how long the string is. - char Data[ATy->getNumElements()]; + char *Data = reinterpret_cast(alloca(ATy->getNumElements())); read_data(Data, Data+ATy->getNumElements()); std::vector Elements(ATy->getNumElements()); From jeffc at jolt-lang.org Sun Dec 19 21:25:07 2004 From: jeffc at jolt-lang.org (Jeff Cohen) Date: Sun, 19 Dec 2004 21:25:07 -0600 Subject: [llvm-commits] CVS: llvm/lib/System/Win32/Process.cpp Program.cpp Message-ID: <200412200325.VAA17804@zion.cs.uiuc.edu> Changes in directory llvm/lib/System/Win32: Process.cpp updated: 1.3 -> 1.4 Program.cpp updated: 1.8 -> 1.9 --- Log message: Keep up with lib/System changes --- Diffs of the changes: (+47 -31) Index: llvm/lib/System/Win32/Process.cpp diff -u llvm/lib/System/Win32/Process.cpp:1.3 llvm/lib/System/Win32/Process.cpp:1.4 --- llvm/lib/System/Win32/Process.cpp:1.3 Sun Dec 19 18:59:28 2004 +++ llvm/lib/System/Win32/Process.cpp Sun Dec 19 21:24:56 2004 @@ -12,6 +12,10 @@ //===----------------------------------------------------------------------===// #include "Win32.h" +#include +#include + +#pragma comment(lib, "psapi.lib") //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only Win32 specific code @@ -41,28 +45,26 @@ return PageSize; } -void* uint64_t Process::GetMallocUsage() { -#ifdef HAVE_MALLINFO - struct mallinfo mi = ::mallinfo(); - return mi.uordblks; -#warning Cannot get malloc info on this platform - return 0; -#endif + _HEAPINFO hinfo; + hinfo._pentry = NULL; + + size_t size = 0; + + while (_heapwalk(&hinfo) == _HEAPOK) + size += hinfo._size; + + return size; } uint64_t Process::GetTotalMemoryUsage() { -#ifdef HAVE_MALLINFO - struct mallinfo mi = ::mallinfo(); - return mi.uordblks + mi.hblkhd -#else -#warning Cannot get total memory size on this platform - return 0; -#endif + PROCESS_MEMORY_COUNTERS pmc; + GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)); + return pmc.PagefileUsage; } void @@ -71,17 +73,16 @@ { elapsed = TimeValue::now(); - unsigned __int64 ProcCreate, ProcExit, KernelTime, UserTime; + uint64_t ProcCreate, ProcExit, KernelTime, UserTime; GetProcessTimes(GetCurrentProcess(), (FILETIME*)&ProcCreate, - (FILETIME*)&ProcExit, (FILETIME*)&KernelTime, - (FILETIME*)&UserTime - ); + (FILETIME*)&ProcExit, (FILETIME*)&KernelTime, + (FILETIME*)&UserTime); // FILETIME's are # of 100 nanosecond ticks (1/10th of a microsecond) user_time.seconds( UserTime / 10000000 ); - user_time.nanoseconds( (UserTime % 10000000) * 100 ); + user_time.nanoseconds( unsigned(UserTime % 10000000) * 100 ); sys_time.seconds( KernelTime / 10000000 ); - user_time.nanoseconds( (UserTime % 10000000) * 100 ); + sys_time.nanoseconds( unsigned(KernelTime % 10000000) * 100 ); } } Index: llvm/lib/System/Win32/Program.cpp diff -u llvm/lib/System/Win32/Program.cpp:1.8 llvm/lib/System/Win32/Program.cpp:1.9 --- llvm/lib/System/Win32/Program.cpp:1.8 Mon Dec 13 23:26:43 2004 +++ llvm/lib/System/Win32/Program.cpp Sun Dec 19 21:24:56 2004 @@ -69,8 +69,10 @@ // int Program::ExecuteAndWait(const Path& path, - const std::vector& args, - const char** envp) { + const char** args, + const char** envp, + const Path** redirects, + unsigned secondsToWait) { if (!path.executable()) throw path.toString() + " is not executable"; @@ -84,9 +86,9 @@ if (progname.find(' ') != std::string::npos) len += 2; - for (unsigned i = 0; i < args.size(); i++) { - len += args[i].length() + 1; - if (args[i].find(' ') != std::string::npos) + for (unsigned i = 0; args[i]; i++) { + len += strlen(args[i]) + 1; + if (strchr(args[i], ' ')) len += 2; } @@ -103,13 +105,14 @@ *p++ = '"'; *p++ = ' '; - for (unsigned i = 0; i < args.size(); i++) { - const std::string& arg = args[i]; - needsQuoting = arg.find(' ') != std::string::npos; + for (unsigned i = 0; args[i]; i++) { + const char *arg = args[i]; + size_t len = strlen(arg); + needsQuoting = strchr(arg, ' ') != 0; if (needsQuoting) *p++ = '"'; - memcpy(p, arg.c_str(), arg.length()); - p += arg.length(); + memcpy(p, arg, len); + p += len; if (needsQuoting) *p++ = '"'; *p++ = ' '; @@ -122,6 +125,8 @@ memset(&si, 0, sizeof(si)); si.cb = sizeof(si); + // TODO: do replacement of standard input/output/error handles. + PROCESS_INFORMATION pi; memset(&pi, 0, sizeof(pi)); @@ -133,7 +138,17 @@ } // Wait for it to terminate. - WaitForSingleObject(pi.hProcess, INFINITE); + DWORD millisecondsToWait = INFINITE; + if (secondsToWait > 0) + millisecondsToWait = secondsToWait * 1000; + + if (WaitForSingleObject(pi.hProcess, millisecondsToWait) == WAIT_TIMEOUT) { + if (!TerminateProcess(pi.hProcess, 1)) { + ThrowError(std::string("Failed to terminate timed-out program '") + + path.toString() + "'"); + } + WaitForSingleObject(pi.hProcess, INFINITE); + } // Get its exit status. DWORD status; From reid at x10sys.com Sun Dec 19 21:59:34 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 21:59:34 -0600 Subject: [llvm-commits] CVS: llvm/lib/Support/Timer.cpp Message-ID: <200412200359.VAA18329@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: Timer.cpp updated: 1.36 -> 1.37 --- Log message: Put some header files back that Win32 needs. --- Diffs of the changes: (+2 -0) Index: llvm/lib/Support/Timer.cpp diff -u llvm/lib/Support/Timer.cpp:1.36 llvm/lib/Support/Timer.cpp:1.37 --- llvm/lib/Support/Timer.cpp:1.36 Sun Dec 19 18:59:04 2004 +++ llvm/lib/Support/Timer.cpp Sun Dec 19 21:59:23 2004 @@ -14,7 +14,9 @@ #include "llvm/Support/Timer.h" #include "llvm/Support/CommandLine.h" #include "llvm/System/Process.h" +#include #include +#include #include #include From gaeke at cs.uiuc.edu Sun Dec 19 22:02:17 2004 From: gaeke at cs.uiuc.edu (Brian Gaeke) Date: Sun, 19 Dec 2004 22:02:17 -0600 (CST) Subject: [llvm-commits] CVS: llvm/tools/llvmc/CompilerDriver.cpp Message-ID: <200412200402.WAA00313@kain.cs.uiuc.edu> Changes in directory llvm/tools/llvmc: CompilerDriver.cpp updated: 1.24 -> 1.25 --- Log message: Use Config/alloca.h instead of alloca.h - pointed out by Duraid and Misha --- Diffs of the changes: (+1 -1) Index: llvm/tools/llvmc/CompilerDriver.cpp diff -u llvm/tools/llvmc/CompilerDriver.cpp:1.24 llvm/tools/llvmc/CompilerDriver.cpp:1.25 --- llvm/tools/llvmc/CompilerDriver.cpp:1.24 Sun Dec 19 15:08:07 2004 +++ llvm/tools/llvmc/CompilerDriver.cpp Sun Dec 19 22:02:01 2004 @@ -21,7 +21,7 @@ #include "llvm/ADT/SetVector.h" #include "llvm/ADT/StringExtras.h" #include -#include +#include "llvm/Config/alloca.h" using namespace llvm; From reid at x10sys.com Sun Dec 19 22:09:09 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 22:09:09 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/config.h.in Message-ID: <200412200409.WAA18493@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: config.h.in updated: 1.40 -> 1.41 --- Log message: Add HAVE_SYSCONF --- Diffs of the changes: (+3 -0) Index: llvm/include/llvm/Config/config.h.in diff -u llvm/include/llvm/Config/config.h.in:1.40 llvm/include/llvm/Config/config.h.in:1.41 --- llvm/include/llvm/Config/config.h.in:1.40 Wed Dec 15 16:28:35 2004 +++ llvm/include/llvm/Config/config.h.in Sun Dec 19 22:08:58 2004 @@ -279,6 +279,9 @@ /* Define to 1 if you have the `strtoq' function. */ #undef HAVE_STRTOQ +/* Define to 1 if you have the `sysconf' function. */ +#undef HAVE_SYSCONF + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H From reid at x10sys.com Sun Dec 19 22:15:55 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 22:15:55 -0600 Subject: [llvm-commits] CVS: llvm/lib/Linker/LinkArchives.cpp Message-ID: <200412200415.WAA18589@zion.cs.uiuc.edu> Changes in directory llvm/lib/Linker: LinkArchives.cpp updated: 1.43 -> 1.44 --- Log message: Remove un-needed #includes. --- Diffs of the changes: (+1 -3) Index: llvm/lib/Linker/LinkArchives.cpp diff -u llvm/lib/Linker/LinkArchives.cpp:1.43 llvm/lib/Linker/LinkArchives.cpp:1.44 --- llvm/lib/Linker/LinkArchives.cpp:1.43 Sun Dec 12 20:59:29 2004 +++ llvm/lib/Linker/LinkArchives.cpp Sun Dec 19 22:15:44 2004 @@ -19,9 +19,7 @@ #include "llvm/Bytecode/Reader.h" #include "llvm/Bytecode/Archive.h" #include "llvm/Config/config.h" -//#include "llvm/Support/SystemUtils.h" -//#include -//#include +#include #include #include From llvm at cs.uiuc.edu Sun Dec 19 22:20:50 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sun, 19 Dec 2004 22:20:50 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/pagesize.h time.h windows.h Message-ID: <200412200420.WAA18645@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: pagesize.h (r1.3) removed time.h (r1.4) removed windows.h (r1.4) removed --- Log message: Remove these headers. The files that used to #include them don't any more as most system dependent behavior has been moved to lib/System. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Sun Dec 19 22:24:47 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sun, 19 Dec 2004 22:24:47 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/fcntl.h limits.h malloc.h memory.h stdint.h Message-ID: <200412200424.WAA18703@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: fcntl.h (r1.5) removed limits.h (r1.4) removed malloc.h (r1.4) removed memory.h (r1.4) removed stdint.h (r1.4) removed --- Log message: Remove these files as they are included by nothing in LLVM any more. The system dependent functionality has been moved to lib/System. --- Diffs of the changes: (+0 -0) From llvm at cs.uiuc.edu Sun Dec 19 22:26:04 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sun, 19 Dec 2004 22:26:04 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/dlfcn.h Message-ID: <200412200426.WAA18734@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: dlfcn.h (r1.7) removed --- Log message: Remove this file as its not used by anything in LLVM any more. System dependent behavior is now made through the lib/System interface. --- Diffs of the changes: (+0 -0) From reid at x10sys.com Sun Dec 19 22:34:47 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 22:34:47 -0600 Subject: [llvm-commits] CVS: llvm/tools/llvm-stub/llvm-stub.c Message-ID: <200412200434.WAA18883@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-stub: llvm-stub.c updated: 1.4 -> 1.5 --- Log message: Incorporate the contents of include/llvm/Config/unistd.h as this is the last file in LLVM to require the header. After ths commmit, our unistd.h will go away. --- Diffs of the changes: (+11 -1) Index: llvm/tools/llvm-stub/llvm-stub.c diff -u llvm/tools/llvm-stub/llvm-stub.c:1.4 llvm/tools/llvm-stub/llvm-stub.c:1.5 --- llvm/tools/llvm-stub/llvm-stub.c:1.4 Wed Sep 1 17:55:38 2004 +++ llvm/tools/llvm-stub/llvm-stub.c Sun Dec 19 22:34:36 2004 @@ -23,7 +23,17 @@ #include #include #include -#include "llvm/Config/unistd.h" /* provides definition of execve */ + +#include "llvm/Config/config.h" + +#if defined(HAVE_UNISTD_H) && !defined(_MSC_VER) +#include +#endif + +#ifdef _WIN32 +#include +#include +#endif int main(int argc, char** argv) { const char *Interp = getenv("LLVMINTERP"); From llvm at cs.uiuc.edu Sun Dec 19 22:35:31 2004 From: llvm at cs.uiuc.edu (LLVM) Date: Sun, 19 Dec 2004 22:35:31 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/unistd.h Message-ID: <200412200435.WAA18901@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Config: unistd.h (r1.6) removed --- Log message: Remove this file as there are no LLVM users of it any more. --- Diffs of the changes: (+0 -0) From brukman at uiuc.edu Sun Dec 19 22:41:57 2004 From: brukman at uiuc.edu (Misha Brukman) Date: Sun, 19 Dec 2004 22:41:57 -0600 Subject: [llvm-commits] CVS: llvm/include/llvm/Config/unistd.h In-Reply-To: <200412200435.WAA18901@zion.cs.uiuc.edu> References: <200412200435.WAA18901@zion.cs.uiuc.edu> Message-ID: <20041220044157.GA26994@zion> On Sun, Dec 19, 2004 at 10:35:31PM -0600, LLVM wrote: > Changes in directory llvm/include/llvm/Config: > > unistd.h (r1.6) removed > --- > Log message: > > Remove this file as there are no LLVM users of it any more. False: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:21:32: llvm/Config/unistd.h: No such file or directory -- Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu From reid at x10sys.com Sun Dec 19 22:52:15 2004 From: reid at x10sys.com (Reid Spencer) Date: Sun, 19 Dec 2004 22:52:15 -0600 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Message-ID: <200412200452.WAA27278@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReaderWrappers.cpp updated: 1.39 -> 1.40 --- Log message: Remove the #include of llvm/Config/unistd.h as it is no longer needed. --- Diffs of the changes: (+0 -1) Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.39 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.40 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.39 Mon Dec 13 12:25:27 2004 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Sun Dec 19 22:52:04 2004 @@ -18,7 +18,6 @@ #include "llvm/Module.h" #include "llvm/Instructions.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/Config/unistd.h" #include "llvm/System/MappedFile.h" #include using namespace llvm; From brukman at cs.uiuc.edu Sun Dec 19 23:37:08 2004 From: brukman at cs.uiuc.edu (Misha Brukman) Date: Sun, 19 Dec 2004 23:37:08 -0600 Subject: [llvm-commits] CVS: llvm/tools/bugpoint/bugpoint.cpp Message-ID: <200412200537.XAA01187@zion.cs.uiuc.edu> Changes in directory llvm/tools/bugpoint: bugpoint.cpp updated: 1.20 -> 1.21 --- Log message: llvm/Config/unistd.h has gone away, far, far away --- Diffs of the changes: (+0 -2) Index: llvm/tools/bugpoint/bugpoint.cpp diff -u llvm/tools/bugpoint/bugpoint.cpp:1.20 llvm/tools/bugpoint/bugpoint.cpp:1.21 --- llvm/tools/bugpoint/bugpoint.cpp:1.20 Wed Sep 1 17:55:37 2004 +++ llvm/tools/bugpoint/bugpoint.cpp Sun Dec 19 23:36:57 2004 @@ -20,8 +20,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/PluginLoader.h" #include "llvm/System/Signals.h" -#include "llvm/Config/unistd.h" -//#include using namespace llvm; static cl::list