Skip to content

Commit

Permalink
[mlir][python] llvm::Optional::value => operator*
Browse files Browse the repository at this point in the history
And convert it to std::optional while updating.
  • Loading branch information
MaskRay committed Dec 19, 2022
1 parent 0ebab8b commit 14ce58f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mlir/lib/Bindings/Python/IRCore.cpp
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Bindings/Python/IRModule.h
Expand Up @@ -302,7 +302,7 @@ class PyDiagnostic {
/// If notes have been materialized from the diagnostic, then this will
/// be populated with the corresponding objects (all castable to
/// PyDiagnostic).
llvm::Optional<pybind11::tuple> materializedNotes;
std::optional<pybind11::tuple> materializedNotes;
bool valid = true;
};

Expand Down

0 comments on commit 14ce58f

Please sign in to comment.