From: Kazu Hirata Date: Sat, 10 Dec 2022 18:24:52 +0000 (-0800) Subject: [Presburger] Use std::optional in Simplex.cpp (NFC) X-Git-Tag: upstream/17.0.6~24378 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2122c8a5467879718b4fa4f50904295970b95052;p=platform%2Fupstream%2Fllvm.git [Presburger] Use std::optional in Simplex.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 --- diff --git a/mlir/lib/Analysis/Presburger/Simplex.cpp b/mlir/lib/Analysis/Presburger/Simplex.cpp index 5c9d420..0bcc8ee 100644 --- a/mlir/lib/Analysis/Presburger/Simplex.cpp +++ b/mlir/lib/Analysis/Presburger/Simplex.cpp @@ -12,6 +12,7 @@ #include "llvm/ADT/Optional.h" #include "llvm/Support/Compiler.h" #include +#include using namespace mlir; using namespace presburger; @@ -756,7 +757,7 @@ LogicalResult LexSimplex::restoreRationalConsistency() { // lexicographically smaller than B.col(k) / B(i,k), since it lexicographically // minimizes the change in sample value. LogicalResult LexSimplexBase::moveRowUnknownToColumn(unsigned row) { - Optional maybeColumn; + std::optional maybeColumn; for (unsigned col = 3 + nSymbol, e = getNumColumns(); col < e; ++col) { if (tableau(row, col) <= 0) continue; @@ -866,7 +867,7 @@ unsigned LexSimplexBase::getLexMinPivotColumn(unsigned row, unsigned colA, /// ordering where we prefer unknowns with lower index. Optional Simplex::findPivot(int row, Direction direction) const { - Optional col; + std::optional col; for (unsigned j = 2, e = getNumColumns(); j < e; ++j) { MPInt elem = tableau(row, j); if (elem == 0)