Author: Kazu Hirata Date: 2022-12-09T22:48:14-08:00 New Revision: a12b82adb82eda76d6d7afd340b890f56f62771d
URL: https://github.com/llvm/llvm-project/commit/a12b82adb82eda76d6d7afd340b890f56f62771d DIFF: https://github.com/llvm/llvm-project/commit/a12b82adb82eda76d6d7afd340b890f56f62771d.diff LOG: [Basic] Use std::optional in DarwinSDKInfo.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: clang/lib/Basic/DarwinSDKInfo.cpp Removed: ################################################################################ diff --git a/clang/lib/Basic/DarwinSDKInfo.cpp b/clang/lib/Basic/DarwinSDKInfo.cpp index 5543acb126df7..4fb3409269c6c 100644 --- a/clang/lib/Basic/DarwinSDKInfo.cpp +++ b/clang/lib/Basic/DarwinSDKInfo.cpp @@ -11,6 +11,7 @@ #include "llvm/Support/JSON.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" +#include <optional> using namespace clang; @@ -61,8 +62,8 @@ DarwinSDKInfo::RelatedTargetVersionMapping::parseJSON( Min, Max, MinValue, MaximumDeploymentTarget, std::move(Mapping)); } -static Optional<VersionTuple> getVersionKey(const llvm::json::Object &Obj, - StringRef Key) { +static std::optional<VersionTuple> getVersionKey(const llvm::json::Object &Obj, + StringRef Key) { auto Value = Obj.getString(Key); if (!Value) return std::nullopt; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits