[libc-commits] [libc] b950e06 - [libc] Use std::optional instead of None in comments (NFC)
Kazu Hirata via libc-commits
libc-commits at lists.llvm.org
Sat Dec 10 17:02:00 PST 2022
Author: Kazu Hirata
Date: 2022-12-10T17:01:55-08:00
New Revision: b950e061490992061fdbbd58f988eaa6f443f869
URL: https://github.com/llvm/llvm-project/commit/b950e061490992061fdbbd58f988eaa6f443f869
DIFF: https://github.com/llvm/llvm-project/commit/b950e061490992061fdbbd58f988eaa6f443f869.diff
LOG: [libc] Use std::optional instead of None in comments (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:
libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp
Removed:
################################################################################
diff --git a/libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp b/libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp
index e4ba20542258..c362874bb45f 100644
--- a/libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp
+++ b/libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp
@@ -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) {
More information about the libc-commits
mailing list