Commit Graph

749 Commits

Author SHA1 Message Date
Michael J. Spencer b39a89716f Fix Whitespace.
llvm-svn: 118683
2010-11-10 15:06:00 +00:00
Michael J. Spencer 909d238eba System/Win32/Path: Implement isSymLink.
llvm-svn: 118681
2010-11-10 15:05:39 +00:00
NAKAMURA Takumi 23ebef1456 Win32/Process.inc: [PR8527] Process::FileDescriptorIsDisplayed(fd) should not check by FILE_TYPE_CHAR. It must be better to check it with Console API.
The special file "NUL" is FILE_TYPE_CHAR with GetFileType(h). It was treated as display device and discarding output to NUL had failed. (eg. opt -o nul)

llvm-svn: 118678
2010-11-10 08:37:47 +00:00
Michael J. Spencer d7e3b54635 System/Path/Windows: Implement GetLLVMDefaultConfigDir.
llvm-svn: 118507
2010-11-09 15:11:42 +00:00
Michael J. Spencer 86cdb42737 System/Path/Windows: Generalize GetUserHomeDirectory.
llvm-svn: 118506
2010-11-09 15:11:31 +00:00
Michael J. Spencer 181fd8cd89 System/Path/Windows: Make GetSystemLibraryPaths more generic.
llvm-svn: 118505
2010-11-09 15:11:19 +00:00
Michael J. Spencer bb6e51c957 System/Windows: Reduce dependencies.
llvm-svn: 118504
2010-11-09 15:11:07 +00:00
Michael J. Spencer 8daf3c00c9 System/Windows: Use normalized case and include method.
llvm-svn: 118503
2010-11-09 15:10:56 +00:00
Michael J. Spencer df929cf8df System/Path/Windows: Change GetRootDirectory to return file:/// instead of C:/.
llvm-svn: 118502
2010-11-09 15:10:45 +00:00
Michael J. Spencer 4b263dddc4 Update comment.
llvm-svn: 118501
2010-11-09 15:10:29 +00:00
Owen Anderson 1fc8ec1d4b Fix PR8441, a thread unsafe static variable in our dynamic library loading facilities.
llvm-svn: 118463
2010-11-09 00:36:06 +00:00
Michael J. Spencer 023270e453 Remove contributor names as per coding statndard.
llvm-svn: 118442
2010-11-08 20:56:32 +00:00
Rafael Espindola 559b8fbffc Add method for checking if a path is a symbolic link.
llvm-svn: 118367
2010-11-07 04:36:50 +00:00
Daniel Dunbar cdd4c5443e System: Add llvm_execute_on_thread, which does what it says.
- Primarily useful for running some code with a specified stack size, when
   pthreads are available.

llvm-svn: 118222
2010-11-04 01:26:25 +00:00
Dan Gohman a3bb142db6 Delete unused variables.
llvm-svn: 118128
2010-11-03 00:09:12 +00:00
Dan Gohman ecc4d73498 Remove several unhelpful checks for isValid from sys::Path.
llvm-svn: 118127
2010-11-03 00:01:23 +00:00
Dan Gohman c0a8bee4b0 Don't try to enforce MAXPATHLEN in sys::Path for Unix. OS's can check
limits on their own.

llvm-svn: 118113
2010-11-02 23:19:55 +00:00
Dan Gohman a8b6315cd7 Simplify.
llvm-svn: 118110
2010-11-02 23:16:26 +00:00
Dan Gohman 6e05d6c218 Fix a copy+pasto.
llvm-svn: 118106
2010-11-02 22:56:51 +00:00
Dan Gohman a47bfef1bf Avoid manipulating paths in fixed-sized arrays.
llvm-svn: 118105
2010-11-02 22:55:34 +00:00
Dan Gohman 32d51fa0b5 Simplify this code.
llvm-svn: 118102
2010-11-02 22:50:10 +00:00
Dan Gohman f6e13ceb2b Use '\0' instead of 0 for nul character constants.
llvm-svn: 118096
2010-11-02 22:41:19 +00:00
Mikhail Glushenkov 7282901079 appendSuffix: don't append a dot when the suffix is empty.
Additionally, move the implementation of appendSuffix to Path.cpp: it is
platform-independent.

llvm-svn: 118089
2010-11-02 22:18:37 +00:00
Dan Gohman 44e24e5403 Eliminate some temporary std::strings.
llvm-svn: 118086
2010-11-02 22:07:47 +00:00
Dan Gohman bba85850e3 Micro-optimize.
llvm-svn: 118058
2010-11-02 20:52:47 +00:00
Mikhail Glushenkov 2c3991acf3 GetDLLSuffix: Remove the leading dot from LTDL_SHLIB_EXT.
This allows using GetDLLSuffix() with appendSuffix().

llvm-svn: 118051
2010-11-02 20:32:59 +00:00
Mikhail Glushenkov a581d8a27a Make FindProgramByName return paths with slashes unmodified on Windows.
This makes its behaviour more consistent across platforms.

llvm-svn: 118048
2010-11-02 20:32:39 +00:00
Mikhail Glushenkov b4921a035e 80-col violations.
llvm-svn: 118045
2010-11-02 20:32:31 +00:00
Mikhail Glushenkov fcfaf51e52 Path: Add GetEXESuffix() to complement GetDLLSuffix().
llvm-svn: 118042
2010-11-02 20:32:26 +00:00
Dan Gohman 5bc07d2bce Check if ErrMsg is null. This fixes the "not" command.
llvm-svn: 117666
2010-10-29 17:20:42 +00:00
Dan Gohman fc81579b5e Make Program::Wait differentiate execution failure due to the file
being not found from the file being not executable. 

llvm-svn: 117664
2010-10-29 16:54:25 +00:00
Dan Gohman cae3c53b31 Make Program::Wait provide an error message string for errors
executing the child process and abnormal child process termination.

llvm-svn: 117661
2010-10-29 16:39:01 +00:00
Dan Gohman 47215f4e04 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.)

llvm-svn: 117596
2010-10-28 20:34:33 +00:00
Mikhail Glushenkov d7faab5c95 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).

llvm-svn: 117582
2010-10-28 19:32:58 +00:00
Mikhail Glushenkov 0e9d9b51eb Trailing whitespace.
llvm-svn: 117581
2010-10-28 19:32:53 +00:00
Mikhail Glushenkov 080d86fecc Reindent.
llvm-svn: 117538
2010-10-28 08:25:44 +00:00
Mikhail Glushenkov 258b8e1dc8 80-col violation.
llvm-svn: 117443
2010-10-27 09:09:10 +00:00
Mikhail Glushenkov 32acd741d2 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

llvm-svn: 117442
2010-10-27 09:09:04 +00:00
Duncan Sands 08745f5483 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.

llvm-svn: 117262
2010-10-25 13:10:03 +00:00
NAKAMURA Takumi 3f688b92a9 Win32/Signals.inc: DontRemoveFileOnSignal(): Please acquire the CriticalSection.
It choked BugPoint on Mingw.

llvm-svn: 117083
2010-10-22 01:23:50 +00:00
Mikhail Glushenkov f64d93df79 Trailing whitespace.
llvm-svn: 117058
2010-10-21 20:40:39 +00:00
Michael J. Spencer dc47d592e7 Use C++03...
llvm-svn: 116927
2010-10-20 16:00:45 +00:00
Michael J. Spencer 9748310eab 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.

llvm-svn: 116925
2010-10-20 15:23:58 +00:00
Chandler Carruth 1898262a33 Remove remaining uses of ATTRIBUTE_UNUSED on variables, and delete three
#includes in the process.

llvm-svn: 116919
2010-10-20 08:27:02 +00:00
NAKAMURA Takumi ffea0abe81 Add ATTRIBUTE_UNUSED for -Asserts.
llvm-svn: 116909
2010-10-20 04:05:29 +00:00
NAKAMURA Takumi 898fbd82a5 lib/System/Win32/ThreadLocal.inc: Suppress "unused" warning on -Asserts.
llvm-svn: 116785
2010-10-19 01:22:01 +00:00
Oscar Fuentes 889c1e7d80 Build with RTTI and exceptions disabled. Only in GCC for now.
llvm-svn: 116682
2010-10-17 02:26:16 +00:00
Oscar Fuentes ffe32e1137 When building shared libraries, link to required system libraries.
PR 8375

llvm-svn: 116479
2010-10-14 15:54:41 +00:00
Daniel Dunbar fe2a89683a Change explicit search Apple specific code to only reference __eprintf on x86.
llvm-svn: 116239
2010-10-11 21:34:24 +00:00
Daniel Dunbar cc0e18dd4a CrashRecovery: Fix raise() override to actually send the right signal, *cough*.
llvm-svn: 116072
2010-10-08 18:31:34 +00:00