1 //===-- TypeNodes.def - Metadata about Type AST nodes -----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the AST type info database. Each type node is
11 // enumerated by providing its name (e.g., "Builtin" or "Enum") and
12 // base class (e.g., "Type" or "TagType"). Depending on where in the
13 // abstract syntax tree the type will show up, the enumeration uses
14 // one of four different macros:
16 // TYPE(Class, Base) - A type that can show up anywhere in the AST,
17 // and might be dependent, canonical, or non-canonical. All clients
18 // will need to understand these types.
20 // ABSTRACT_TYPE(Class, Base) - An abstract class that shows up in
21 // the type hierarchy but has no concrete instances.
23 // NON_CANONICAL_TYPE(Class, Base) - A type that can show up
24 // anywhere in the AST but will never be a part of a canonical
25 // type. Clients that only need to deal with canonical types
26 // (ignoring, e.g., typedefs and other type alises used for
27 // pretty-printing) can ignore these types.
29 // DEPENDENT_TYPE(Class, Base) - A type that will only show up
30 // within a C++ template that has not been instantiated, e.g., a
31 // type that is always dependent. Clients that do not need to deal
32 // with uninstantiated C++ templates can ignore these types.
34 // There is a fifth macro, independent of the others. Most clients
35 // will not need to use it.
37 // LEAF_TYPE(Class) - A type that never has inner types. Clients
38 // which can operate on such types more efficiently may wish to do so.
40 //===----------------------------------------------------------------------===//
43 # define ABSTRACT_TYPE(Class, Base) TYPE(Class, Base)
46 #ifndef NON_CANONICAL_TYPE
47 # define NON_CANONICAL_TYPE(Class, Base) TYPE(Class, Base)
50 #ifndef DEPENDENT_TYPE
51 # define DEPENDENT_TYPE(Class, Base) TYPE(Class, Base)
57 TYPE(BlockPointer, Type)
58 ABSTRACT_TYPE(Reference, Type)
59 TYPE(LValueReference, ReferenceType)
60 TYPE(RValueReference, ReferenceType)
61 TYPE(MemberPointer, Type)
62 ABSTRACT_TYPE(Array, Type)
63 TYPE(ConstantArray, ArrayType)
64 TYPE(IncompleteArray, ArrayType)
65 TYPE(VariableArray, ArrayType)
66 DEPENDENT_TYPE(DependentSizedArray, ArrayType)
67 DEPENDENT_TYPE(DependentSizedExtVector, Type)
69 TYPE(ExtVector, VectorType)
70 ABSTRACT_TYPE(Function, Type)
71 TYPE(FunctionProto, FunctionType)
72 TYPE(FunctionNoProto, FunctionType)
73 DEPENDENT_TYPE(UnresolvedUsing, Type)
74 NON_CANONICAL_TYPE(Typedef, Type)
75 NON_CANONICAL_TYPE(TypeOfExpr, Type)
76 NON_CANONICAL_TYPE(TypeOf, Type)
77 NON_CANONICAL_TYPE(Decltype, Type)
78 ABSTRACT_TYPE(Tag, Type)
81 NON_CANONICAL_TYPE(Elaborated, Type)
82 DEPENDENT_TYPE(TemplateTypeParm, Type)
83 NON_CANONICAL_TYPE(SubstTemplateTypeParm, Type)
84 TYPE(TemplateSpecialization, Type)
85 NON_CANONICAL_TYPE(QualifiedName, Type)
86 DEPENDENT_TYPE(Typename, Type)
87 TYPE(ObjCInterface, Type)
88 TYPE(ObjCObjectPointer, Type)
91 LAST_TYPE(ObjCObjectPointer)
95 // These types are always leaves in the type hierarchy.
99 LEAF_TYPE(ObjCInterface)
100 LEAF_TYPE(TemplateTypeParm)
104 #undef DEPENDENT_TYPE
105 #undef NON_CANONICAL_TYPE