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

index 226c9ee..3a699df 100644 (file)
@@ -22,6 +22,7 @@
 #include "llvm/Support/DebugCounter.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
+#include <optional>
 
 using namespace llvm;
 
@@ -103,7 +104,7 @@ static bool optimizeSQRT(CallInst *Call, Function *CalledFunc,
 static bool runPartiallyInlineLibCalls(Function &F, TargetLibraryInfo *TLI,
                                        const TargetTransformInfo *TTI,
                                        DominatorTree *DT) {
-  Optional<DomTreeUpdater> DTU;
+  std::optional<DomTreeUpdater> DTU;
   if (DT)
     DTU.emplace(DT, DomTreeUpdater::UpdateStrategy::Lazy);