]> granicus.if.org Git - clang/commitdiff
[clang][DirectoryWatcher] Fix Windows stub after LLVM change
authorJan Korous <jkorous@apple.com>
Tue, 13 Aug 2019 22:39:50 +0000 (22:39 +0000)
committerJan Korous <jkorous@apple.com>
Tue, 13 Aug 2019 22:39:50 +0000 (22:39 +0000)
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

lib/DirectoryWatcher/windows/DirectoryWatcher-windows.cpp

index 6a12715592b3fb1adbd117a61261420976011272..25cbcf536388aac2499102d1f977df8ef83d4b09 100644 (file)
@@ -40,9 +40,11 @@ public:
 };
 } // namespace
 
-std::unique_ptr<DirectoryWatcher> clang::DirectoryWatcher::create(
+llvm::Expected<std::unique_ptr<DirectoryWatcher>>
+clang::DirectoryWatcher::create(
     StringRef Path,
     std::function<void(llvm::ArrayRef<DirectoryWatcher::Event>, bool)> Receiver,
     bool WaitForInitialSync) {
-    return nullptr;
+  return llvm::Expected<std::unique_ptr<DirectoryWatcher>>(
+      llvm::errorCodeToError(std::make_error_code(std::errc::not_supported)));
 }