@@ -37,21 +37,12 @@ class NeverCanonical {}
37
37
/// canonical types can ignore these nodes.
38
38
class NeverCanonicalUnlessDependent {}
39
39
40
- /// A type node which never has component type structure. Some code may be
41
- /// able to operate on leaf types faster than they can on non-leaf types.
42
- ///
43
- /// For example, the function type `void (int)` is not a leaf type because it
44
- /// is structurally composed of component types (`void` and `int`).
45
- ///
46
- /// A struct type is a leaf type because its field types are not part of its
47
- /// type-expression.
48
- ///
49
- /// Nodes like `TypedefType` which are syntactically leaves but can desugar
50
- /// to types that may not be leaves should not declare this.
51
- class LeafType {}
40
+ /// A type node which is always a canonical type, that is, types for which
41
+ /// `T.getCanonicalType() == T` always holds.
42
+ class AlwaysCanonical {}
52
43
53
44
def Type : TypeNode<?, 1>;
54
- def BuiltinType : TypeNode<Type>, LeafType ;
45
+ def BuiltinType : TypeNode<Type>, AlwaysCanonical ;
55
46
def ComplexType : TypeNode<Type>;
56
47
def PointerType : TypeNode<Type>;
57
48
def BlockPointerType : TypeNode<Type>;
@@ -88,14 +79,14 @@ def TypeOfType : TypeNode<Type>, NeverCanonicalUnlessDependent;
88
79
def DecltypeType : TypeNode<Type>, NeverCanonicalUnlessDependent;
89
80
def UnaryTransformType : TypeNode<Type>, NeverCanonicalUnlessDependent;
90
81
def TagType : TypeNode<Type, 1>;
91
- def RecordType : TypeNode<TagType>, LeafType ;
92
- def EnumType : TypeNode<TagType>, LeafType ;
93
- def InjectedClassNameType : TypeNode<TagType>, AlwaysDependent, LeafType ;
82
+ def RecordType : TypeNode<TagType>;
83
+ def EnumType : TypeNode<TagType>;
84
+ def InjectedClassNameType : TypeNode<TagType>, AlwaysDependent;
94
85
def AttributedType : TypeNode<Type>, NeverCanonical;
95
86
def BTFTagAttributedType : TypeNode<Type>, NeverCanonical;
96
87
def HLSLAttributedResourceType : TypeNode<Type>;
97
88
def HLSLInlineSpirvType : TypeNode<Type>;
98
- def TemplateTypeParmType : TypeNode<Type>, AlwaysDependent, LeafType ;
89
+ def TemplateTypeParmType : TypeNode<Type>, AlwaysDependent;
99
90
def SubstTemplateTypeParmType : TypeNode<Type>, NeverCanonical;
100
91
def SubstPackType : TypeNode<Type, 1>;
101
92
def SubstTemplateTypeParmPackType : TypeNode<SubstPackType>, AlwaysDependent;
@@ -110,7 +101,7 @@ def PackExpansionType : TypeNode<Type>, AlwaysDependent;
110
101
def PackIndexingType : TypeNode<Type>, NeverCanonicalUnlessDependent;
111
102
def ObjCTypeParamType : TypeNode<Type>, NeverCanonical;
112
103
def ObjCObjectType : TypeNode<Type>;
113
- def ObjCInterfaceType : TypeNode<ObjCObjectType>, LeafType ;
104
+ def ObjCInterfaceType : TypeNode<ObjCObjectType>, AlwaysCanonical ;
114
105
def ObjCObjectPointerType : TypeNode<Type>;
115
106
def BoundsAttributedType : TypeNode<Type, 1>;
116
107
def CountAttributedType : TypeNode<BoundsAttributedType>, NeverCanonical;
0 commit comments