summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/LockFileManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Support/LockFileManager] Re-apply r203137 and r203138 but use symbolic ↵Argyrios Kyrtzidis2014-03-061-24/+56
| | | | | | | | links only on unix. Reid Kleckner pointed out that we can't use symbolic links on Windows. llvm-svn: 203162
* Revert create_symbolic_link and both depending changesReid Kleckner2014-03-061-32/+24
| | | | | | | | | | This reverts commits r203136, r203137, and r203138. This code doesn't build on Windows. Even on Vista+, Windows requires elevated privileges to create a symlink. Therefore we can't use symlinks in the compiler. We'll have to find another approach. llvm-svn: 203143
* [Support/LockFileManager] Make the LockFileManager more robust against races.Argyrios Kyrtzidis2014-03-061-17/+34
| | | | | | | | | | | There was a race where: - The LockFileManager tries to own the lock file and fails. - The other owner then releases and removes the lock file. - The LockFileManager tries to read the owner info from the lock file but fails now. In such a case have LockFileManager try to get ownership again, instead of error'ing out. llvm-svn: 203138
* [Support/LockFileManager] Use symbolic link for the lock file.Argyrios Kyrtzidis2014-03-061-13/+4
| | | | | | | | Hard links do not work on SMB network directories, and it causes us to fail to build clang module files if the module cache is in such a directory. rdar://15944959 llvm-svn: 203137
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-1/+1
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-021-1/+1
| | | | | | The old implementation is no longer needed in C++11. llvm-svn: 202644
* Use simpler version of sys::fs::exists when possible.Rafael Espindola2014-02-131-5/+3
| | | | llvm-svn: 201289
* Use the simpler version of sys::fs::remove when possible.Rafael Espindola2014-01-101-8/+5
| | | | llvm-svn: 198958
* Fix boolean logic in LockFileManager and test itReid Kleckner2013-08-071-8/+10
| | | | | | | | | | This fixes a bug from r187826. Reviewers: hans Differential Revision: http://llvm-reviews.chandlerc.com/D1304 llvm-svn: 187846
* Remove some std stream usage from Support and TableGenReid Kleckner2013-08-061-9/+13
| | | | | | | | | | LLVM's coding standards recommend raw_ostream and MemoryBuffer for reading and writing text. This has the side effect of allowing clang to compile more of Support and TableGen in the Microsoft C++ ABI. llvm-svn: 187826
* Add a createUniqueFile function and switch llvm's users of unique_file.Rafael Espindola2013-07-051-4/+3
| | | | | | | | | | | | | | This function is complementary to createTemporaryFile. It handles the case were the unique file is *not* temporary: we will rename it in the end. Since we will rename it, the file has to be in the same filesystem as the final destination and we don't prepend the system temporary directory. This has a small semantic difference from unique_file: the default mode is 0666. This matches the behavior of most unix tools. For example, with this change lld now produces files with the same permissions as ld. I will add a test of this change when I port clang over to createUniqueFile (next commit). llvm-svn: 185726
* <rdar://problem/13551789> Fix a race in the LockFileManager.Douglas Gregor2013-04-051-5/+32
| | | | | | | | It's possible for the lock file to disappear and the owning process to return before we're able to see the generated file. Spin for a little while to see if it shows up before failing. llvm-svn: 178909
* Provide a "None" value for convenience when using Optional<T>()David Blaikie2013-02-211-2/+2
| | | | | | | This implementation of NoneType/None does have some holes but I haven't found one that doesn't - open to improvement. llvm-svn: 175696
* Fix a race condition in the lock-file manager: once the lock file isDouglas Gregor2013-01-101-3/+13
| | | | | | gone, check for the actual file we care about. llvm-svn: 172033
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-1/+1
| | | | | | | | | | | | | | | | | 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
* Fix Android build of gtest and lib/Support.Evgeniy Stepanov2012-09-041-1/+1
| | | | llvm-svn: 163131
* Move Clang's file-level locking facility over to LLVM's supportDouglas Gregor2012-01-291-0/+216
library, since it doesn't really have anything to do with Clang. llvm-svn: 149203
OpenPOWER on IntegriCloud