summaryrefslogtreecommitdiff
path: root/include/clang/DirectoryWatcher/DirectoryWatcher.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-10-23 17:52:09 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-10-23 17:52:09 +0000
commit519fc96c475680de2cc49e7811dbbfadb912cbcc (patch)
tree310ca684459b7e9ae13c9a3b9abf308b3a634afe /include/clang/DirectoryWatcher/DirectoryWatcher.h
parent2298981669bf3bd63335a4be179bc0f96823a8f4 (diff)
Notes
Diffstat (limited to 'include/clang/DirectoryWatcher/DirectoryWatcher.h')
-rw-r--r--include/clang/DirectoryWatcher/DirectoryWatcher.h10
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)>