[Scalar] Use std::optional in LoopInstSimplify.cpp (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 01:14:23 +0000 (17:14 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 01:14:23 +0000 (17:14 -0800)
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

llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp

index 38c0653..c9798a8 100644 (file)
@@ -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 @@ public:
 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)