[llvm] 2d1b093 - [Utils] Use std::optional in SimplifyCFG.cpp (NFC)

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


Author: Kazu Hirata
Date: 2022-11-26T17:55:33-08:00
New Revision: 2d1b093a37d6aea01125166086d05303d2798efd

URL: https://github.com/llvm/llvm-project/commit/2d1b093a37d6aea01125166086d05303d2798efd
DIFF: https://github.com/llvm/llvm-project/commit/2d1b093a37d6aea01125166086d05303d2798efd.diff

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index b1f301cd0eca..619cd8389c6d 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -82,6 +82,7 @@
 #include <cstdint>
 #include <iterator>
 #include <map>
+#include <optional>
 #include <set>
 #include <tuple>
 #include <utility>
@@ -3523,7 +3524,7 @@ static bool extractPredSuccWeights(BranchInst *PBI, BranchInst *BI,
 /// Determine if the two branches share a common destination and deduce a glue
 /// that joins the branches' conditions to arrive at the common destination if
 /// that would be profitable.
-static Optional<std::pair<Instruction::BinaryOps, bool>>
+static std::optional<std::pair<Instruction::BinaryOps, bool>>
 shouldFoldCondBranchesToCommonDestination(BranchInst *BI, BranchInst *PBI,
                                           const TargetTransformInfo *TTI) {
   assert(BI && PBI && BI->isConditional() && PBI->isConditional() &&


        


More information about the llvm-commits mailing list