From f17dbb9706a2a7ed89ed7877706264060fb28f14 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 25 Nov 2022 21:15:34 -0800 Subject: [PATCH] [Remarks] Use std::optional in YAMLRemarkParser.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 --- llvm/lib/Remarks/YAMLRemarkParser.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Remarks/YAMLRemarkParser.cpp b/llvm/lib/Remarks/YAMLRemarkParser.cpp index a32629c..6f879d3 100644 --- a/llvm/lib/Remarks/YAMLRemarkParser.cpp +++ b/llvm/lib/Remarks/YAMLRemarkParser.cpp @@ -15,6 +15,7 @@ #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Path.h" +#include using namespace llvm; using namespace llvm::remarks; @@ -322,9 +323,9 @@ YAMLRemarkParser::parseDebugLoc(yaml::KeyValueNode &Node) { if (!DebugLoc) return error("expected a value of mapping type.", Node); - Optional File; - Optional Line; - Optional Column; + std::optional File; + std::optional Line; + std::optional Column; for (yaml::KeyValueNode &DLNode : *DebugLoc) { Expected MaybeKey = parseKey(DLNode); @@ -364,8 +365,8 @@ Expected YAMLRemarkParser::parseArg(yaml::Node &Node) { if (!ArgMap) return error("expected a value of mapping type.", Node); - Optional KeyStr; - Optional ValueStr; + std::optional KeyStr; + std::optional ValueStr; Optional Loc; for (yaml::KeyValueNode &ArgEntry : *ArgMap) { -- 2.7.4