TypeNodes.def revision 54e14c4db764c0636160d26c5bbf491637c83a76
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) 65TYPE(IncompleteArray, ArrayType) 66TYPE(VariableArray, ArrayType) 67DEPENDENT_TYPE(DependentSizedArray, ArrayType) 68DEPENDENT_TYPE(DependentSizedExtVector, Type) 69TYPE(Vector, Type) 70TYPE(ExtVector, VectorType) 71ABSTRACT_TYPE(Function, Type) 72TYPE(FunctionProto, FunctionType) 73TYPE(FunctionNoProto, FunctionType) 74NON_CANONICAL_TYPE(Typedef, Type) 75NON_CANONICAL_TYPE(TypeOfExpr, Type) 76NON_CANONICAL_TYPE(TypeOf, Type) 77NON_CANONICAL_TYPE(Decltype, Type) 78ABSTRACT_TYPE(Tag, Type) 79TYPE(Record, TagType) 80TYPE(Enum, TagType) 81NON_CANONICAL_TYPE(Elaborated, Type) 82DEPENDENT_TYPE(TemplateTypeParm, Type) 83NON_CANONICAL_TYPE(SubstTemplateTypeParm, Type) 84TYPE(TemplateSpecialization, Type) 85NON_CANONICAL_TYPE(QualifiedName, Type) 86DEPENDENT_TYPE(Typename, Type) 87TYPE(ObjCInterface, Type) 88TYPE(ObjCObjectPointer, Type) 89 90// These types are always leaves in the type hierarchy. 91#ifdef LEAF_TYPE 92LEAF_TYPE(Enum) 93LEAF_TYPE(Builtin) 94LEAF_TYPE(FixedWidthInt) 95LEAF_TYPE(ObjCInterface) 96LEAF_TYPE(TemplateTypeParm) 97#undef LEAF_TYPE 98#endif 99 100#undef DEPENDENT_TYPE 101#undef NON_CANONICAL_TYPE 102#undef ABSTRACT_TYPE 103#undef TYPE 104