From b950e061490992061fdbbd58f988eaa6f443f869 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 10 Dec 2022 17:01:55 -0800 Subject: [PATCH] [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 --- libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp b/libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp index e4ba205..c362874 100644 --- a/libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp +++ b/libc/benchmarks/automemcpy/lib/RandomFunctionGenerator.cpp @@ -166,8 +166,8 @@ static Optional 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 static Optional As(size_t Begin, size_t End) { if (auto Span = AsSizeSpan(Begin, End)) { @@ -178,7 +178,7 @@ static Optional 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 AsLoop(size_t Begin, size_t End, size_t BlockSize) { if (auto Span = AsSizeSpan(Begin, End)) { Loop Output; @@ -189,7 +189,7 @@ static Optional 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 AsAlignedLoop(size_t Begin, size_t End, size_t BlockSize, size_t Alignment, AlignArg AlignTo) { -- 2.7.4