[clang] defa6ee - [Basic] Use std::optional in TargetID.cpp (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 9 22:51:16 PST 2022
Author: Kazu Hirata
Date: 2022-12-09T22:51:10-08:00
New Revision: defa6eec7d00057cf4d481fe64e745f1b688c646
URL: https://github.com/llvm/llvm-project/commit/defa6eec7d00057cf4d481fe64e745f1b688c646
DIFF: https://github.com/llvm/llvm-project/commit/defa6eec7d00057cf4d481fe64e745f1b688c646.diff
LOG: [Basic] Use std::optional in TargetID.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/TargetID.cpp
Removed:
################################################################################
diff --git a/clang/lib/Basic/TargetID.cpp b/clang/lib/Basic/TargetID.cpp
index 23c0281c1989..20e07cb7266a 100644
--- a/clang/lib/Basic/TargetID.cpp
+++ b/clang/lib/Basic/TargetID.cpp
@@ -12,6 +12,7 @@
#include "llvm/Support/TargetParser.h"
#include "llvm/Support/raw_ostream.h"
#include <map>
+#include <optional>
namespace clang {
@@ -62,7 +63,7 @@ llvm::StringRef getProcessorFromTargetID(const llvm::Triple &T,
// A target ID is a processor name followed by a list of target features
// delimited by colon. Each target feature is a string post-fixed by a plus
// or minus sign, e.g. gfx908:sramecc+:xnack-.
-static llvm::Optional<llvm::StringRef>
+static std::optional<llvm::StringRef>
parseTargetIDWithFormatCheckingOnly(llvm::StringRef TargetID,
llvm::StringMap<bool> *FeatureMap) {
llvm::StringRef Processor;
More information about the cfe-commits
mailing list