[ARM] Use std::optional in ARMISelDAGToDAG.cpp (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 26 Nov 2022 06:45:26 +0000 (22:45 -0800)
committerKazu Hirata <kazu@google.com>
Sat, 26 Nov 2022 06:45:26 +0000 (22:45 -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/Target/ARM/ARMISelDAGToDAG.cpp

index f28ee17..5a257d2 100644 (file)
@@ -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();