[clang][DirectoryWatcher][NFC] Swapping asserts for llvm fatal_error in create
authorPuyan Lotfi <puyan@puyan.org>
Tue, 6 Aug 2019 23:25:34 +0000 (23:25 +0000)
committerPuyan Lotfi <puyan@puyan.org>
Tue, 6 Aug 2019 23:25:34 +0000 (23:25 +0000)
commit1dcf216f9fa662a3a02c3fc938157fbc0bcdf19f
treeb9d5136733e9371a3d352fd658d88163141249c8
parentbd0d97e1c41f17ea3fd5cba3fe337b4693eb8cbb
[clang][DirectoryWatcher][NFC] Swapping asserts for llvm fatal_error in create

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

llvm-svn: 368108
clang/include/clang/DirectoryWatcher/DirectoryWatcher.h
clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp
clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp