[llvm] 60d6445 - [Scalar] Use std::optional in LowerConstantIntrinsics.cpp (NFC)

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


Author: Kazu Hirata
Date: 2022-11-26T17:33:11-08:00
New Revision: 60d644554bd342df2dad50b723dc55248a271765

URL: https://github.com/llvm/llvm-project/commit/60d644554bd342df2dad50b723dc55248a271765
DIFF: https://github.com/llvm/llvm-project/commit/60d644554bd342df2dad50b723dc55248a271765.diff

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
index 955ac2706f65..ef22b0401b1b 100644
--- a/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
@@ -31,6 +31,7 @@
 #include "llvm/Pass.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/Local.h"
+#include <optional>
 
 using namespace llvm;
 using namespace llvm::PatternMatch;
@@ -96,7 +97,7 @@ static bool replaceConditionalBranchesOnConstant(Instruction *II,
 
 static bool lowerConstantIntrinsics(Function &F, const TargetLibraryInfo &TLI,
                                     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