Skip to content

Commit cb63701

Browse files
[mlir] Deprecate OpPrintingFlags(std::nullopt_t) (NFC) (#149546)
This patch deprecates OpPrintingFlags(std::nullopt_t) to avoid use of std::nullopt outside the context of std::optional.
1 parent c98b05b commit cb63701

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

mlir/include/mlir/IR/OpDefinition.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class OpState {
115115
MLIRContext *getContext() { return getOperation()->getContext(); }
116116

117117
/// Print the operation to the given stream.
118-
void print(raw_ostream &os, OpPrintingFlags flags = std::nullopt) {
118+
void print(raw_ostream &os, OpPrintingFlags flags = {}) {
119119
state->print(os, flags);
120120
}
121121
void print(raw_ostream &os, AsmState &asmState) {

mlir/include/mlir/IR/Operation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ class alignas(8) Operation final
318318
/// take O(N) where N is the number of operations within the parent block.
319319
bool isBeforeInBlock(Operation *other);
320320

321-
void print(raw_ostream &os, const OpPrintingFlags &flags = std::nullopt);
321+
void print(raw_ostream &os, const OpPrintingFlags &flags = {});
322322
void print(raw_ostream &os, AsmState &state);
323323
void dump();
324324

mlir/include/mlir/IR/OperationSupport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,7 @@ class alignas(8) OperandStorage {
11761176
class OpPrintingFlags {
11771177
public:
11781178
OpPrintingFlags();
1179+
LLVM_DEPRECATED("Use OpPrintingFlags() instead", "OpPrintingFlags()")
11791180
OpPrintingFlags(std::nullopt_t) : OpPrintingFlags() {}
11801181

11811182
/// Enables the elision of large elements attributes by printing a lexically

0 commit comments

Comments
 (0)