Commit Graph

720 Commits

Author SHA1 Message Date
Dan Gohman
3545635a60 Check if ErrMsg is null. This fixes the "not" command.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 17:20:42 +00:00
Dan Gohman
e5f77cda25 Make Program::Wait differentiate execution failure due to the file
being not found from the file being not executable. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 16:54:25 +00:00
Dan Gohman
695e85d477 Make Program::Wait provide an error message string for errors
executing the child process and abnormal child process termination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29 16:39:01 +00:00
Dan Gohman
24a492683c Revert r117582, which reverted r77396. Searching PATH for a string
which contains slashes is inconsistent with the meaning of PATH on
Unix-type platforms, and pretty surprising.

If the user has given a specific path to execute and we can't
execute it, we should fail and say why.  (Apparently the new
posix_spawn code doesn't always say why, but that's a separate
issue.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117596 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 20:34:33 +00:00
Mikhail Glushenkov
c61c7549a8 Revert r77396.
Original commit message:

    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.

It's better when behaviour is consistent between platforms. This change also
makes FindExecutable() behave as expected on unix-likes (before this commit, it
used to always succeed).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117582 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 19:32:58 +00:00
Mikhail Glushenkov
7289d06e48 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 19:32:53 +00:00
Mikhail Glushenkov
6d8ac5ac6d Reindent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 08:25:44 +00:00
Mikhail Glushenkov
401b90a4bc 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 09:09:10 +00:00
Mikhail Glushenkov
11d03f690e Remove try/catch(...) from Win32/Signals.inc.
catch(...) is used in Win32/Signals.inc for catching Win32 structured
exceptions, but according to [1], this is wrong.

We can't simply change try/catch to __try/__finally, since this syntax is not
supported by MinGW. We can use __try/__finally on MSVC and __try1/__except1
macros on MinGW [2], but I think that that solution obfuscates the code too
much.

The use of try/catch(...) in Signals.inc makes it impossible to link
MinGW-compiled libSystem with llvm-gcc compiled executables. I propose that we
just remove try/catch(...) from Signals.inc, since the meaning of the code won't
change.

[1] http://members.cox.net/doug_web/eh.htm
[2] http://article.gmane.org/gmane.comp.compilers.llvm.cvs/81315

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117442 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 09:09:04 +00:00
Duncan Sands
05897c8f26 ATTRIBUTE_UNUSED has been renamed to LLVM_ATTRIBUTE_UNUSED.
Rather than rename this instance, use the cast-to-void idiom
instead.  This will hopefully fix the windows buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 13:10:03 +00:00
NAKAMURA Takumi
2172f3cd97 Win32/Signals.inc: DontRemoveFileOnSignal(): Please acquire the CriticalSection.
It choked BugPoint on Mingw.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 01:23:50 +00:00
Mikhail Glushenkov
84ba14f6d0 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21 20:40:39 +00:00
Michael J. Spencer
9f608b1919 Use C++03...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116927 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 16:00:45 +00:00
Michael J. Spencer
a9cf7b8443 System-Win32/Path: Fix incorrect assumption in isValid.
A recent commit to clang exposed a bug in the Win32 Path code. This is a
minimal fix for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 15:23:58 +00:00
Chandler Carruth
1cd9708f5c Remove remaining uses of ATTRIBUTE_UNUSED on variables, and delete three
#includes in the process.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 08:27:02 +00:00
NAKAMURA Takumi
f10c519249 Add ATTRIBUTE_UNUSED for -Asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 04:05:29 +00:00
NAKAMURA Takumi
5c0db76cf2 lib/System/Win32/ThreadLocal.inc: Suppress "unused" warning on -Asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116785 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 01:22:01 +00:00
Oscar Fuentes
f0c55a9b97 Build with RTTI and exceptions disabled. Only in GCC for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116682 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-17 02:26:16 +00:00
Oscar Fuentes
00a9618458 When building shared libraries, link to required system libraries.
PR 8375

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116479 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14 15:54:41 +00:00
Daniel Dunbar
1086c2b5da Change explicit search Apple specific code to only reference __eprintf on x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116239 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11 21:34:24 +00:00
Daniel Dunbar
95b4672234 CrashRecovery: Fix raise() override to actually send the right signal, *cough*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-08 18:31:34 +00:00
Evan Cheng
a98111cf15 Correctly check if a path is a directory. Fix by Brian Korver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-07 22:05:57 +00:00
NAKAMURA Takumi
a8bbe707dc lib/System/Win32/Signals.inc: Enable LLVM_DISABLE_CRT_DEBUG also on mingw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06 02:15:22 +00:00
Daniel Dunbar
a7e3b56477 Add an explicit initialization to work around what appears to be a valgrind
false positive, at least on Darwin. I haven't filed this, but you can feel free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 23:56:49 +00:00
Francois Pichet
3eddd98be3 Revert r114320(move file = copy + delete on Win32). r115040 is a better solution for the Win32 ACCESS_DENIED lit error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115114 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 00:44:58 +00:00
Daniel Dunbar
e4e06a86bc CrashRecovery/Darwin: Override raise() as well so that crash recovery doesn't
end up altering the thread on which crashes are done because of its use of
Darwin's broken raise() implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 17:46:10 +00:00
Francois Pichet
345adbe572 Fix the "unable to rename temporary" lit test failing on Windows. rename is now copy + delete on Windows. Problem to be revisited for a permanent and clean solution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114320 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 04:03:07 +00:00
Jakob Stoklund Olesen
71c6095814 Add one more Core i7 model number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-19 17:54:28 +00:00
Chris Lattner
222920d667 add corei7, the laptop version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114302 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-19 00:31:58 +00:00
NAKAMURA Takumi
4cec6e2103 Move the declaration SetInformationJobObject() outside of namespace.
It is also workaround for PR7927.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 11:14:18 +00:00
Daniel Dunbar
7ca6e73e7f System: Don't reexport ___eprintf when building with Clang; this symbol isn't
used on Darwin anymore, and Clang might not always link with the library it is
currently found in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 04:25:24 +00:00
Michael J. Spencer
7e7d01de9c System/Path: Add x86-64 COFF to IdentifyFileType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 23:04:14 +00:00
Michael J. Spencer
8a26f81889 System/Path: Add isObjectFile().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 22:45:45 +00:00
NAKAMURA Takumi
d4d4c7fd0d lib/System/Host.cpp: 7bit-ize. Eliminate "TM" and "(R)" in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113486 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 13:30:48 +00:00
Dan Gohman
b52d44a0e6 Issue a #error if the host doesn't have an implementation for
GetMainExecutable yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07 18:26:49 +00:00
Chris Lattner
9c7f075270 compute the HasSSE3 bit correctly, patch by Nikolai Saoukh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113147 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-06 05:19:44 +00:00
Dan Gohman
86759acf01 Apply a patch from Kees van Reeuwijk to add support for Minix.
Minix apparently doesn't like double-slash separators, and there's
no apparent need for them here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112844 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:24:46 +00:00
Dan Gohman
41154114f6 Add an interface for unregistering a file from the FilesToRemove list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-01 14:17:34 +00:00
Anton Korobeynikov
1d76ab7f56 Some fixes for NetBSD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112662 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:38:00 +00:00
Michael J. Spencer
4a295d301d Cleanup Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 06:36:46 +00:00
Michael J. Spencer
1211d43abf System: Fix getMagicNumber on windows.
getMagicNumber was treating the _binary_ data it read in as a
null terminated string. This resulted in the std::string
calculating the length, and causing an assert in other code that
assumed that the length it passed was the same as the length of
the string it would get back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 06:36:33 +00:00
Michael J. Spencer
44edb0bd0c Don't cast Win32 FILETIME structs to int64. Patch by Dimitry Andric!
According to the Microsoft documentation here:
http://msdn.microsoft.com/en-us/library/ms724284%28VS.85%29.aspx

this cast used in lib/System/Win32/Path.inc:

__int64 ft = *reinterpret_cast<__int64*>(&fi.ftLastWriteTime);

should not be done.  The documentation says: "Do not cast a pointer to a
FILETIME structure to either a ULARGE_INTEGER* or __int64* value because
it can cause alignment faults on 64-bit Windows."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 16:39:32 +00:00
Daniel Dunbar
b0270147b6 Fix --disable-threads build, PR7949.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111676 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 20:54:37 +00:00
Daniel Dunbar
b08ceb8135 CrashRecovery/Darwin: On Darwin, raise sends a signal to the main thread instead
of the current thread. This has the unfortunate effect that assert() and abort()
will end up bypassing our crash recovery attempts. We work around this for
anything in the same linkage unit by just defining our own versions of the
assert handler and abort.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-19 23:45:39 +00:00
Chris Lattner
6ccd0da0fe Fix failure of unittests/ExecutionEngine/JIT/MultiJITTest.cpp on
cygwin when built with ENABLE_SHARED=1.  Patch by NAKAMURA Takumi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111231 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-17 15:42:43 +00:00
Chandler Carruth
0db86fe097 Mark this variable as used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 10:39:25 +00:00
Chris Lattner
60e72d9ebc remove code setting rw locks to PTHREAD_PROCESS_PRIVATE, which
is the default.  Patch by NAKAMURA Takumi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 00:34:06 +00:00
Dan Gohman
d98af0a5b8 Eliminate unnecessary empty string literals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-04 01:39:08 +00:00
Owen Anderson
826c148aa5 Add an erase() method to llvm::ThreadLocal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 22:49:43 +00:00
Duncan Sands
3dc7224379 Rather than using an ifdef on the target to zero out fields,
just use memset to zero the entire struct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108330 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 14:32:33 +00:00