Commit Graph

101 Commits

Author SHA1 Message Date
Benjamin Kramer dfaa0f3a81 Try to unbreak the windows build.
llvm-svn: 160567
2012-07-20 19:49:33 +00:00
Daniel Dunbar 712de82154 Process: Add sys::Process::FileDescriptorHasColors().
llvm-svn: 160557
2012-07-20 18:29:38 +00:00
Bill Wendling 2b07965042 Remove tabs.
llvm-svn: 160476
2012-07-19 00:06:06 +00:00
Francois Pichet 5dc987a3d1 Unbreak the MSVC build: add return to unimplemented functions.
llvm-svn: 158788
2012-06-20 04:08:49 +00:00
Nick Kledzik 18497e9242 Add permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs and add unit test. Unix is implemented. Windows side needs to be implemented.
llvm-svn: 158770
2012-06-20 00:28:54 +00:00
Argyrios Kyrtzidis c6dc4d75fd Satisfy C++ aliasing rules, per suggestion by Chandler.
llvm-svn: 158346
2012-06-12 01:06:16 +00:00
Argyrios Kyrtzidis 8d19c86c9a For llvm::sys::ThreadLocalImpl instead of malloc'ing the platform-specific
thread local data, embed them in the class using a uint64_t and make sure
we get compiler errors if there's a platform where this is not big enough.

This makes ThreadLocal more safe for using it in conjunction with CrashRecoveryContext.

Related to crash in rdar://11434201.

llvm-svn: 158342
2012-06-12 00:21:31 +00:00
Aaron Ballman 36a978cca2 Disabling a spurious deprecation warning about using PathV1 from within the PathV1 implementation file.
llvm-svn: 158274
2012-06-09 13:59:29 +00:00
Aaron Ballman 503bbff367 Fixing a typo in the comments.
llvm-svn: 158273
2012-06-09 13:46:36 +00:00
NAKAMURA Takumi b030e8a5c8 Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, to check when someone would remove the tempdir.
llvm-svn: 157529
2012-05-27 13:02:04 +00:00
Eric Christopher b6148ed72c Allow unique_file to take a mode for file permissions, but default
to user only read/write.

Part of rdar://11325849

llvm-svn: 156591
2012-05-11 00:07:44 +00:00
NAKAMURA Takumi 3b7f995b75 Windows/PathV2.inc: Retry rename() for (maximum) 2 seconds.
Files might be opend by system scanners (eg. file indexer, virus scanner, &c).

llvm-svn: 156380
2012-05-08 14:31:46 +00:00
Benjamin Kramer 13d16f3bf3 Reapply 'Add reverseColor to raw_ostream'.
To be used in printing unprintable source in clang diagnostics.
Patch by Seth Cantrell, with a minor fix for mingw by me.

llvm-svn: 154805
2012-04-16 08:56:50 +00:00
Argyrios Kyrtzidis 64104f16d4 Revert r154800 which breaks windows builders.
llvm-svn: 154802
2012-04-16 07:59:39 +00:00
Argyrios Kyrtzidis d17db2e0ee Add reverseColor to raw_ostream.
To be used in printing unprintable source in clang diagnostics.
Patch by Seth Cantrell!

llvm-svn: 154800
2012-04-16 07:07:38 +00:00
David Blaikie 18544b9614 Change default error_code ctor to a 'named ctor' so it's more self-documenting.
Unify default construction of error_code uses on this idiom so that users don't
feel compelled to make static globals for naming convenience. (unfortunately I
couldn't make the original ctor private as some APIs don't return their result,
instead using an out parameter (that makes sense to default construct) - which
is a bit of a pity. I did, however, find/fix some cases of unnecessary default
construction of error_code before I hit the unfixable cases)

llvm-svn: 150197
2012-02-09 19:24:12 +00:00
Chandler Carruth da22f30e72 Remove SetWorkingDirectory from the Process interface. Nothing in LLVM
or Clang is using this, and it would be hard to use it correctly given
the thread hostility of the function. Also, it never checked the return
which is rather dangerous with chdir. If someone was in fact using this,
please let me know, as well as what the usecase actually is so that
I can add it back and make it more correct and secure to use. (That
said, it's never going to be "safe" per-se, but we could at least
document the risks...)

llvm-svn: 148211
2012-01-15 08:41:35 +00:00
Argyrios Kyrtzidis cd8fe08e4d Disable the crash reporter when running lit tests.
llvm-svn: 147965
2012-01-11 20:53:25 +00:00
Sebastian Pop 99ab273a77 revert r147542 after comments from Joerg Sonnenberger
llvm-svn: 147608
2012-01-05 18:28:46 +00:00
Sebastian Pop 0f357d6c22 use getHostTriple instead of getDefaultTargetTriple in getClosestTargetForJIT
Get back getHostTriple.

For JIT compilation, use the host triple instead of the default
target: this fixes some JIT testcases that used to fail when the
compiler has been configured as a cross compiler.

llvm-svn: 147542
2012-01-04 19:47:22 +00:00
Michael J. Spencer a2755f8efa Support/Program: Make Change<stream>ToBinary return error_code.
llvm-svn: 146522
2011-12-13 23:16:49 +00:00
Chad Rosier 531042840d Revert r146363 to allow buildbots to make forward progress.
Original commit message:
Support/FileSystem: Implement canonicalize.

llvm-svn: 146378
2011-12-12 17:58:31 +00:00
Michael J. Spencer 203d7807a8 Support/FileSystem: Implement bool equivalent(file_status A, file_status B);
llvm-svn: 146364
2011-12-12 06:04:28 +00:00
Michael J. Spencer 32ef4d2e1b Support/FileSystem: Implement canonicalize.
llvm-svn: 146363
2011-12-12 06:04:01 +00:00
Michael J. Spencer 513f1b666f Support/Windows: Cleanup scoped handles.
llvm-svn: 146362
2011-12-12 06:03:33 +00:00
Michael J. Spencer 0a7625d661 Support/FileSystem: Implement recursive_directory_iterator and make
directory_iterator preserve InputIterator semantics on copy.

llvm-svn: 146200
2011-12-08 22:50:09 +00:00
NAKAMURA Takumi 64404a3b2c [Win32] Catch exceptions (eg. segfault) on waiting for invoked clang from the driver.
clang/lib/Driver/Driver.cpp: Don't pass through negative exit status, or parent would be confused.

llvm::sys::Program::Wait(): Suppose 0x8000XXXX and 0xC000XXXX as abnormal exit code and pass it as negative value.

Win32 Exception Handler: Exit with ExceptionCode on an unhandle exception.

llvm-svn: 145389
2011-11-29 07:47:04 +00:00
Peter Collingbourne bf025fdb54 Return only the least significant 8 bits of the exit status from
Process::Wait on Windows (mimicing POSIX behaviour).

llvm-svn: 143876
2011-11-06 16:45:46 +00:00
Sebastian Pop 94441fbad7 rename getHostTriple into getDefaultTargetTriple
llvm-svn: 143502
2011-11-01 21:32:20 +00:00
Sebastian Pop ec2fb226d8 rename LLVM_HOSTTRIPLE into LLVM_DEFAULT_TARGET_TRIPLE
llvm-svn: 143501
2011-11-01 21:31:44 +00:00
Eli Friedman 39df70c33a Remove a couple unused methods. PR11201.
llvm-svn: 143452
2011-11-01 05:11:01 +00:00
NAKAMURA Takumi 66c9e4ffd5 Windows/Path.inc: [PR8460] Get rid of ScopedNullTerminator. Thanks to Zvi Rackover!
llvm-svn: 142785
2011-10-24 03:27:19 +00:00
Anton Korobeynikov b27f11e01d Fix build on mingw-w64.
Patch by Ruben Van Boxem!

llvm-svn: 142646
2011-10-21 09:38:50 +00:00
NAKAMURA Takumi ea97a05fc5 Revert r142046, "Fix for llvm::sys::getHostTriple on Windows. Instead of relying on the triple"
It extremely breaks builds when optimization is enabled. Twine should not hold temporary objects.

By the way, I might feel sad if I saw "i786-" "i1586-" or "iF86-".

llvm-svn: 142055
2011-10-15 04:29:36 +00:00
Chad Rosier 559b8f2ae9 Fix for llvm::sys::getHostTriple on Windows. Instead of relying on the triple
from config.h, it discovers the triple based on the execution environment.

Patch by Aaron Ballman <aaron@aaronballman.com>

llvm-svn: 142046
2011-10-15 02:10:06 +00:00
NAKAMURA Takumi 7bc976a8ef Windows/Memory.inc: Support the ability to allocate memory "near" another block of memory on Win32. It has fixed FIXME.
Thanks to Aaron Ballman!

llvm-svn: 142039
2011-10-15 01:58:16 +00:00
Michael J. Spencer a7a90bfdab Support/Windows: Add support modifying memory permissions on Windows. Patch by Aaron Ballman!
llvm-svn: 141910
2011-10-13 23:16:01 +00:00
Michael J. Spencer 0084615924 Support/Windows: Add efficent RW mutex on Windows. Patch by Aaron Ballman!
llvm-svn: 141907
2011-10-13 23:10:56 +00:00
Michael J. Spencer 44a36c872e Add Windows x64 stack walking support. Patch by Aaron Ballman!
llvm-svn: 140906
2011-10-01 00:05:20 +00:00
Daniel Dunbar 9b92e2be30 sys::Process: Add a SetWorkingDirectory method.
llvm-svn: 140433
2011-09-23 23:23:36 +00:00
NAKAMURA Takumi fd6cb64c48 lib/Support/Windows/Windows.h: Update required IE ver. 0x0600 should be enough for Windows XP.
llvm-svn: 138319
2011-08-23 03:49:11 +00:00
Jordy Rose 5765f4c24c Make DynamicLibrary thread-safe w/r/t call to dlerror() after dlopen(). PR10718
llvm-svn: 138260
2011-08-22 19:01:52 +00:00
Benjamin Kramer 58994ec9b9 PathV2: Handle more reserved filenames on windows.
Patch by Aaron Ballman!

llvm-svn: 138213
2011-08-20 21:36:38 +00:00
NAKAMURA Takumi 613655f89c lib/Support/Windows/Windows.h: Require at least Windows XP(5.1) API. We will not support Windows 2000 any more.
llvm-svn: 138198
2011-08-20 06:35:31 +00:00
Jordy Rose 1a3ca9201a Unbork Windows build. Thanks, Francois.
llvm-svn: 137798
2011-08-17 00:59:50 +00:00
Jordy Rose a19917da7c Use DynamicLibrary instances as a way to get symbols from a specific library. Preparation for upcoming (preliminary) support for plugins for the static analyzer.
llvm-svn: 137791
2011-08-17 00:29:32 +00:00
Argyrios Kyrtzidis 348937de07 Add an optional 'bool makeAbsolute' in llvm::sys::fs::unique_file function.
If true and 'model' parameter is not an absolute path, a temp directory will be prepended.
Make it true by default to match current behaviour.

llvm-svn: 136310
2011-07-28 00:29:20 +00:00
NAKAMURA Takumi ee24d32071 Windows/DynamicLibrary.inc: Fix trivial warnings. Thanks to John Myers!
llvm-svn: 134812
2011-07-09 08:41:20 +00:00
Andrew Trick d5d0764b3b Have Program::Wait return -2 for crashed and timeouts instead of embedding
info in the error message. Per Dan's request.

llvm-svn: 131780
2011-05-21 00:56:46 +00:00
Andrew Trick 69005e5953 Typo and missing checkin from r131186.
llvm-svn: 131187
2011-05-11 16:44:08 +00:00