Skip to content

Commit

Permalink
[FileCheck] Use std::optional in FileCheck.cpp (NFC)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kazutakahirata committed Nov 26, 2022
1 parent 54ea422 commit e5a1ee5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/FileCheck/FileCheck.cpp
Expand Up @@ -22,6 +22,7 @@
#include "llvm/Support/FormatVariadic.h"
#include <cstdint>
#include <list>
#include <optional>
#include <set>
#include <tuple>
#include <utility>
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e5a1ee5

Please sign in to comment.