172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//===-- TypeNodes.def - Metadata about Type AST nodes -----------*- C++ -*-===//
272564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//
372564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//                     The LLVM Compiler Infrastructure
472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//
572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor// This file is distributed under the University of Illinois Open Source
672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor// License. See LICENSE.TXT for details.
772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//
872564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//===----------------------------------------------------------------------===//
972564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//
1072564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//  This file defines the AST type info database. Each type node is
1172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//  enumerated by providing its name (e.g., "Builtin" or "Enum") and
1272564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//  base class (e.g., "Type" or "TagType"). Depending on where in the
1372564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//  abstract syntax tree the type will show up, the enumeration uses
1472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//  one of four different macros:
1572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//
1672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    TYPE(Class, Base) - A type that can show up anywhere in the AST,
1772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    and might be dependent, canonical, or non-canonical. All clients
1872564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    will need to understand these types.
1972564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//
2072564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    ABSTRACT_TYPE(Class, Base) - An abstract class that shows up in
2172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    the type hierarchy but has no concrete instances.
2272564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//
2372564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    NON_CANONICAL_TYPE(Class, Base) - A type that can show up
2472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    anywhere in the AST but will never be a part of a canonical
2572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    type. Clients that only need to deal with canonical types
2672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    (ignoring, e.g., typedefs and other type alises used for
2772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    pretty-printing) can ignore these types.
2872564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//
2972564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    DEPENDENT_TYPE(Class, Base) - A type that will only show up
3072564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    within a C++ template that has not been instantiated, e.g., a
3172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    type that is always dependent. Clients that do not need to deal
3272564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//    with uninstantiated C++ templates can ignore these types.
3372564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//
34ad5e73887052193afda72db8efcb812bd083a4a8John McCall//    NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) - A type that
35ad5e73887052193afda72db8efcb812bd083a4a8John McCall//    is non-canonical unless it is dependent.  Defaults to TYPE because
36ad5e73887052193afda72db8efcb812bd083a4a8John McCall//    it is neither reliably dependent nor reliably non-canonical.
37ad5e73887052193afda72db8efcb812bd083a4a8John McCall//
38ad5e73887052193afda72db8efcb812bd083a4a8John McCall//  There is a sixth macro, independent of the others.  Most clients
39183700f494ec9b6701b6efe82bcb25f4c79ba561John McCall//  will not need to use it.
40183700f494ec9b6701b6efe82bcb25f4c79ba561John McCall//
41183700f494ec9b6701b6efe82bcb25f4c79ba561John McCall//    LEAF_TYPE(Class) - A type that never has inner types.  Clients
42183700f494ec9b6701b6efe82bcb25f4c79ba561John McCall//    which can operate on such types more efficiently may wish to do so.
43183700f494ec9b6701b6efe82bcb25f4c79ba561John McCall//
4472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor//===----------------------------------------------------------------------===//
4572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor
4672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#ifndef ABSTRACT_TYPE
4772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#  define ABSTRACT_TYPE(Class, Base) TYPE(Class, Base)
4872564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#endif
4972564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor
5072564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#ifndef NON_CANONICAL_TYPE
5172564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#  define NON_CANONICAL_TYPE(Class, Base) TYPE(Class, Base)
5272564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#endif
5372564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor
5472564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#ifndef DEPENDENT_TYPE
5572564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#  define DEPENDENT_TYPE(Class, Base) TYPE(Class, Base)
5672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#endif
5772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor
58ad5e73887052193afda72db8efcb812bd083a4a8John McCall#ifndef NON_CANONICAL_UNLESS_DEPENDENT_TYPE
59ad5e73887052193afda72db8efcb812bd083a4a8John McCall#  define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) TYPE(Class, Base)
60ad5e73887052193afda72db8efcb812bd083a4a8John McCall#endif
61ad5e73887052193afda72db8efcb812bd083a4a8John McCall
6272564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(Builtin, Type)
6372564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(Complex, Type)
6472564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(Pointer, Type)
6572564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(BlockPointer, Type)
667c80bd64032e610c0dbd74fc0ef6ea334447f2fdSebastian RedlABSTRACT_TYPE(Reference, Type)
6702fd8ddba96a529c5868162a13f7bb2c5e36d522Douglas GregorTYPE(LValueReference, ReferenceType)
6802fd8ddba96a529c5868162a13f7bb2c5e36d522Douglas GregorTYPE(RValueReference, ReferenceType)
6972564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(MemberPointer, Type)
7072564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorABSTRACT_TYPE(Array, Type)
7172564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(ConstantArray, ArrayType)
7272564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(IncompleteArray, ArrayType)
7372564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(VariableArray, ArrayType)
7472564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorDEPENDENT_TYPE(DependentSizedArray, ArrayType)
759cdda0cf8528e3d595be9bfa002f0450074beb4dDouglas GregorDEPENDENT_TYPE(DependentSizedExtVector, Type)
7672564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(Vector, Type)
7772564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(ExtVector, VectorType)
7872564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorABSTRACT_TYPE(Function, Type)
7902fd8ddba96a529c5868162a13f7bb2c5e36d522Douglas GregorTYPE(FunctionProto, FunctionType)
8002fd8ddba96a529c5868162a13f7bb2c5e36d522Douglas GregorTYPE(FunctionNoProto, FunctionType)
81ed97649e9574b9d854fa4d6109c9333ae0993554John McCallDEPENDENT_TYPE(UnresolvedUsing, Type)
82075f8f1b6bed4d1b224c74f87508534cc6392ce6Abramo BagnaraNON_CANONICAL_TYPE(Paren, Type)
8372564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorNON_CANONICAL_TYPE(Typedef, Type)
84651f13cea278ec967336033dd032faef0e9fc2ecStephen HinesNON_CANONICAL_TYPE(Adjusted, Type)
85651f13cea278ec967336033dd032faef0e9fc2ecStephen HinesNON_CANONICAL_TYPE(Decayed, AdjustedType)
86ad5e73887052193afda72db8efcb812bd083a4a8John McCallNON_CANONICAL_UNLESS_DEPENDENT_TYPE(TypeOfExpr, Type)
87ad5e73887052193afda72db8efcb812bd083a4a8John McCallNON_CANONICAL_UNLESS_DEPENDENT_TYPE(TypeOf, Type)
88ad5e73887052193afda72db8efcb812bd083a4a8John McCallNON_CANONICAL_UNLESS_DEPENDENT_TYPE(Decltype, Type)
89ca63c200346c0ca9e00194ec6e34a5a7b0ed9321Sean HuntNON_CANONICAL_UNLESS_DEPENDENT_TYPE(UnaryTransform, Type)
9072564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorABSTRACT_TYPE(Tag, Type)
9172564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(Record, TagType)
9272564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorTYPE(Enum, TagType)
937da2431c23ef1ee8acb114e39692246e1801afc2John McCallNON_CANONICAL_TYPE(Elaborated, Type)
949d156a7b1b2771e191f2f5a45a7b7a694129463bJohn McCallNON_CANONICAL_TYPE(Attributed, Type)
9572564e73277e29f6db3305d1f27ba408abb7ed88Douglas GregorDEPENDENT_TYPE(TemplateTypeParm, Type)
9649a832bd499d6f61c23655f1fac99f0dd229756eJohn McCallNON_CANONICAL_TYPE(SubstTemplateTypeParm, Type)
97c3069d618f4661d923cb1b5c4525b082fce73b04Douglas GregorDEPENDENT_TYPE(SubstTemplateTypeParmPack, Type)
98ad5e73887052193afda72db8efcb812bd083a4a8John McCallNON_CANONICAL_UNLESS_DEPENDENT_TYPE(TemplateSpecialization, Type)
99dc7a4f5d7a7e3b60d4dc4a80338d7a2728540998Richard SmithTYPE(Auto, Type)
10031f17ecbef57b5679c017c375db330546b7b5145John McCallDEPENDENT_TYPE(InjectedClassName, Type)
1014714c12a1ab759156b78be8f109ea4c12213af57Douglas GregorDEPENDENT_TYPE(DependentName, Type)
10233500955d731c73717af52088b7fc0e7a85681e7John McCallDEPENDENT_TYPE(DependentTemplateSpecialization, Type)
103226399ce18cdcbb1e83af7c5e644bdabb9d4f2f8David BlaikieNON_CANONICAL_UNLESS_DEPENDENT_TYPE(PackExpansion, Type)
104c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44eJohn McCallTYPE(ObjCObject, Type)
105c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44eJohn McCallTYPE(ObjCInterface, ObjCObjectType)
106d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve NaroffTYPE(ObjCObjectPointer, Type)
107b001de7458d17c17e6d8b8034c7cfcefd3b70c00Eli FriedmanTYPE(Atomic, Type)
10872564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor
10927935ee59c30b0d8b610ab676aab8e65350af932John McCall#ifdef LAST_TYPE
110b001de7458d17c17e6d8b8034c7cfcefd3b70c00Eli FriedmanLAST_TYPE(Atomic)
11127935ee59c30b0d8b610ab676aab8e65350af932John McCall#undef LAST_TYPE
11227935ee59c30b0d8b610ab676aab8e65350af932John McCall#endif
11327935ee59c30b0d8b610ab676aab8e65350af932John McCall
114183700f494ec9b6701b6efe82bcb25f4c79ba561John McCall// These types are always leaves in the type hierarchy.
115183700f494ec9b6701b6efe82bcb25f4c79ba561John McCall#ifdef LEAF_TYPE
116183700f494ec9b6701b6efe82bcb25f4c79ba561John McCallLEAF_TYPE(Enum)
117183700f494ec9b6701b6efe82bcb25f4c79ba561John McCallLEAF_TYPE(Builtin)
11831f17ecbef57b5679c017c375db330546b7b5145John McCallLEAF_TYPE(Record)
11931f17ecbef57b5679c017c375db330546b7b5145John McCallLEAF_TYPE(InjectedClassName)
120183700f494ec9b6701b6efe82bcb25f4c79ba561John McCallLEAF_TYPE(ObjCInterface)
121183700f494ec9b6701b6efe82bcb25f4c79ba561John McCallLEAF_TYPE(TemplateTypeParm)
122183700f494ec9b6701b6efe82bcb25f4c79ba561John McCall#undef LEAF_TYPE
123183700f494ec9b6701b6efe82bcb25f4c79ba561John McCall#endif
124183700f494ec9b6701b6efe82bcb25f4c79ba561John McCall
125ad5e73887052193afda72db8efcb812bd083a4a8John McCall#undef NON_CANONICAL_UNLESS_DEPENDENT_TYPE
12672564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#undef DEPENDENT_TYPE
12772564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#undef NON_CANONICAL_TYPE
12872564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#undef ABSTRACT_TYPE
12972564e73277e29f6db3305d1f27ba408abb7ed88Douglas Gregor#undef TYPE
130