[llvm] ac7af9a - [ARM] Use std::optional in ARMISelDAGToDAG.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 25 22:45:32 PST 2022


Author: Kazu Hirata
Date: 2022-11-25T22:45:26-08:00
New Revision: ac7af9a0b871cad581210464121552ba072809f7

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

LOG: [ARM] Use std::optional in ARMISelDAGToDAG.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/Target/ARM/ARMISelDAGToDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
index f28ee176fec83..5a257d25179e3 100644
--- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
+++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
@@ -35,6 +35,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Target/TargetOptions.h"
+#include <optional>
 
 using namespace llvm;
 
@@ -3530,7 +3531,7 @@ void ARMDAGToDAGISel::SelectCMP_SWAP(SDNode *N) {
   CurDAG->RemoveDeadNode(N);
 }
 
-static Optional<std::pair<unsigned, unsigned>>
+static std::optional<std::pair<unsigned, unsigned>>
 getContiguousRangeOfSetBits(const APInt &A) {
   unsigned FirstOne = A.getBitWidth() - A.countLeadingZeros() - 1;
   unsigned LastOne = A.countTrailingZeros();


        


More information about the llvm-commits mailing list