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 $