Author: Kazu Hirata
Date: 2022-12-09T22:55:06-08:00
New Revision: e8aee7ef73a759e9307fccb0fc3329d676eca737
URL: 
https://github.com/llvm/llvm-project/commit/e8aee7ef73a759e9307fccb0fc3329d676eca737
DIFF: 
https://github.com/llvm/llvm-project/commit/e8aee7ef73a759e9307fccb0fc3329d676eca737.diff

LOG: [linux] Use std::optional in DirectoryWatcher-linux.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

Added: 
    

Modified: 
    clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp 
b/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
index e9950088e1f1d..9b3d2571f29f6 100644
--- a/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
+++ b/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
@@ -25,6 +25,7 @@
 #include <vector>
 
 #include <fcntl.h>
+#include <optional>
 #include <sys/epoll.h>
 #include <sys/inotify.h>
 #include <unistd.h>
@@ -72,7 +73,7 @@ struct SemaphorePipe {
   const int FDWrite;
   bool OwnsFDs;
 
-  static llvm::Optional<SemaphorePipe> create() {
+  static std::optional<SemaphorePipe> create() {
     int InotifyPollingStopperFDs[2];
     if (pipe2(InotifyPollingStopperFDs, O_CLOEXEC) == -1)
       return std::nullopt;


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to