[llvm] 7aab805 - [Support] Use std::optional in JSON.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 21:45:53 PST 2022
Author: Kazu Hirata
Date: 2022-11-25T21:45:47-08:00
New Revision: 7aab8054e5dd82d12541120089efb2be25640b3d
URL: https://github.com/llvm/llvm-project/commit/7aab8054e5dd82d12541120089efb2be25640b3d
DIFF: https://github.com/llvm/llvm-project/commit/7aab8054e5dd82d12541120089efb2be25640b3d.diff
LOG: [Support] Use std::optional in JSON.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/Support/JSON.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/JSON.cpp b/llvm/lib/Support/JSON.cpp
index b87e39f0a963..6cd0097e4aa4 100644
--- a/llvm/lib/Support/JSON.cpp
+++ b/llvm/lib/Support/JSON.cpp
@@ -14,6 +14,7 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/NativeFormatting.h"
#include <cctype>
+#include <optional>
namespace llvm {
namespace json {
@@ -408,7 +409,7 @@ class Parser {
C == 'e' || C == 'E' || C == '+' || C == '-' || C == '.';
}
- Optional<Error> Err;
+ std::optional<Error> Err;
const char *Start, *P, *End;
};
More information about the llvm-commits
mailing list