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

index f14f7c4..4a0c1e2 100644 (file)
@@ -47,6 +47,7 @@
 #include "llvm/Pass.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
+#include <optional>
 
 #define DEBUG_TYPE "aarch64-isel"
 
@@ -1420,7 +1421,7 @@ static Register getTestBitReg(Register Reg, uint64_t &Bit, bool &Invert,
     }
 
     // Attempt to find a suitable operation with a constant on one side.
-    Optional<uint64_t> C;
+    std::optional<uint64_t> C;
     Register TestReg;
     switch (Opc) {
     default: