Benjamin Kramer
2a1131a42f
Add a shortcut for OS X to Path::GetMainExecutable. This gives a nice speedup on
...
clang's testsuite.
llvm-svn: 81333
2009-09-09 12:09:08 +00:00
Mikhail Glushenkov
d2f8a111cd
Check that the 'kill' call succeeded.
...
Thanks to Duncan Sands for spotting this.
llvm-svn: 81328
2009-09-09 09:51:47 +00:00
Mikhail Glushenkov
a3fbf36004
This should unbreak the build on 64-bit Linux.
...
llvm-svn: 81252
2009-09-08 20:31:27 +00:00
Mikhail Glushenkov
29b5d3012b
Const-correctness.
...
llvm-svn: 81249
2009-09-08 19:51:39 +00:00
Mikhail Glushenkov
f9e2f241df
Get rid of the Pid_ member in the Program class.
...
llvm-svn: 81247
2009-09-08 19:50:55 +00:00
Mikhail Glushenkov
4a91b7605b
Add a Kill() function to the Program class.
...
llvm-svn: 81246
2009-09-08 19:50:27 +00:00
Duncan Sands
cd32ecf44f
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
89720bbd11
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
44d423ac93
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
18d6959f39
Improve llvm::getHostTriple for some cases where the LLVM_HOSTTRIPLE is not
...
reliable.
llvm-svn: 80863
2009-09-03 01:10:13 +00:00
Torok Edwin
487d576020
Fix ExplicitSymbols leak.
...
llvm-svn: 80589
2009-08-31 16:12:29 +00:00
Chris Lattner
30ebdc4311
remove the last uses of Config/alloca.h
...
llvm-svn: 79873
2009-08-23 22:57:38 +00:00
Chris Lattner
c521f54198
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
a83e868078
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
820739dccc
Add locking around signal handler registration.
...
llvm-svn: 79254
2009-08-17 17:07:22 +00:00
Dan Gohman
1432ef864e
This void is implicit in C++.
...
llvm-svn: 78848
2009-08-12 22:10:57 +00:00
Chris Lattner
c02f3d866f
improve win32 path support, patch by Baptiste Lepilleur!
...
llvm-svn: 78823
2009-08-12 17:47:06 +00:00
Dan Gohman
a6d0afcb74
Fix a bunch of namespace pollution.
...
llvm-svn: 78363
2009-08-07 01:32:21 +00:00
Dan Gohman
798ae47b59
Minor code simplification.
...
llvm-svn: 78239
2009-08-05 20:16:55 +00:00
Dan Gohman
4cf97dddea
Update a comment to reflect the current code.
...
llvm-svn: 78215
2009-08-05 17:32:39 +00:00
Dan Gohman
7ce1fe2d04
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
23a419f361
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
6faa1d2f8f
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
8b6be17777
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
1a6a39eb46
Fix a race condition in getting the process exit code on Win32.
...
llvm-svn: 77953
2009-08-03 05:02:46 +00:00
Daniel Dunbar
381b89d3f1
Empty arguments need to be quoted on Win32.
...
llvm-svn: 77913
2009-08-02 20:41:09 +00:00
Chris Lattner
37d60ffce0
eXtensible Systems doesn't exist any more and Reid donated this to the
...
project under the normal license, yay. :)
llvm-svn: 77823
2009-08-01 22:54:17 +00:00
Dan Gohman
4723c103e3
Remove another F_OK.
...
llvm-svn: 77405
2009-07-29 00:02:58 +00:00
Dan Gohman
0c96daabad
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
367006523a
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
6adb6e07ce
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
Douglas Gregor
c0137150ee
CMake: make sure that the *.inc files for libSystem show up in the resulting
...
project.
llvm-svn: 77213
2009-07-27 17:55:55 +00:00
Daniel Dunbar
bcd92f1bc4
Don't use llvm_report_error in libSystem, this is a layering violation.
...
llvm-svn: 77169
2009-07-26 21:16:42 +00:00
Reid Kleckner
4b3a356493
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
921673225c
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
1a722d9b73
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
36cb83202d
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
28309ac04c
Trailing whitespace.
...
llvm-svn: 76229
2009-07-17 20:38:17 +00:00
Ted Kremenek
39816d9157
Lexically order files in CMakeLists.txt files.
...
llvm-svn: 75831
2009-07-15 21:08:16 +00:00
Daniel Dunbar
5e2ebcba40
Use llvm_report_error, not llvm_unreachable.
...
llvm-svn: 75429
2009-07-12 21:01:49 +00:00
Daniel Dunbar
df555fd6f8
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
a3c69aeb65
"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
Chris Lattner
433cf71144
eraseFromDisk no longer throws.
...
llvm-svn: 75139
2009-07-09 16:17:28 +00:00
David Greene
cdde1bb0a6
Add an ExecuteNoWait interface to support asynchronous process spawning.
...
llvm-svn: 75055
2009-07-08 21:46:40 +00:00
Chris Lattner
d41531a2c0
remove two methods that no longer exist.
...
llvm-svn: 74982
2009-07-08 01:07:39 +00:00
Chris Lattner
e4807c5767
more getting windows to build.
...
llvm-svn: 74981
2009-07-08 00:52:12 +00:00
Chris Lattner
e3241b5719
hopefully fix the build on windows.
...
llvm-svn: 74977
2009-07-08 00:29:32 +00:00
Chris Lattner
3612256e2e
Eliminate the static constructors and locks from DynamicLibrary.cpp.
...
This fixes PR4512 and eliminating static ctors is always good. Losing
thread safety is unfortunate, but the code is just incredibly poorly
designed.
If someone is interested, the "right" solution is to split
DynamicLibrary.cpp into two separate pieces: a stateless piece in
libsystem, and a simple support file in libsupport that has the
"state" (e.g. AddSymbol) in managed static objects.
Doing this would both fix memory leaks we already have, as well as make
the code thread safe again. it would also make sense to move all the
unix specific code in System/DynamicLibrary.cpp into
System/Unix/DynamicLibrary.inc.
llvm-svn: 74927
2009-07-07 18:17:07 +00:00
Chris Lattner
5ceb2cb005
remove dead code, noone creates instances of "DynamicLibrary", so the ctor and dtor are dead.
...
llvm-svn: 74926
2009-07-07 18:01:58 +00:00
Chris Lattner
4efb280fb0
we don't use libtool anymore, update comments.
...
llvm-svn: 74924
2009-07-07 17:50:11 +00:00