[llvm] 5c99c2e - [GISel] Use std::optional in AArch64InstructionSelector.cpp (NFC)

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


Author: Kazu Hirata
Date: 2022-11-25T22:17:26-08:00
New Revision: 5c99c2e16b6573d31045f610150b71c7e07f5f67

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

LOG: [GISel] Use std::optional in AArch64InstructionSelector.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/AArch64/GISel/AArch64InstructionSelector.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
index f14f7c4bb45db..4a0c1e2a1380c 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
@@ -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:


        


More information about the llvm-commits mailing list