summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix build on WindowsTimur Iskhodzhanov2013-05-151-0/+1
| | | | llvm-svn: 181873
* Use only explicit bool conversion operatorsDavid Blaikie2013-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | BitVector/SmallBitVector::reference::operator bool remain implicit since they model more exactly a bool, rather than something else that can be boolean tested. The most common (non-buggy) case are where such objects are used as return expressions in bool-returning functions or as boolean function arguments. In those cases I've used (& added if necessary) a named function to provide the equivalent (or sometimes negative, depending on convenient wording) test. One behavior change (YAMLParser) was made, though no test case is included as I'm not sure how to reach that code path. Essentially any comparison of llvm::yaml::document_iterators would be invalid if neither iterator was at the end. This helped uncover a couple of bugs in Clang - test cases provided for those in a separate commit along with similar changes to `operator bool` instances in Clang. llvm-svn: 181868
* Fixes a buffer overrun where the allocated buffer wasn't large enough to ↵Aaron Ballman2013-05-011-1/+8
| | | | | | accommodate the closing quote escape rules in some instances. llvm-svn: 180836
* [Support] Fix argv string escape bug on WindowsReid Kleckner2013-04-221-4/+42
| | | | | | | | | | | | | | | | Summary: This is http://llvm.org/PR15802. Backslashes preceding double quotes in arguments must be escaped. The interesting bit is that all other backslashes should *not* be escaped, because the un-escaping logic is only triggered by the presence of a double quote character. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D705 llvm-svn: 180035
* Add a function to check if an argument list is too long.Rafael Espindola2013-04-111-0/+16
| | | | | | | | | This will be used in clang to decide if it should create an @file or not. It will be tested on the clang side. Patch by Nathan Froyd. llvm-svn: 179285
* [Support] Disable assertion dialogs from the MSVC debug CRTReid Kleckner2013-04-051-0/+22
| | | | | | | | | | | | | | | | Summary: Sets a report hook that emulates pressing "retry" in the "abort, retry, ignore" dialog box that _CrtDbgReport normally raises. There are many other ways to disable assertion reports, but this was the only way I could find that still calls our exception handler. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D625 llvm-svn: 178880
* Add a new watchdog timer interface. The interface does not permit handling ↵Nick Lewycky2013-03-261-0/+24
| | | | | | | | | timeouts, so it's only really useful if you're going to crash anyways. Use it in the pretty stack trace printer to kill the compiler if we hang while printing the stack trace. llvm-svn: 177962
* [Support][Path][Windows] Fix dangling else. Don't call CloseHandle when ↵Michael J. Spencer2013-03-151-10/+10
| | | | | | CloseFD is false. llvm-svn: 177175
* [Support] Fix lifetime of file descriptors when using MemoryBuffer.Michael J. Spencer2013-03-141-14/+23
| | | | | | | Clients of MemoryBuffer::getOpenFile expect it not to take ownership of the file descriptor passed in. So don't. llvm-svn: 176995
* [Support][Path] Don't inf loop if creating the parent directory fails.Michael J. Spencer2013-03-121-1/+7
| | | | | | Patch by Paul Robinson. llvm-svn: 176908
* Add static cast to unsigned char whenever a character classification ↵Guy Benyei2013-02-121-1/+1
| | | | | | function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration. llvm-svn: 175006
* Move the internal PrintStackTrace function that is used for ↵Argyrios Kyrtzidis2013-01-091-0/+4
| | | | | | | | llvm::sys::PrintStackTraceOnErrorSignal(), into a new function llvm::sys::PrintStackTrace, so that it's available to clients for logging purposes. llvm-svn: 171989
* Fix an obvious typo spotted by Reid Kleckner, and breaking windows builds.Chandler Carruth2013-01-041-1/+1
| | | | llvm-svn: 171559
* Add time getters to the process interface for requesting the elapsedChandler Carruth2013-01-041-13/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wall time, user time, and system time since a process started. For walltime, we currently use TimeValue's interface and a global initializer to compute a close approximation of total process runtime. For user time, this adds support for an somewhat more precise timing mechanism -- clock_gettime with the CLOCK_PROCESS_CPUTIME_ID clock selected. For system time, we have to do a full getrusage call to extract the system time from the OS. This is expensive but unavoidable. In passing, clean up the implementation of the old APIs and fix some latent bugs in the Windows code. This might have manifested on Windows ARM systems or other systems with strange 64-bit integer behavior. The old API for this both user time and system time simultaneously from a single getrusage call. While this results in fewer system calls, it also results in a lower precision user time and if only user time is desired, it introduces a higher overhead. It may be worthwhile to switch some of the pass timers to not track system time and directly track user and wall time. The old API also tracked walltime in a confusing way -- it just set it to the current walltime rather than providing any measure of wall time since the process started the way buth user and system time are tracked. The new API is more consistent here. The plan is to eventually implement these methods for a *child* process by using the wait3(2) system call to populate an rusage struct representing the whole subprocess execution. That way, after waiting on a child process its stats will become accurate and cheap to query. llvm-svn: 171551
* Remove an unused method on Program.Chandler Carruth2012-12-311-17/+0
| | | | | | | I'm simplifying this interface as much as I can before merging it with the new process interface. llvm-svn: 171334
* Remove an unused method on the Program class.Chandler Carruth2012-12-311-5/+0
| | | | llvm-svn: 171332
* Flesh out a page size accessor in the new API.Chandler Carruth2012-12-311-8/+6
| | | | | | | | Implement the old API in terms of the new one. This simplifies the implementation on Windows which can now re-use the self_process's once initialization. llvm-svn: 171330
* Remove an unused function in the old Process interface.Chandler Carruth2012-12-311-8/+0
| | | | llvm-svn: 171327
* Switch this code to a more idiomatic double using namespace directive.Chandler Carruth2012-12-311-3/+1
| | | | | | | | Fix a truly odd namespace qualifier that was flat out wrong in the process. The fully qualified namespace would have been llvm::sys::TimeValue, llvm::TimeValue makes no sense. llvm-svn: 171292
* Begin sketching out the process interface.Chandler Carruth2012-12-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | The coding style used here is not LLVM's style because this is modeled after a Boost interface and thus done in the style of a candidate C++ standard library interface. I'll probably end up proposing it as a standard C++ library if it proves to be reasonably portable and useful. This is just the most basic parts of the interface -- getting the process ID out of it. However, it helps sketch out some of the boiler plate such as the base class, derived class, shared code, and static factory function. It also introduces a unittest so that I can incrementally ensure this stuff works. However, I've not even compiled this code for Windows yet. I'll try to fix any Windows fallout from the bots, and if I can't fix it I'll revert and get someone on Windows to help out. There isn't a lot more that is mandatory, so soon I'll switch to just stubbing out the Windows side and get Michael Spencer to help with implementation as he can test it directly. llvm-svn: 171289
* Add a comment about the requirement that the Windows.h header be last.Chandler Carruth2012-12-041-0/+2
| | | | | | | This comment has the dual effect of blocking reorderings with the sort_include script. llvm-svn: 169221
* [Support][FileSystem] Fix open mode in resize_file on Windows.Michael J. Spencer2012-12-031-1/+1
| | | | llvm-svn: 169166
* Revert the header sort on this file.Michael J. Spencer2012-12-031-1/+1
| | | | | | | | "Windows.h" includes <Windows.h> which defines a bunch of stuff it shouldn't (even with all the restriction macros). We have no control over this file, so make it's scope as small as possible. llvm-svn: 169165
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-035-8/+8
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.Chandler Carruth2012-11-301-1/+1
| | | | | | | | | | | | | | Rationale: 1) This was the name in the comment block. ;] 2) It matches Clang's __has_feature naming convention. 3) It matches other compiler-feature-test conventions. Sorry for the noise. =] I've also switch the comment block to use a \brief tag and not duplicate the name. llvm-svn: 168996
* Fix a -Wparentheses warning in the mingw buildNico Weber2012-09-251-1/+1
| | | | llvm-svn: 164587
* This patch adds memory support functions which will later be used to ↵Andrew Kaylor2012-09-191-26/+139
| | | | | | implement section-specific protection handling in MCJIT. llvm-svn: 164249
* Properly test the LLVM_USE_RVALUE_REFERENCES macro.Michael J. Spencer2012-08-151-1/+1
| | | | llvm-svn: 161978
* [PathV2] Add mapped_file_region. Implementation for Windows and POSIX.Michael J. Spencer2012-08-151-0/+199
| | | | llvm-svn: 161976
* Try to unbreak the windows build.Benjamin Kramer2012-07-201-1/+1
| | | | llvm-svn: 160567
* Process: Add sys::Process::FileDescriptorHasColors().Daniel Dunbar2012-07-201-4/+8
| | | | llvm-svn: 160557
* Remove tabs.Bill Wendling2012-07-192-4/+4
| | | | llvm-svn: 160476
* Unbreak the MSVC build: add return to unimplemented functions.Francois Pichet2012-06-201-0/+2
| | | | llvm-svn: 158788
* Add permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs ↵Nick Kledzik2012-06-201-0/+46
| | | | | | and add unit test. Unix is implemented. Windows side needs to be implemented. llvm-svn: 158770
* Satisfy C++ aliasing rules, per suggestion by Chandler.Argyrios Kyrtzidis2012-06-121-1/+1
| | | | llvm-svn: 158346
* For llvm::sys::ThreadLocalImpl instead of malloc'ing the platform-specificArgyrios Kyrtzidis2012-06-121-7/+6
| | | | | | | | | | | 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
* Disabling a spurious deprecation warning about using PathV1 from within the ↵Aaron Ballman2012-06-091-0/+10
| | | | | | PathV1 implementation file. llvm-svn: 158274
* Fixing a typo in the comments.Aaron Ballman2012-06-091-1/+1
| | | | llvm-svn: 158273
* Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, ↵NAKAMURA Takumi2012-05-271-1/+3
| | | | | | to check when someone would remove the tempdir. llvm-svn: 157529
* Allow unique_file to take a mode for file permissions, but defaultEric Christopher2012-05-111-2/+4
| | | | | | | | to user only read/write. Part of rdar://11325849 llvm-svn: 156591
* Windows/PathV2.inc: Retry rename() for (maximum) 2 seconds.NAKAMURA Takumi2012-05-081-4/+14
| | | | | | Files might be opend by system scanners (eg. file indexer, virus scanner, &c). llvm-svn: 156380
* Reapply 'Add reverseColor to raw_ostream'.Benjamin Kramer2012-04-161-0/+32
| | | | | | | 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
* Revert r154800 which breaks windows builders.Argyrios Kyrtzidis2012-04-161-33/+0
| | | | llvm-svn: 154802
* Add reverseColor to raw_ostream.Argyrios Kyrtzidis2012-04-161-0/+33
| | | | | | | To be used in printing unprintable source in clang diagnostics. Patch by Seth Cantrell! llvm-svn: 154800
* Change default error_code ctor to a 'named ctor' so it's more self-documenting.David Blaikie2012-02-091-21/+21
| | | | | | | | | | | 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
* Remove SetWorkingDirectory from the Process interface. Nothing in LLVMChandler Carruth2012-01-151-4/+0
| | | | | | | | | | | | 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
* Disable the crash reporter when running lit tests.Argyrios Kyrtzidis2012-01-111-1/+1
| | | | llvm-svn: 147965
* revert r147542 after comments from Joerg SonnenbergerSebastian Pop2012-01-051-4/+0
| | | | llvm-svn: 147608
* use getHostTriple instead of getDefaultTargetTriple in getClosestTargetForJITSebastian Pop2012-01-041-0/+4
| | | | | | | | | | 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
* Support/Program: Make Change<stream>ToBinary return error_code.Michael J. Spencer2011-12-131-6/+12
| | | | llvm-svn: 146522
OpenPOWER on IntegriCloud