[llvm] 3ccbfc3 - [GlobalISel] Use std::optional in LegalizerHelper.cpp (NFC)
    Kazu Hirata via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sat Nov 26 14:45:00 PST 2022
    
    
  
Author: Kazu Hirata
Date: 2022-11-26T14:44:54-08:00
New Revision: 3ccbfc34c0bdc18d259f4d4067616fe61e0876d8
URL: https://github.com/llvm/llvm-project/commit/3ccbfc34c0bdc18d259f4d4067616fe61e0876d8
DIFF: https://github.com/llvm/llvm-project/commit/3ccbfc34c0bdc18d259f4d4067616fe61e0876d8.diff
LOG: [GlobalISel] Use std::optional in LegalizerHelper.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/GlobalISel/LegalizerHelper.cpp
Removed: 
    
################################################################################
diff  --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index 6ea4f6c9ac10..b0bba68bdc65 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -34,6 +34,7 @@
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Target/TargetMachine.h"
 #include <numeric>
+#include <optional>
 
 #define DEBUG_TYPE "legalizer"
 
@@ -1842,7 +1843,7 @@ LegalizerHelper::widenScalarAddSubOverflow(MachineInstr &MI, unsigned TypeIdx,
                                            LLT WideTy) {
   unsigned Opcode;
   unsigned ExtOpcode;
-  Optional<Register> CarryIn;
+  std::optional<Register> CarryIn;
   switch (MI.getOpcode()) {
   default:
     llvm_unreachable("Unexpected opcode!");
        
    
    
More information about the llvm-commits
mailing list