[Mlir-commits] [mlir] d7e5038 - [Presburger] Use std::optional in PresburgerRelation.cpp (NFC)

Kazu Hirata llvmlistbot at llvm.org
Sat Dec 10 10:22:16 PST 2022


Author: Kazu Hirata
Date: 2022-12-10T10:22:11-08:00
New Revision: d7e503869521b47cf517ba7c2b50714f5299537f

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

LOG: [Presburger] Use std::optional in PresburgerRelation.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: 
    mlir/lib/Analysis/Presburger/PresburgerRelation.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp b/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
index 09710bd33b6f9..37fdf388441eb 100644
--- a/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
+++ b/mlir/lib/Analysis/Presburger/PresburgerRelation.cpp
@@ -12,6 +12,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/ScopeExit.h"
 #include "llvm/ADT/SmallBitVector.h"
+#include <optional>
 
 using namespace mlir;
 using namespace presburger;
@@ -212,7 +213,7 @@ static PresburgerRelation getSetDifference(IntegerRelation b,
     SmallVector<unsigned, 8> ineqsToProcess;
     // The index of the last inequality that was processed at this level.
     // This is empty when we are coming to this level for the first time.
-    Optional<unsigned> lastIneqProcessed;
+    std::optional<unsigned> lastIneqProcessed;
   };
   SmallVector<Frame, 2> frames;
 


        


More information about the Mlir-commits mailing list