TypeNodes.def revision 24fab41057e4b67ed69a6b4027d5ae0f2f6934dc
1//===-- TypeNodes.def - Metadata about Type AST nodes -----------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 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: 15// 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. 19// 20// ABSTRACT_TYPE(Class, Base) - An abstract class that shows up in 21// the type hierarchy but has no concrete instances. 22// 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. 28// 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. 33// 34// There is a fifth macro, independent of the others. Most clients 35// will not need to use it. 36// 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. 39// 40//===----------------------------------------------------------------------===// 41 42#ifndef ABSTRACT_TYPE 43# define ABSTRACT_TYPE(Class, Base) TYPE(Class, Base) 44#endif 45 46#ifndef NON_CANONICAL_TYPE 47# define NON_CANONICAL_TYPE(Class, Base) TYPE(Class, Base) 48#endif 49 50#ifndef DEPENDENT_TYPE 51# define DEPENDENT_TYPE(Class, Base) TYPE(Class, Base) 52#endif 53 54TYPE(Builtin, Type) 55TYPE(FixedWidthInt, Type) 56TYPE(Complex, Type) 57TYPE(Pointer, Type) 58TYPE(BlockPointer, Type) 59ABSTRACT_TYPE(Reference, Type) 60TYPE(LValueReference, ReferenceType) 61TYPE(RValueReference, ReferenceType) 62TYPE(MemberPointer, Type) 63ABSTRACT_TYPE(Array, Type) 64TYPE(ConstantArray, ArrayType) 65NON_CANONICAL_TYPE(ConstantArrayWithExpr, ConstantArrayType) 66NON_CANONICAL_TYPE(ConstantArrayWithoutExpr, ConstantArrayType) 67TYPE(IncompleteArray, ArrayType) 68TYPE(VariableArray, ArrayType) 69DEPENDENT_TYPE(DependentSizedArray, ArrayType) 70DEPENDENT_TYPE(DependentSizedExtVector, Type) 71TYPE(Vector, Type) 72TYPE(ExtVector, VectorType) 73ABSTRACT_TYPE(Function, Type) 74TYPE(FunctionProto, FunctionType) 75TYPE(FunctionNoProto, FunctionType) 76NON_CANONICAL_TYPE(Typedef, Type) 77NON_CANONICAL_TYPE(TypeOfExpr, Type) 78NON_CANONICAL_TYPE(TypeOf, Type) 79NON_CANONICAL_TYPE(Decltype, Type) 80ABSTRACT_TYPE(Tag, Type) 81TYPE(Record, TagType) 82TYPE(Enum, TagType) 83NON_CANONICAL_TYPE(Elaborated, Type) 84DEPENDENT_TYPE(TemplateTypeParm, Type) 85TYPE(TemplateSpecialization, Type) 86NON_CANONICAL_TYPE(QualifiedName, Type) 87DEPENDENT_TYPE(Typename, Type) 88TYPE(ObjCInterface, Type) 89TYPE(ObjCObjectPointer, Type) 90NON_CANONICAL_TYPE(ObjCProtocolList, Type) 91 92// These types are always leaves in the type hierarchy. 93#ifdef LEAF_TYPE 94LEAF_TYPE(Enum) 95LEAF_TYPE(Builtin) 96LEAF_TYPE(FixedWidthInt) 97LEAF_TYPE(ObjCInterface) 98LEAF_TYPE(ObjCObjectPointer) 99LEAF_TYPE(TemplateTypeParm) 100#undef LEAF_TYPE 101#endif 102 103#undef DEPENDENT_TYPE 104#undef NON_CANONICAL_TYPE 105#undef ABSTRACT_TYPE 106#undef TYPE 107