From aadaaface2ec96ee30d92bf46faa41dd9e68b64d Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 2 Dec 2022 21:11:44 -0800 Subject: [llvm] 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/lib/FileCheck/FileCheck.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'llvm/lib/FileCheck/FileCheck.cpp') diff --git a/llvm/lib/FileCheck/FileCheck.cpp b/llvm/lib/FileCheck/FileCheck.cpp index 5d4cfce..f428e3f 100644 --- a/llvm/lib/FileCheck/FileCheck.cpp +++ b/llvm/lib/FileCheck/FileCheck.cpp @@ -702,7 +702,7 @@ Pattern::parseCallExpr(StringRef &Expr, StringRef FuncName, .Case("min", min) .Case("mul", operator*) .Case("sub", operator-) - .Default(None); + .Default(std::nullopt); if (!OptFunc) return ErrorDiagnostic::get( @@ -770,7 +770,7 @@ Expected> Pattern::parseNumericSubstitutionBlock( FileCheckPatternContext *Context, const SourceMgr &SM) { std::unique_ptr ExpressionASTPointer = nullptr; StringRef DefExpr = StringRef(); - DefinedNumericVariable = None; + DefinedNumericVariable = std::nullopt; ExpressionFormat ExplicitFormat = ExpressionFormat(); unsigned Precision = 0; @@ -2703,8 +2703,9 @@ Error FileCheckPatternContext::defineCmdlineVariables( StringRef CmdlineDefExpr = CmdlineDef.substr(1); Optional DefinedNumericVariable; Expected> ExpressionResult = - Pattern::parseNumericSubstitutionBlock( - CmdlineDefExpr, DefinedNumericVariable, false, None, this, SM); + Pattern::parseNumericSubstitutionBlock(CmdlineDefExpr, + DefinedNumericVariable, false, + std::nullopt, this, SM); if (!ExpressionResult) { Errs = joinErrors(std::move(Errs), ExpressionResult.takeError()); continue; -- cgit v1.1