[llvm] 362ca6c - [RISCV] Use std::optional in RISCVISelDAGToDAG.cpp (NFC)

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


Author: Kazu Hirata
Date: 2022-11-25T23:02:26-08:00
New Revision: 362ca6cbefd752dd8b6727708383c5418cb239ea

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

LOG: [RISCV] Use std::optional in RISCVISelDAGToDAG.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/RISCV/RISCVISelDAGToDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
index 70e4f344434d..3f83f8933fd3 100644
--- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -22,6 +22,7 @@
 #include "llvm/Support/KnownBits.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/raw_ostream.h"
+#include <optional>
 
 using namespace llvm;
 
@@ -2636,7 +2637,7 @@ bool RISCVDAGToDAGISel::doPeepholeMaskedRVV(SDNode *N) {
     return false;
 
   // Retrieve the tail policy operand index, if any.
-  Optional<unsigned> TailPolicyOpIdx;
+  std::optional<unsigned> TailPolicyOpIdx;
   const RISCVInstrInfo &TII = *Subtarget->getInstrInfo();
   const MCInstrDesc &MaskedMCID = TII.get(N->getMachineOpcode());
 


        


More information about the llvm-commits mailing list