[llvm] cc0764e - [Support] Use std::optional in raw_ostream.h (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 14:16:31 PST 2022


Author: Kazu Hirata
Date: 2022-11-27T14:16:13-08:00
New Revision: cc0764e7fa4bfacdfafe0717446a72843eb29143

URL: https://github.com/llvm/llvm-project/commit/cc0764e7fa4bfacdfafe0717446a72843eb29143
DIFF: https://github.com/llvm/llvm-project/commit/cc0764e7fa4bfacdfafe0717446a72843eb29143.diff

LOG: [Support] Use std::optional in raw_ostream.h (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: 
    llvm/include/llvm/Support/raw_ostream.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
index bdb737dcb24c..9fb5f7892f21 100644
--- a/llvm/include/llvm/Support/raw_ostream.h
+++ b/llvm/include/llvm/Support/raw_ostream.h
@@ -21,6 +21,7 @@
 #include <cstddef>
 #include <cstdint>
 #include <cstring>
+#include <optional>
 #include <string>
 #include <string_view>
 #include <system_error>
@@ -442,7 +443,7 @@ class raw_fd_ostream : public raw_pwrite_stream {
   bool ShouldClose;
   bool SupportsSeeking = false;
   bool IsRegularFile = false;
-  mutable Optional<bool> HasColors;
+  mutable std::optional<bool> HasColors;
 
 #ifdef _WIN32
   /// True if this fd refers to a Windows console device. Mintty and other


        


More information about the llvm-commits mailing list