[llvm] c672bb6 - [PowerPC] Use std::optional in PPCMacroFusion.cpp (NFC)

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


Author: Kazu Hirata
Date: 2022-11-25T22:57:25-08:00
New Revision: c672bb674c663c693b3bcbe92da6c2ac020dacbc

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

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPCMacroFusion.cpp b/llvm/lib/Target/PowerPC/PPCMacroFusion.cpp
index 58b74c6b8c7ab..9707357e6fd5a 100644
--- a/llvm/lib/Target/PowerPC/PPCMacroFusion.cpp
+++ b/llvm/lib/Target/PowerPC/PPCMacroFusion.cpp
@@ -16,6 +16,7 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/CodeGen/MacroFusion.h"
 #include "llvm/CodeGen/ScheduleDAGMutation.h"
+#include <optional>
 
 using namespace llvm;
 namespace {
@@ -55,7 +56,7 @@ class FusionFeature {
   bool hasOp1(unsigned Opc) const { return OpSet1.contains(Opc); }
   bool hasOp2(unsigned Opc) const { return OpSet2.contains(Opc); }
   bool isSupported() const { return Supported; }
-  Optional<unsigned> depOpIdx() const {
+  std::optional<unsigned> depOpIdx() const {
     if (DepOpIdx < 0)
       return None;
     return DepOpIdx;


        


More information about the llvm-commits mailing list