[llvm] d82f7fb - [SelectionDAG] Use std::optional in FastISel.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 15:02:51 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T15:02:45-08:00
New Revision: d82f7fbfcecc85914c41d8f889e20ae1949e37c0

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

LOG: [SelectionDAG] Use std::optional in FastISel.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/CodeGen/SelectionDAG/FastISel.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 4f50837ffe44..2f014372d733 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -105,6 +105,7 @@
 #include <cassert>
 #include <cstdint>
 #include <iterator>
+#include <optional>
 #include <utility>
 
 using namespace llvm;
@@ -1228,7 +1229,7 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) {
     if (Arg && FuncInfo.getArgumentFrameIndex(Arg) != INT_MAX)
       return true;
 
-    Optional<MachineOperand> Op;
+    std::optional<MachineOperand> Op;
     if (Register Reg = lookUpRegForValue(Address))
       Op = MachineOperand::CreateReg(Reg, false);
 


        


More information about the llvm-commits mailing list