[llvm] f555ec5 - [FileCheck] Use std::optional in FileCheck.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 10 08:24:23 PST 2022
Author: Kazu Hirata
Date: 2022-12-10T08:24:18-08:00
New Revision: f555ec57cc01181ce09c802194b6f572f7a3f78a
URL: https://github.com/llvm/llvm-project/commit/f555ec57cc01181ce09c802194b6f572f7a3f78a
DIFF: https://github.com/llvm/llvm-project/commit/f555ec57cc01181ce09c802194b6f572f7a3f78a.diff
LOG: [FileCheck] Use std::optional in FileCheck.cpp (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:
llvm/lib/FileCheck/FileCheck.cpp
Removed:
################################################################################
diff --git a/llvm/lib/FileCheck/FileCheck.cpp b/llvm/lib/FileCheck/FileCheck.cpp
index e2cc6dc6763b..ce665430dcba 100644
--- a/llvm/lib/FileCheck/FileCheck.cpp
+++ b/llvm/lib/FileCheck/FileCheck.cpp
@@ -22,6 +22,7 @@
#include "llvm/Support/FormatVariadic.h"
#include <cstdint>
#include <list>
+#include <optional>
#include <set>
#include <tuple>
#include <utility>
@@ -695,7 +696,7 @@ Pattern::parseCallExpr(StringRef &Expr, StringRef FuncName,
Expr = Expr.ltrim(SpaceChars);
assert(Expr.startswith("("));
- auto OptFunc = StringSwitch<Optional<binop_eval_t>>(FuncName)
+ auto OptFunc = StringSwitch<std::optional<binop_eval_t>>(FuncName)
.Case("add", operator+)
.Case("div", operator/)
.Case("max", max)
More information about the llvm-commits
mailing list