summaryrefslogtreecommitdiff
path: root/lib/DirectoryWatcher
Commit message (Collapse)AuthorAgeFilesLines
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-142-3/+3
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368942 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][DirectoryWatcher] Fix Windows stub after LLVM changeJan Korous2019-08-131-2/+4
| | | | | | | | | r367979 changed DirectoryWatcher::Create to return an llvm::Expected. Adjust the Windows stub accordingly. (upstreamed from github.com/apple/swift-clang) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368762 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] DirectoryWatcher for Windows stubs (to fix build break).Jan Korous2019-08-132-0/+50
| | | | | | | | | This is just a code skeleton for DirectoryWatcher-windows.cpp so the build on Windows stops breaking. (upstreamed from github.com/apple/swift-clang) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368761 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove LLVM mutexes from clang in favor of std::mutexBenjamin Kramer2019-08-071-1/+0
| | | | | | | None of those need to be recursive mutexes. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368173 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][DirectoryWatcher][NFC] Swapping asserts for llvm fatal_error in createPuyan Lotfi2019-08-062-3/+9
| | | | | | | | | | | | | | | | | I also have replaced all the instances of "auto DW = DirectoryWatcher::create" with llvm::Expected<std::unique_ptr<DirectoryWatcher>> DW = DirectoryWatcher::create to make it more clear that DirectoryWatcher::create is returning an Expected. I've also allowed for logAllUnhandledErrors to consume errors in the case were DirectoryWatcher::create produces them. Differential Revision: https://reviews.llvm.org/D65829 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@368108 91177308-0d34-0410-b5e6-96231b3b80d8
* [DirectoryWatcher] Fix asserts Mac buildsShoaib Meenai2019-08-061-1/+1
| | | | | | | Add a missing semicolon after an assert. Remove the period from the assert message while I'm here, because we don't usually have those. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367984 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][DirectoryWatcher] Adding llvm::Expected error handling to create.Puyan Lotfi2019-08-063-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this patch Unix style errno error reporting from the inotify layer was used by DirectoryWatcher::create to simply return a nullptr on error. This would generally be ok, except that in LLVM we have much more robust error reporting through the facilities of llvm::Expected. The other critical thing I stumbled across was that the unit tests for DirectoryWatcher were not failing abruptly when inotify_init() was reporting an error, but would continue with the testing and eventually hit a deadlock in a pathological machine state (ie in the unit test, the return nullptr on ::create was ignored). Generally this pathological state never happens on any build bot, so it is totally understandable that it was overlooked, but on a Linux desktop running a dubious desktop environment (which I will not name) there is a chance that said desktop environment could use up enough inotify instances to exceed the user's limit. These are the conditions that led me to hit the deadlock I am addressing in this patch with more robust error handling. With the new llvm::Expected error handling when your system runs out of inotify instances for your user, the unit test will be forced to handle the error or crash and report the issue to the user instead of weirdly deadlocking on a condition variable wait. Differential Revision: https://reviews.llvm.org/D65704 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367979 91177308-0d34-0410-b5e6-96231b3b80d8
* [DirectoryWatcher][linux] Fix build for older kernelsJan Korous2019-08-051-2/+1
| | | | | | | | Apparently kernel support for IN_EXCL_UNLINK in inotify_add_watch() doesn't imply it's defined in sys/inotify.h. https://bugs.llvm.org/show_bug.cgi?id=42824 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367906 91177308-0d34-0410-b5e6-96231b3b80d8
* [DirectoryWatcher] Relax assumption to prevent test flakinessJan Korous2019-08-011-0/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367632 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Linux buildJF Bastien2019-07-291-1/+1
| | | | | | r367274 broke it git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367276 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] avoid AlignedCharArray in clangJF Bastien2019-07-291-5/+6
| | | | | | As discussed in D65249, don't use AlignedCharArray or std::aligned_storage. Just use alignas(X) char Buf[Size];. This will allow me to remove AlignedCharArray entirely, and works on the current minimum version of Visual Studio. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367274 91177308-0d34-0410-b5e6-96231b3b80d8
* [DirectoryWatcher][linux] Fix for older kernelsJan Korous2019-07-151-2/+7
| | | | | | | | IN_EXCL_UNLINK exists since Linux 2.6.36 Differential Revision: https://reviews.llvm.org/D64764 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366152 91177308-0d34-0410-b5e6-96231b3b80d8
* [DirectoryWatcher][NFC] Silence warnings in release buildJan Korous2019-07-121-1/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365968 91177308-0d34-0410-b5e6-96231b3b80d8
* [DirectoryWatcher][linux] Fix use of uninitialized valueJan Korous2019-07-121-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365966 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland [clang] DirectoryWatcherJan Korous2019-07-126-0/+709
| | | | | | | | | | This reverts commit f561227d133224d2d6a5a016abe4be051fa75501. - DirectoryWatcher - Fix the build for platforms that don't have DW implementated. - Fix the threading dependencies (thanks to compnerd). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365954 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Reland [clang] DirectoryWatcher"Jan Korous2019-07-126-709/+0
| | | | | | This reverts commit fdcb7f47e783933e0af8a5fae91132269a208268. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365948 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland [clang] DirectoryWatcherJan Korous2019-07-126-0/+709
| | | | | | | | This reverts commit abce8c457dd3de6b156756e547cc0eefb7653c79. + Fix the build for platforms that don't have DW implementated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365947 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert [clang] DirectoryWatcherReid Kleckner2019-07-095-688/+0
| | | | | | This reverts r365574 (git commit 31babea94a3ed38a140540f2252cf043dacec1f7) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365581 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] DirectoryWatcherJan Korous2019-07-095-0/+688
Asynchronously monitors specified directory for changes and passes notifications to provided callback. Dependency for index-while-building. Differential Revision: https://reviews.llvm.org/D58418 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365574 91177308-0d34-0410-b5e6-96231b3b80d8