Skip to content

Commit 655d62c

Browse files
authored
[mlir][tablegen] Fix tablegen bug with Complex class (#104974)
The `Complex` class in tablegen tries to store its element type, but due to a name collision it actually ends up storing the `type` field of the `ConfinedType` superclass, and so `elementType` is always set to `AnyComplex`. This renames the field so that it gets correctly set.
1 parent e56ad22 commit 655d62c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mlir/include/mlir/IR/CommonTypeConstraints.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,16 +348,16 @@ def F8E3M4 : Type<CPred<"$_self.isFloat8E3M4()">, "f8E3M4 type">,
348348
def AnyComplex : Type<CPred<"::llvm::isa<::mlir::ComplexType>($_self)">,
349349
"complex-type", "::mlir::ComplexType">;
350350

351-
class Complex<Type type>
351+
class Complex<Type elType>
352352
: ConfinedType<AnyComplex, [
353353
SubstLeaves<"$_self",
354354
"::llvm::cast<::mlir::ComplexType>($_self).getElementType()",
355-
type.predicate>],
356-
"complex type with " # type.summary # " elements",
355+
elType.predicate>],
356+
"complex type with " # elType.summary # " elements",
357357
"::mlir::ComplexType">,
358-
SameBuildabilityAs<type, "::mlir::ComplexType::get($_builder.get" # type #
358+
SameBuildabilityAs<elType, "::mlir::ComplexType::get($_builder.get" # elType #
359359
"Type())"> {
360-
Type elementType = type;
360+
Type elementType = elType;
361361
}
362362

363363
class OpaqueType<string dialect, string name, string summary>

0 commit comments

Comments
 (0)