[llvm] 85cee3a - [Scalar] Use std::optional in PartiallyInlineLibCalls.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 17:36:31 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T17:36:26-08:00
New Revision: 85cee3a4abfd839d0d354f0a8cf4466d495033b8

URL: https://github.com/llvm/llvm-project/commit/85cee3a4abfd839d0d354f0a8cf4466d495033b8
DIFF: https://github.com/llvm/llvm-project/commit/85cee3a4abfd839d0d354f0a8cf4466d495033b8.diff

LOG: [Scalar] Use std::optional in PartiallyInlineLibCalls.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/PartiallyInlineLibCalls.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp b/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
index 226c9ee0d5dc..3a699df1cde4 100644
--- a/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
+++ b/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
@@ -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);
 


        


More information about the llvm-commits mailing list