1193326Sed//===-- TypeNodes.def - Metadata about Type AST nodes -----------*- C++ -*-===//
2193326Sed//
3193326Sed//                     The LLVM Compiler Infrastructure
4193326Sed//
5193326Sed// This file is distributed under the University of Illinois Open Source
6193326Sed// License. See LICENSE.TXT for details.
7193326Sed//
8193326Sed//===----------------------------------------------------------------------===//
9193326Sed//
10193326Sed//  This file defines the AST type info database. Each type node is
11193326Sed//  enumerated by providing its name (e.g., "Builtin" or "Enum") and
12193326Sed//  base class (e.g., "Type" or "TagType"). Depending on where in the
13193326Sed//  abstract syntax tree the type will show up, the enumeration uses
14193326Sed//  one of four different macros:
15193326Sed//
16193326Sed//    TYPE(Class, Base) - A type that can show up anywhere in the AST,
17193326Sed//    and might be dependent, canonical, or non-canonical. All clients
18193326Sed//    will need to understand these types.
19193326Sed//
20193326Sed//    ABSTRACT_TYPE(Class, Base) - An abstract class that shows up in
21193326Sed//    the type hierarchy but has no concrete instances.
22193326Sed//
23193326Sed//    NON_CANONICAL_TYPE(Class, Base) - A type that can show up
24193326Sed//    anywhere in the AST but will never be a part of a canonical
25193326Sed//    type. Clients that only need to deal with canonical types
26193326Sed//    (ignoring, e.g., typedefs and other type alises used for
27193326Sed//    pretty-printing) can ignore these types.
28193326Sed//
29193326Sed//    DEPENDENT_TYPE(Class, Base) - A type that will only show up
30193326Sed//    within a C++ template that has not been instantiated, e.g., a
31193326Sed//    type that is always dependent. Clients that do not need to deal
32193326Sed//    with uninstantiated C++ templates can ignore these types.
33193326Sed//
34204643Srdivacky//    NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) - A type that
35204643Srdivacky//    is non-canonical unless it is dependent.  Defaults to TYPE because
36204643Srdivacky//    it is neither reliably dependent nor reliably non-canonical.
37204643Srdivacky//
38204643Srdivacky//  There is a sixth macro, independent of the others.  Most clients
39198092Srdivacky//  will not need to use it.
40198092Srdivacky//
41198092Srdivacky//    LEAF_TYPE(Class) - A type that never has inner types.  Clients
42198092Srdivacky//    which can operate on such types more efficiently may wish to do so.
43198092Srdivacky//
44193326Sed//===----------------------------------------------------------------------===//
45193326Sed
46193326Sed#ifndef ABSTRACT_TYPE
47193326Sed#  define ABSTRACT_TYPE(Class, Base) TYPE(Class, Base)
48193326Sed#endif
49193326Sed
50193326Sed#ifndef NON_CANONICAL_TYPE
51193326Sed#  define NON_CANONICAL_TYPE(Class, Base) TYPE(Class, Base)
52193326Sed#endif
53193326Sed
54193326Sed#ifndef DEPENDENT_TYPE
55193326Sed#  define DEPENDENT_TYPE(Class, Base) TYPE(Class, Base)
56193326Sed#endif
57193326Sed
58204643Srdivacky#ifndef NON_CANONICAL_UNLESS_DEPENDENT_TYPE
59204643Srdivacky#  define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) TYPE(Class, Base)
60204643Srdivacky#endif
61204643Srdivacky
62193326SedTYPE(Builtin, Type)
63193326SedTYPE(Complex, Type)
64193326SedTYPE(Pointer, Type)
65193326SedTYPE(BlockPointer, Type)
66193326SedABSTRACT_TYPE(Reference, Type)
67193326SedTYPE(LValueReference, ReferenceType)
68193326SedTYPE(RValueReference, ReferenceType)
69193326SedTYPE(MemberPointer, Type)
70193326SedABSTRACT_TYPE(Array, Type)
71193326SedTYPE(ConstantArray, ArrayType)
72193326SedTYPE(IncompleteArray, ArrayType)
73193326SedTYPE(VariableArray, ArrayType)
74193326SedDEPENDENT_TYPE(DependentSizedArray, ArrayType)
75194613SedDEPENDENT_TYPE(DependentSizedExtVector, Type)
76193326SedTYPE(Vector, Type)
77193326SedTYPE(ExtVector, VectorType)
78193326SedABSTRACT_TYPE(Function, Type)
79193326SedTYPE(FunctionProto, FunctionType)
80193326SedTYPE(FunctionNoProto, FunctionType)
81200583SrdivackyDEPENDENT_TYPE(UnresolvedUsing, Type)
82218893SdimNON_CANONICAL_TYPE(Paren, Type)
83193326SedNON_CANONICAL_TYPE(Typedef, Type)
84263508SdimNON_CANONICAL_TYPE(Decayed, Type)
85204643SrdivackyNON_CANONICAL_UNLESS_DEPENDENT_TYPE(TypeOfExpr, Type)
86204643SrdivackyNON_CANONICAL_UNLESS_DEPENDENT_TYPE(TypeOf, Type)
87204643SrdivackyNON_CANONICAL_UNLESS_DEPENDENT_TYPE(Decltype, Type)
88223017SdimNON_CANONICAL_UNLESS_DEPENDENT_TYPE(UnaryTransform, Type)
89193326SedABSTRACT_TYPE(Tag, Type)
90193326SedTYPE(Record, TagType)
91193326SedTYPE(Enum, TagType)
92198092SrdivackyNON_CANONICAL_TYPE(Elaborated, Type)
93218893SdimNON_CANONICAL_TYPE(Attributed, Type)
94193326SedDEPENDENT_TYPE(TemplateTypeParm, Type)
95198398SrdivackyNON_CANONICAL_TYPE(SubstTemplateTypeParm, Type)
96218893SdimDEPENDENT_TYPE(SubstTemplateTypeParmPack, Type)
97204643SrdivackyNON_CANONICAL_UNLESS_DEPENDENT_TYPE(TemplateSpecialization, Type)
98251662SdimTYPE(Auto, Type)
99207619SrdivackyDEPENDENT_TYPE(InjectedClassName, Type)
100206084SrdivackyDEPENDENT_TYPE(DependentName, Type)
101210299SedDEPENDENT_TYPE(DependentTemplateSpecialization, Type)
102263508SdimNON_CANONICAL_UNLESS_DEPENDENT_TYPE(PackExpansion, Type)
103208600SrdivackyTYPE(ObjCObject, Type)
104208600SrdivackyTYPE(ObjCInterface, ObjCObjectType)
105194613SedTYPE(ObjCObjectPointer, Type)
106226633SdimTYPE(Atomic, Type)
107193326Sed
108203955Srdivacky#ifdef LAST_TYPE
109226633SdimLAST_TYPE(Atomic)
110203955Srdivacky#undef LAST_TYPE
111203955Srdivacky#endif
112203955Srdivacky
113198092Srdivacky// These types are always leaves in the type hierarchy.
114198092Srdivacky#ifdef LEAF_TYPE
115198092SrdivackyLEAF_TYPE(Enum)
116198092SrdivackyLEAF_TYPE(Builtin)
117207619SrdivackyLEAF_TYPE(Record)
118207619SrdivackyLEAF_TYPE(InjectedClassName)
119198092SrdivackyLEAF_TYPE(ObjCInterface)
120198092SrdivackyLEAF_TYPE(TemplateTypeParm)
121198092Srdivacky#undef LEAF_TYPE
122198092Srdivacky#endif
123198092Srdivacky
124204643Srdivacky#undef NON_CANONICAL_UNLESS_DEPENDENT_TYPE
125193326Sed#undef DEPENDENT_TYPE
126193326Sed#undef NON_CANONICAL_TYPE
127193326Sed#undef ABSTRACT_TYPE
128193326Sed#undef TYPE
129