#include <chrono>
#include <limits>
#include <memory>
+#include <optional>
#include <string>
#include <vector>
"Can't parse Align, not an Integer");
const int64_t Value = *MaybeInt;
if (!Value) {
- Out = None;
+ Out = std::nullopt;
return Error::success();
}
if (isPowerOf2_64(Value)) {
.Case("None", libc_benchmarks::BenchmarkLog::None)
.Case("Last", libc_benchmarks::BenchmarkLog::Last)
.Case("Full", libc_benchmarks::BenchmarkLog::Full)
- .Default(None);
+ .Default(std::nullopt);
if (!Parsed)
return createStringError(errc::io_error,
Twine("Can't parse BenchmarkLog, invalid value '")
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Alignment.h"
#include <cstdint>
+#include <optional>
#include <random>
namespace llvm {
// None : Use a fixed address that is at least cache line aligned,
// 1 : Use random address,
// >1 : Use random address aligned to value.
- MaybeAlign AccessAlignment = None;
+ MaybeAlign AccessAlignment = std::nullopt;
// When Function == 'memcmp', this is the buffers mismatch position.
// 0 : Buffers always compare equal,
#include "llvm/Support/Alignment.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+#include <optional>
using testing::AllOf;
using testing::AnyOf;
TEST(OffsetDistribution, AlignToBegin) {
const size_t BufferSize = 8192;
- OffsetDistribution OD(BufferSize, 1024, None);
+ OffsetDistribution OD(BufferSize, 1024, std::nullopt);
std::default_random_engine Gen;
for (size_t I = 0; I <= 10; ++I)
EXPECT_EQ(OD(Gen), 0U);