[llvm] 410c1f6 - [Passes] Use std::optional in PassBuilder.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 25 12:47:51 PST 2022
Author: Kazu Hirata
Date: 2022-11-25T12:47:46-08:00
New Revision: 410c1f6269779a01ad24909974eafb0f2e8d8cac
URL: https://github.com/llvm/llvm-project/commit/410c1f6269779a01ad24909974eafb0f2e8d8cac
DIFF: https://github.com/llvm/llvm-project/commit/410c1f6269779a01ad24909974eafb0f2e8d8cac.diff
LOG: [Passes] Use std::optional in PassBuilder.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/Passes/PassBuilder.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index f6a8cf3c6f5e4..6bac467cdd91d 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -253,6 +253,7 @@
#include "llvm/Transforms/Vectorize/LoopVectorize.h"
#include "llvm/Transforms/Vectorize/SLPVectorizer.h"
#include "llvm/Transforms/Vectorize/VectorCombine.h"
+#include <optional>
using namespace llvm;
@@ -471,7 +472,7 @@ void PassBuilder::registerLoopAnalyses(LoopAnalysisManager &LAM) {
C(LAM);
}
-static Optional<int> parseRepeatPassName(StringRef Name) {
+static std::optional<int> parseRepeatPassName(StringRef Name) {
if (!Name.consume_front("repeat<") || !Name.consume_back(">"))
return None;
int Count;
@@ -480,7 +481,7 @@ static Optional<int> parseRepeatPassName(StringRef Name) {
return Count;
}
-static Optional<int> parseDevirtPassName(StringRef Name) {
+static std::optional<int> parseDevirtPassName(StringRef Name) {
if (!Name.consume_front("devirt<") || !Name.consume_back(">"))
return None;
int Count;
More information about the llvm-commits
mailing list