diff options
author | Kazu Hirata <kazu@google.com> | 2022-12-04 19:58:32 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-12-04 19:58:32 -0800 |
commit | 192d9dd731921a377bc538fc2b13871815fac87d (patch) | |
tree | cbec685220d8a2103eb8c3286466733ed9df914e /mlir/tools | |
parent | 595f1a6aaf5465fd71884b1557b4451be4e6a282 (diff) | |
download | llvm-192d9dd731921a377bc538fc2b13871815fac87d.zip llvm-192d9dd731921a377bc538fc2b13871815fac87d.tar.gz llvm-192d9dd731921a377bc538fc2b13871815fac87d.tar.bz2 |
[mlir] Use std::nullopt instead of None in comments (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
Diffstat (limited to 'mlir/tools')
-rw-r--r-- | mlir/tools/mlir-tblgen/OpFormatGen.cpp | 8 | ||||
-rw-r--r-- | mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/mlir/tools/mlir-tblgen/OpFormatGen.cpp b/mlir/tools/mlir-tblgen/OpFormatGen.cpp index 07a6ab9..daa4e9d 100644 --- a/mlir/tools/mlir-tblgen/OpFormatGen.cpp +++ b/mlir/tools/mlir-tblgen/OpFormatGen.cpp @@ -57,8 +57,8 @@ struct AttributeVariable : public OpVariableElement<NamedAttribute, VariableElement::Attribute> { using Base::Base; - /// Return the constant builder call for the type of this attribute, or None - /// if it doesn't have one. + /// Return the constant builder call for the type of this attribute, or + /// std::nullopt if it doesn't have one. llvm::Optional<StringRef> getTypeBuilder() const { llvm::Optional<Type> attrType = var->attr.getValueType(); return attrType ? attrType->getBuilderCall() : std::nullopt; @@ -251,7 +251,7 @@ struct OperationFormat { public: TypeResolution() = default; - /// Get the index into the buildable types for this type, or None. + /// Get the index into the buildable types for this type, or std::nullopt. Optional<int> getBuilderIdx() const { return builderIdx; } void setBuilderIdx(int idx) { builderIdx = idx; } @@ -263,7 +263,7 @@ struct OperationFormat { const NamedAttribute *getAttribute() const { return resolver.dyn_cast<const NamedAttribute *>(); } - /// Get the transformer for the type of the variable, or None. + /// Get the transformer for the type of the variable, or std::nullopt. Optional<StringRef> getVarTransformer() const { return variableTransformer; } diff --git a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp index f83908c3..a5ffcc4 100644 --- a/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp +++ b/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp @@ -71,7 +71,7 @@ class {0}(_ods_ir.OpView): /// Each segment spec is either None (default) or an array of integers /// where: /// 1 = single element (expect non sequence operand/result) -/// 0 = optional element (expect a value or None) +/// 0 = optional element (expect a value or std::nullopt) /// -1 = operand/result is a sequence corresponding to a variadic constexpr const char *opClassSizedSegmentsTemplate = R"Py( _ODS_{0}_SEGMENTS = {1} |