[libc] Use std::optional instead of None in comments (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 11 Dec 2022 01:01:55 +0000 (17:01 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 11 Dec 2022 01:01:55 +0000 (17:01 -0800)
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

libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp

index e4ba205..c362874 100644 (file)
@@ -166,8 +166,8 @@ static Optional<SizeSpan> AsSizeSpan(size_t Begin, size_t End) {
   return SS;
 }
 
-// Generic method to create a `Region` struct with a Span or None if span is
-// empty.
+// Generic method to create a `Region` struct with a Span or std::nullopt if
+// span is empty.
 template <typename Region>
 static Optional<Region> As(size_t Begin, size_t End) {
   if (auto Span = AsSizeSpan(Begin, End)) {
@@ -178,7 +178,7 @@ static Optional<Region> As(size_t Begin, size_t End) {
   return std::nullopt;
 }
 
-// Returns a Loop struct or None if span is empty.
+// Returns a Loop struct or std::nullopt if span is empty.
 static Optional<Loop> AsLoop(size_t Begin, size_t End, size_t BlockSize) {
   if (auto Span = AsSizeSpan(Begin, End)) {
     Loop Output;
@@ -189,7 +189,7 @@ static Optional<Loop> AsLoop(size_t Begin, size_t End, size_t BlockSize) {
   return std::nullopt;
 }
 
-// Returns an AlignedLoop struct or None if span is empty.
+// Returns an AlignedLoop struct or std::nullopt if span is empty.
 static Optional<AlignedLoop> AsAlignedLoop(size_t Begin, size_t End,
                                            size_t BlockSize, size_t Alignment,
                                            AlignArg AlignTo) {