[llvm] d3a58c4 - [Scalar] Use std::optional in LoopInstSimplify.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 17:14:29 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T17:14:23-08:00
New Revision: d3a58c48f438f38b14da1a845cadf5d97d805b42
URL: https://github.com/llvm/llvm-project/commit/d3a58c48f438f38b14da1a845cadf5d97d805b42
DIFF: https://github.com/llvm/llvm-project/commit/d3a58c48f438f38b14da1a845cadf5d97d805b42.diff
LOG: [Scalar] Use std::optional in LoopInstSimplify.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/Transforms/Scalar/LoopInstSimplify.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp b/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp
index 38c06535203cf..c9798a80978d0 100644
--- a/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp
@@ -35,6 +35,7 @@
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
+#include <optional>
#include <utility>
using namespace llvm;
@@ -214,7 +215,7 @@ class LoopInstSimplifyLegacyPass : public LoopPass {
PreservedAnalyses LoopInstSimplifyPass::run(Loop &L, LoopAnalysisManager &AM,
LoopStandardAnalysisResults &AR,
LPMUpdater &) {
- Optional<MemorySSAUpdater> MSSAU;
+ std::optional<MemorySSAUpdater> MSSAU;
if (AR.MSSA) {
MSSAU = MemorySSAUpdater(AR.MSSA);
if (VerifyMemorySSA)
More information about the llvm-commits
mailing list