diff options
Diffstat (limited to 'include/clang/DirectoryWatcher/DirectoryWatcher.h')
-rw-r--r-- | include/clang/DirectoryWatcher/DirectoryWatcher.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/clang/DirectoryWatcher/DirectoryWatcher.h b/include/clang/DirectoryWatcher/DirectoryWatcher.h index e74443e0bc81c..4475807dfce9a 100644 --- a/include/clang/DirectoryWatcher/DirectoryWatcher.h +++ b/include/clang/DirectoryWatcher/DirectoryWatcher.h @@ -11,6 +11,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/Error.h" #include <functional> #include <memory> #include <string> @@ -98,10 +99,11 @@ public: : Kind(Kind), Filename(Filename) {} }; - /// Returns nullptr if \param Path doesn't exist or isn't a directory. - /// Returns nullptr if OS kernel API told us we can't start watching. In such - /// case it's unclear whether just retrying has any chance to succeeed. - static std::unique_ptr<DirectoryWatcher> + /// llvm fatal_error if \param Path doesn't exist or isn't a directory. + /// Returns llvm::Expected Error if OS kernel API told us we can't start + /// watching. In such case it's unclear whether just retrying has any chance + /// to succeed. + static llvm::Expected<std::unique_ptr<DirectoryWatcher>> create(llvm::StringRef Path, std::function<void(llvm::ArrayRef<DirectoryWatcher::Event> Events, bool IsInitial)> |