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

index cda9be6..1c8e4e3 100644 (file)
@@ -35,6 +35,7 @@
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include <cassert>
+#include <optional>
 
 using namespace llvm;
 
@@ -861,7 +862,7 @@ static void scalarizeMaskedCompressStore(const DataLayout &DL, CallInst *CI,
 
 static bool runImpl(Function &F, const TargetTransformInfo &TTI,
                     DominatorTree *DT) {
-  Optional<DomTreeUpdater> DTU;
+  std::optional<DomTreeUpdater> DTU;
   if (DT)
     DTU.emplace(DT, DomTreeUpdater::UpdateStrategy::Lazy);