From: Fangrui Song Date: Mon, 19 Dec 2022 04:28:55 +0000 (+0000) Subject: [mlir][python] llvm::Optional::value => operator* X-Git-Tag: upstream/17.0.6~23313 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14ce58f3bff07abfa3bf080e722ad546d11ac300;p=platform%2Fupstream%2Fllvm.git [mlir][python] llvm::Optional::value => operator* And convert it to std::optional while updating. --- diff --git a/mlir/lib/Bindings/Python/IRCore.cpp b/mlir/lib/Bindings/Python/IRCore.cpp index b46fe44..794be97 100644 --- a/mlir/lib/Bindings/Python/IRCore.cpp +++ b/mlir/lib/Bindings/Python/IRCore.cpp @@ -841,7 +841,7 @@ py::tuple PyDiagnostic::getNotes() { materializedNotes = py::tuple(numNotes); for (intptr_t i = 0; i < numNotes; ++i) { MlirDiagnostic noteDiag = mlirDiagnosticGetNote(diagnostic, i); - materializedNotes.value()[i] = PyDiagnostic(noteDiag); + (*materializedNotes)[i] = PyDiagnostic(noteDiag); } return *materializedNotes; } diff --git a/mlir/lib/Bindings/Python/IRModule.h b/mlir/lib/Bindings/Python/IRModule.h index 4738a6f..2492ad5 100644 --- a/mlir/lib/Bindings/Python/IRModule.h +++ b/mlir/lib/Bindings/Python/IRModule.h @@ -302,7 +302,7 @@ private: /// If notes have been materialized from the diagnostic, then this will /// be populated with the corresponding objects (all castable to /// PyDiagnostic). - llvm::Optional materializedNotes; + std::optional materializedNotes; bool valid = true; };