1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

163 Commits

Author SHA1 Message Date
Gabor Greif
f9cf3d3440 Solaris 2.x does not have RLIMIT_RSS, check for this symbol (analog NetBSD below), should subsume Cygwin
llvm-svn: 37939
2007-07-06 10:31:27 +00:00
Gabor Greif
5f705671e4 Here is the bulk of the sanitizing.
Almost all occurrences of "bytecode" in the sources have been eliminated.

llvm-svn: 37913
2007-07-05 17:07:56 +00:00
Devang Patel
917048baee Fix LLVM build on NetBSD. Patch by Neil Booth.
llvm-svn: 37410
2007-06-04 15:28:57 +00:00
Chris Lattner
044aaca356 Fix a bug where the bcreader could crash on .bc files that were an exact
multiple of the page size, due to a bug in MappedFile

llvm-svn: 36980
2007-05-11 00:00:27 +00:00
Chris Lattner
342010d9f3 pull some win32 code into common code, add bitcode identification support.
llvm-svn: 36846
2007-05-06 05:32:21 +00:00
Reid Spencer
8d2fd1bc21 Cygwin doesn't have the RSS_LIMIT for get/setrlimit.
llvm-svn: 36361
2007-04-23 07:22:51 +00:00
Reid Spencer
14fb379888 For PR1291:
Implement the PathWithStatus class and its use throughout lib/System.

llvm-svn: 35742
2007-04-07 18:52:17 +00:00
Reid Spencer
e35e9d07b0 Use the stat information in the Path object, if it is already obtained. This
avoids a call to ::fstat by MappedFile when the file size information was
already obtained by the Path object.

llvm-svn: 35477
2007-03-29 19:11:22 +00:00
Reid Spencer
4269ae1274 For PR789:
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.

llvm-svn: 35476
2007-03-29 19:05:44 +00:00
Reid Spencer
d0eb672f1e Add a uniqueID field to the FileStatus structure for Paths. This will map
to the inode number on Unix and something far less unique on Windows. The
windows case needs to be improved.

llvm-svn: 35461
2007-03-29 17:00:31 +00:00
Reid Spencer
fc67ef7cfe For PR789:
* Add a method: bool isAbsolute() const, which determines if the path name
  is absolute or not.
* Implement caching of file status information in the Path object. Allow it
  to be updated forcefully or lazily re-fetched from the cached value.

llvm-svn: 35456
2007-03-29 16:43:20 +00:00
Anton Korobeynikov
87e945c62d Add possibility to set memory limit for binaries run via libSystem. This
is especially needed for bugpoint. This partly implements PR688

llvm-svn: 34349
2007-02-16 19:11:07 +00:00
Reid Spencer
5bf28d5efe Eliminate "control reaches end of non-void function" warnings.
llvm-svn: 32225
2006-12-05 17:53:26 +00:00
Chris Lattner
7a1210a86c Use new config.h macro
llvm-svn: 30321
2006-09-14 06:21:59 +00:00
Chris Lattner
b233122a83 On Mac OS/X, make Process::PreventCoreFiles disable crash reporter for
the process in addition to disabling core file emission.  This speeds up
bugpoint on default-configured macs by several orders of magnitude.

llvm-svn: 30317
2006-09-14 06:01:41 +00:00
Reid Spencer
9b5ea0704e For PR797:
Make the Win32 code exception free (untested/uncompiled) which forced some
interface changes which had ripple effect. This should be the last of 797.

llvm-svn: 29884
2006-08-25 21:37:17 +00:00
Reid Spencer
71c3f66dc6 For PR797:
Final removal of exceptions from lib/System and adjustment of users to
accommodate.

llvm-svn: 29846
2006-08-23 20:34:57 +00:00
Reid Spencer
bc4c8e8ac0 For PR797:
Eliminate exception throwing from Path::renamePathOnDisk and adjust its
users correspondingly.

llvm-svn: 29843
2006-08-23 07:30:48 +00:00
Reid Spencer
0bc83e3c5e For PR797:
Remove exception throwing from Path::getDirectoryContents and its users.

llvm-svn: 29841
2006-08-23 06:56:27 +00:00
Reid Spencer
baf54399e7 For PR797:
Remove exceptions from the Path::create*OnDisk methods. Update their users
to handle error messages via arguments and result codes.

llvm-svn: 29840
2006-08-23 00:39:35 +00:00
Reid Spencer
45120b0798 For PR797:
Change the Path::make*OnDisk methods exception free and adjust their usage.

llvm-svn: 29836
2006-08-22 23:27:23 +00:00
Reid Spencer
353b72a7c0 Make the sys::Path::GetTemporaryDirectory method not throw exceptions and
adjust users of it to compensate.

llvm-svn: 29831
2006-08-22 19:01:30 +00:00
Reid Spencer
0c560865ef Don't throw needlessly. Failure of gettimeofday is *very* unlinkely so
just return MinTime if that should ever happen.

llvm-svn: 29826
2006-08-22 17:38:44 +00:00
Reid Spencer
9fbfd7c399 For PR797:
Make MappedFile not throw any exceptions.

llvm-svn: 29816
2006-08-22 16:04:22 +00:00
Reid Spencer
74980b5115 For PR797:
Fix a bug in my last patch that botched file redirection by using explicit
scoping of if statements.

llvm-svn: 29815
2006-08-22 15:56:52 +00:00
Reid Spencer
0d39935a51 Make an error message a little more intelligible.
llvm-svn: 29808
2006-08-22 05:28:38 +00:00
Reid Spencer
e9f818b95a For PR797:
Remove all exception code from Program.inc and implement its new interface
with an ErrMsg string argument.

llvm-svn: 29790
2006-08-21 06:02:44 +00:00
Reid Spencer
5ed787710d For PR797:
Make sys::Program::ExecuteAndWait not throw exceptions and update any
affected code. It now return -9999 to signal that the program couldn't be
executed. Only one case (in bugpoint) actually examines the result code.

llvm-svn: 29785
2006-08-21 02:04:43 +00:00
Reid Spencer
d06ae031ce Remove extraneous #include.
llvm-svn: 29541
2006-08-07 05:36:24 +00:00
Reid Spencer
b1b1f483ed Make the removal of files use Path::eraseFromDisk just like it does for
the removal of directories. Using std::remove is indiscriminate and can
lead to the removal of things like /dev/null if run as root. The
Path::eraseFromDisk method ensures that we only ever remove regular files
or directories, but never character or block special nodes.  This should
clear up the problem with usage like: llvm-as -o /dev/null which is used
in the llvm-test makefiles.

llvm-svn: 29540
2006-08-07 05:34:08 +00:00
Reid Spencer
ec2ce4eaab Add a note about how the "isFile" check in Path::eraseFromDisk prevents
the erasure of non-file paths like /dev/null.

llvm-svn: 29539
2006-08-07 05:20:05 +00:00
Chris Lattner
ceecdbc08e Remove some now-dead methods. Use getFileStatus instead.
llvm-svn: 29447
2006-08-01 18:16:02 +00:00
Chris Lattner
401b6d696e Use getFileStatus instead of Path::isDirectory().
llvm-svn: 29443
2006-08-01 17:59:14 +00:00
Chris Lattner
863cb9ca93 elimiante some syscalls
llvm-svn: 29442
2006-08-01 17:51:09 +00:00
Chris Lattner
504adc58b7 Modify setStatusInfoOnDisk to not throw an exception.
llvm-svn: 29402
2006-07-28 22:36:17 +00:00
Chris Lattner
d7873a0757 Modify Path::eraseFromDisk to not throw an exception.
llvm-svn: 29400
2006-07-28 22:29:50 +00:00
Chris Lattner
f4c7ceebaf Change Path::getStatusInfo to return a boolean and error string on an error
instead of throwing an exception.  This reduces the amount of code that is
exposed to exceptions (e.g. FileUtilities), though it is clearly only one step
along the way.

llvm-svn: 29395
2006-07-28 22:03:44 +00:00
Chris Lattner
4854a2a120 simple optimization: don't bother calling "exists" (which calls the syscall
"access").  Instead, just let the open call fail if the file doesn't exist.
This reduces the # syscalls executed.

llvm-svn: 29173
2006-07-18 07:07:51 +00:00
Chris Lattner
c373ed8521 Remove a dead conditional: info_ can only be allocated if FD is good. Improve
spacing

llvm-svn: 29172
2006-07-18 07:03:14 +00:00
Chris Lattner
1c12ee4323 The only entry in the stat buf this code cares about is the size. Keep just
the size, not the whole stat buffer.

llvm-svn: 29171
2006-07-18 07:01:08 +00:00
Chris Lattner
33501c24e8 Reduce code in the error path by only allocating info_ if everything looks
good.

llvm-svn: 29170
2006-07-18 06:57:51 +00:00
Chris Lattner
d01158a404 Unindent some code
llvm-svn: 29169
2006-07-18 06:52:52 +00:00
Chris Lattner
803c609c77 Turn an if into an else if.
llvm-svn: 29129
2006-07-12 22:37:18 +00:00
Chris Lattner
0438b0c461 no need to do a stat then an lstat. lstat will tell us if normal files don't exist.
llvm-svn: 29068
2006-07-07 21:21:06 +00:00
Chris Lattner
8116948fa5 Change AllocateRWX/DeallocateRWX to not throw an exception.
llvm-svn: 29058
2006-07-07 17:32:37 +00:00
Reid Spencer
82494a2bce Only print the stack trace if it was requested. Previously, any call into
the Signals module that registered the handlers would cause the stack trace
to be generated. Now, you must explicitly call PrintStackTraceOnErrorSignal
in order for that to happen.

llvm-svn: 28810
2006-06-16 00:00:57 +00:00
Evan Cheng
cd37f47980 Don't pull in environ, not always safe. Global variables are bad anyway.
Use execve when explicit environment variables ptr is available. Otherwise
just use execv.

llvm-svn: 28740
2006-06-09 20:43:11 +00:00
Reid Spencer
3c338b3803 For PR787:
Provide new llvm::sys::Program facilities for converting the stdout and
stdin to binary mode. There is no standard way to do this and the available
mechanisms are platform specific. Adjust the bytecode reader and writer to
use these methods when their input is stdin or output is stdout. THis avoids
the problem with \n writing CRLF to a bytecode file on windows.

Patch Contributed by Michael Smith.

llvm-svn: 28722
2006-06-07 23:18:34 +00:00
Chris Lattner
64f0fddc23 This function is not documented as throwing an exception and callers don't
handle it.  Just silently fail.

llvm-svn: 28291
2006-05-14 18:53:09 +00:00
Chris Lattner
e020b812f3 Fix accidentally committed patch.
llvm-svn: 28260
2006-05-12 18:20:39 +00:00