From b4482f7ca04e852cf610ef0e16542c888844d93d Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 2 Dec 2022 21:11:40 -0800 Subject: [tools] Use std::nullopt instead of None (NFC) This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. 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 --- llvm/tools/llvm-ifs/llvm-ifs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/tools/llvm-ifs/llvm-ifs.cpp') diff --git a/llvm/tools/llvm-ifs/llvm-ifs.cpp b/llvm/tools/llvm-ifs/llvm-ifs.cpp index 646d4df..d704422 100644 --- a/llvm/tools/llvm-ifs/llvm-ifs.cpp +++ b/llvm/tools/llvm-ifs/llvm-ifs.cpp @@ -309,7 +309,7 @@ static DriverConfig parseArgs(int argc, char *const *argv) { Config.InputFormat = StringSwitch>(A->getValue()) .Case("IFS", FileFormat::IFS) .Case("ELF", FileFormat::ELF) - .Default(None); + .Default(std::nullopt); if (!Config.InputFormat) fatalError(Twine("invalid argument '") + A->getValue()); } @@ -323,7 +323,7 @@ static DriverConfig parseArgs(int argc, char *const *argv) { .Case("IFS", FileFormat::IFS) .Case("ELF", FileFormat::ELF) .Case("TBD", FileFormat::TBD) - .Default(None); + .Default(std::nullopt); if (!Config.OutputFormat) OptionNotFound("--output-format", A->getValue()); } @@ -344,7 +344,7 @@ static DriverConfig parseArgs(int argc, char *const *argv) { StringSwitch>(A->getValue()) .Case("little", IFSEndiannessType::Little) .Case("big", IFSEndiannessType::Big) - .Default(None); + .Default(std::nullopt); if (!Config.OverrideEndianness) OptionNotFound("--endianness", A->getValue()); } -- cgit v1.1