Duncan Sands
5c77da0572
Using a signal handler that does nothing should be
...
equivalent to SIG_IGN.
llvm-svn: 81144
2009-09-07 05:58:25 +00:00
Duncan Sands
598fe699d0
Remove some not-really-used variables, as warned
...
about by icc (#593 , partial). Patch by Erick Tryzelaar.
llvm-svn: 81115
2009-09-06 12:41:19 +00:00
Duncan Sands
4b92376ba8
Tweak code into an equivalent form for which icc
...
doesn't warn about unreachable instructions. Patch
by Erick Tryzelaar (#111 ).
llvm-svn: 81110
2009-09-06 10:53:22 +00:00
Daniel Dunbar
ac461a55ce
Improve llvm::getHostTriple for some cases where the LLVM_HOSTTRIPLE is not
...
reliable.
llvm-svn: 80863
2009-09-03 01:10:13 +00:00
Chris Lattner
11f509336c
remove the last uses of Config/alloca.h
...
llvm-svn: 79873
2009-08-23 22:57:38 +00:00
Chris Lattner
3203639c35
Prune #includes from llvm/Linker.h and llvm/System/Path.h,
...
forcing them down into various .cpp files.
This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
instead.
4. Weans llvm-db off <iostream>
sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.
llvm-svn: 79869
2009-08-23 22:45:37 +00:00
Owen Anderson
bbc67a90d5
Get rid of a helgrind warning. If this is _actually_ a performance problem,
...
we can find a way to cache the answer that isn't racy.
llvm-svn: 79472
2009-08-19 21:48:34 +00:00
Owen Anderson
ed218e5820
Add locking around signal handler registration.
...
llvm-svn: 79254
2009-08-17 17:07:22 +00:00
Dan Gohman
1c41d60c4a
Fix a bunch of namespace pollution.
...
llvm-svn: 78363
2009-08-07 01:32:21 +00:00
Dan Gohman
50e5bf5aa4
Minor code simplification.
...
llvm-svn: 78239
2009-08-05 20:16:55 +00:00
Dan Gohman
38208563e9
Update a comment to reflect the current code.
...
llvm-svn: 78215
2009-08-05 17:32:39 +00:00
Dan Gohman
587b5b9682
Remove needless uses of std::flush in the parent process after a
...
fork call. This eliminates a need for <iostream>. Also remove
needless fsync calls.
llvm-svn: 78131
2009-08-05 00:17:00 +00:00
Dan Gohman
a8cb86c0f5
Use _exit rather than exit in the child process after a failed exec.
...
Add a comment explaining why.
llvm-svn: 78128
2009-08-05 00:09:12 +00:00
Dan Gohman
a9ceec3d38
Follow Unix behavior and return 127 if the command is not found,
...
and 126 if it is not executable.
llvm-svn: 78120
2009-08-04 23:15:49 +00:00
Daniel Dunbar
6a5b6a721e
When exec() fails, return 127 instead of errno; the parent process has no way to
...
distinguish that the result is errno, so it can't use it to provide more
information about the error (it also exposes the numeric value of errno).
llvm-svn: 78098
2009-08-04 20:32:25 +00:00
Daniel Dunbar
c5047d9d96
Fix a race condition in getting the process exit code on Win32.
...
llvm-svn: 77953
2009-08-03 05:02:46 +00:00
Dan Gohman
454f9dc117
Remove another F_OK.
...
llvm-svn: 77405
2009-07-29 00:02:58 +00:00
Dan Gohman
94bc13beac
On "Unix", if Program::FindProgramByName is given a name containing
...
slashes, just go with it, regardless of whether it looks like it will
be executable. This follows the behavior of sh(1) more closely.
llvm-svn: 77396
2009-07-28 23:25:18 +00:00
Dan Gohman
3341edff8b
It isn't necessary to use F_OK when using R_OK or similar.
...
llvm-svn: 77392
2009-07-28 23:22:01 +00:00
Benjamin Kramer
c5d38b51da
Fix a fixme; don't take binaries from the working directory.
...
This fixes clang on non-darwin platforms if a file called 'ld' or 'as'
is in the working directory. Based on patch by Pawel Worach!
llvm-svn: 77379
2009-07-28 22:08:15 +00:00
Reid Kleckner
3f197c850d
Re-committing r76828 with the JIT memory manager changes now that the build
...
bots like the BumpPtrAllocator changes.
llvm-svn: 76902
2009-07-23 21:46:56 +00:00
Reid Kleckner
6f9bf7f028
Reverting r76825 and r76828, since they caused clang runtime errors and some build failure involving memset.
...
llvm-svn: 76838
2009-07-23 01:40:54 +00:00
Reid Kleckner
b500f07edf
Make the JIT code emitter properly retry and ask for more memory when it runs
...
out of memory, and also make the default memory manager allocate more memory
when it runs out.
Also, switch function stubs and global data over to using the BumpPtrAllocator.
This makes it so the JIT no longer mmaps (or the equivalent on Windows) 16 MB
of memory, and instead allocates in 512K slabs. I suspect this size could go
lower, especially on embedded platforms, now that more slabs can be allocated.
llvm-svn: 76828
2009-07-23 00:49:59 +00:00
Mikhail Glushenkov
583e23d726
Remove duplication in Program::Execute{And,No}Wait.
...
Implemented by moving the code out of static functions into methods of Program
class.
llvm-svn: 76340
2009-07-18 21:43:12 +00:00
Mikhail Glushenkov
d44eba5166
Trailing whitespace.
...
llvm-svn: 76229
2009-07-17 20:38:17 +00:00
Daniel Dunbar
995f9a8a15
Improve sys::Path::makeAbsolute on Win32.
...
- Patch by Viktor Kutuzov!
- Minor tweak by me to add llvm_unreachable calls on FIXMEd error paths.
llvm-svn: 75424
2009-07-12 20:23:56 +00:00
Chris Lattner
cf99e77cc3
"UNIX paths can contain non-ASCII characters, so Path::isValid() should not reject paths with such characters in them. The attached patch removes the check from Path::isValid()."
...
patch by Benjamin Kramer!
llvm-svn: 75421
2009-07-12 19:01:16 +00:00
David Greene
87dbe0a3b5
Add an ExecuteNoWait interface to support asynchronous process spawning.
...
llvm-svn: 75055
2009-07-08 21:46:40 +00:00
Jeffrey Yasskin
29ea777c1e
Add a portable strerror*() wrapper, llvm::sys::StrError(). This includes the
...
Windows variant, strerror_s, but I couldn't test that.
I'll update configure and config.h.in in a subsequent patch.
llvm-svn: 74621
2009-07-01 18:11:20 +00:00
Owen Anderson
77f965d8b2
Fix compilation without pthreads.
...
Patch by Xerxes Ranby.
llvm-svn: 74283
2009-06-26 08:48:03 +00:00
Owen Anderson
e716e57779
Add a class for supporting platform independent thread-local storage.
...
Windows people, please double-check/patch this.
llvm-svn: 74209
2009-06-25 21:58:01 +00:00
Owen Anderson
4760da0a7a
Give RWMutex the SmartRWMutex treatment too.
...
llvm-svn: 73710
2009-06-18 18:26:15 +00:00
Owen Anderson
9aaa6b8958
Insert a SmartMutex templated class into the class hierarchy, which takes a template parameter specifying whether this mutex
...
should become a no-op when not running in multithreaded mode. Make sys::Mutex a typedef of SmartMutex<false>, to preserve source compatibility.
llvm-svn: 73709
2009-06-18 17:53:17 +00:00
Owen Anderson
48d53f2c53
Add a portable wrapper for reader-writer locks.
...
llvm-svn: 73545
2009-06-16 20:19:28 +00:00
Dan Gohman
d0637707c5
glibc has two versions of strerror_r, a standards compliant one and a GNU
...
specific one. The GNU one is chosen when _GNU_SOURCE is defined. g++ always
defines _GNU_SOURCE on linux platforms because glibc's headers won't compile
in C++ mode without it. The GNU strerror_r doesn't always modify the buffer
which causes empty error messages on linux.
This patch changes MakeErrMsg to use the return value of strerror_r to get
the string instead of assuming the buffer will be modified, on GLIBC.
Patch by Benjamin Kramer!
llvm-svn: 73396
2009-06-15 18:05:46 +00:00
Chris Lattner
dfaaf63aff
add a new static method to portably determine whether a patch is
...
absolute or not, based on a patch by Gregory Curfman!
llvm-svn: 73368
2009-06-15 04:17:07 +00:00
Torok Edwin
5da9f51d1e
Add support for outputting ANSI colors to raw_fd_ostream.
...
llvm-svn: 72854
2009-06-04 07:09:50 +00:00
Bill Wendling
8235a05c1a
Untabification.
...
llvm-svn: 72604
2009-05-30 01:09:53 +00:00
Jay Foad
ccae25d83b
Work around a page size issue on Cygwin.
...
llvm-svn: 72332
2009-05-23 17:57:59 +00:00
Douglas Gregor
1ad25cdc99
termios.h contains the winsize structure we need to determine the
...
width of a terminal. Don't try to get the width of a terminal if we
don't have this header.
llvm-svn: 72018
2009-05-18 17:21:34 +00:00
Douglas Gregor
26745696ef
Add terminal width detection to llvm::sys::Process. This is needed to
...
fix Clang PRs 4148 and 4183.
llvm-svn: 71448
2009-05-11 18:05:52 +00:00
Daniel Dunbar
024320d274
Make Unix.h:MakeErrMsg separate the prefix and errno string, so we get:
...
clang: error: unable to make temporary file: /etc/cc: can't make
unique filename: Permission denied
instead of
clang: error: unable to make temporary file: /etc/cc: can't make
unique filenamePermission denied
for example.
Also, audited the uses of MakeErrMsg to make the prefix strings
consistent (not end with newline/punctuation/space/": ").
llvm-svn: 69626
2009-04-20 20:50:13 +00:00
Chris Lattner
76d47b6629
fix PR3965:SIGINT handler not restored after calling ParseAST(),
...
patch by Alexei Svitkine!
llvm-svn: 68929
2009-04-12 23:33:13 +00:00
Daniel Dunbar
aec3d9857f
Add llvm::sys::getHostTriple and remove
...
llvm::sys::getOS{Name,Version}.
Right now the implementation just derives from LLVM_HOSTTRIPLE (which
is wrong, but it doesn't look like we have a define for the target
triple). Ideally this routine would actually be able to compute the
triple for targets we care about.
llvm-svn: 68118
2009-03-31 17:30:15 +00:00
Chris Lattner
095a3938e4
fix a bug Alexei Svitkine pointed out.
...
llvm-svn: 67510
2009-03-23 06:46:20 +00:00
Chris Lattner
910f31715e
When we restore signal handlers, restore them back to what they
...
were when we came around, not to their default handler. This
should fix PR3848
llvm-svn: 67509
2009-03-23 05:55:36 +00:00
Chris Lattner
429a82ad30
factorize signal registration, part of PR3848.
...
llvm-svn: 67508
2009-03-23 05:42:29 +00:00
Chris Lattner
778f77667d
add some explicit llvm:: qualifiers to the unix side, fix problems on the windows side.
...
llvm-svn: 66386
2009-03-08 19:13:45 +00:00
Chris Lattner
005d001719
When a crash signal is delivered do two things: remove all of our
...
signal handlers to prevent reentrance on unrelated things (a sigabort
where the handle bus errors) also, clear the signal mask so that the
signal doesn't infinitely reissue. This fixes rdar://6654827 -
Crash causes clang to loop
llvm-svn: 66330
2009-03-07 08:15:47 +00:00
Chris Lattner
0743280d7a
move some code to gracefully handle the case when a handler crashes.
...
llvm-svn: 66171
2009-03-05 18:22:14 +00:00