TypeNodes.def revision 203955
1107590Sobrien//===-- TypeNodes.def - Metadata about Type AST nodes -----------*- C++ -*-===// 2169689Skan// 3132718Skan// The LLVM Compiler Infrastructure 4107590Sobrien// 5107590Sobrien// This file is distributed under the University of Illinois Open Source 6107590Sobrien// License. See LICENSE.TXT for details. 7132718Skan// 8107590Sobrien//===----------------------------------------------------------------------===// 9132718Skan// 10132718Skan// This file defines the AST type info database. Each type node is 11132718Skan// enumerated by providing its name (e.g., "Builtin" or "Enum") and 12132718Skan// base class (e.g., "Type" or "TagType"). Depending on where in the 13107590Sobrien// abstract syntax tree the type will show up, the enumeration uses 14132718Skan// one of four different macros: 15132718Skan// 16132718Skan// TYPE(Class, Base) - A type that can show up anywhere in the AST, 17132718Skan// and might be dependent, canonical, or non-canonical. All clients 18132718Skan// will need to understand these types. 19107590Sobrien// 20132718Skan// ABSTRACT_TYPE(Class, Base) - An abstract class that shows up in 21169689Skan// the type hierarchy but has no concrete instances. 22169689Skan// 23107590Sobrien// NON_CANONICAL_TYPE(Class, Base) - A type that can show up 24107590Sobrien// anywhere in the AST but will never be a part of a canonical 25169689Skan// type. Clients that only need to deal with canonical types 26107590Sobrien// (ignoring, e.g., typedefs and other type alises used for 27169689Skan// pretty-printing) can ignore these types. 28107590Sobrien// 29107590Sobrien// DEPENDENT_TYPE(Class, Base) - A type that will only show up 30132718Skan// within a C++ template that has not been instantiated, e.g., a 31132718Skan// type that is always dependent. Clients that do not need to deal 32132718Skan// with uninstantiated C++ templates can ignore these types. 33169689Skan// 34132718Skan// There is a fifth macro, independent of the others. Most clients 35132718Skan// will not need to use it. 36169689Skan// 37132718Skan// LEAF_TYPE(Class) - A type that never has inner types. Clients 38132718Skan// which can operate on such types more efficiently may wish to do so. 39169689Skan// 40169689Skan//===----------------------------------------------------------------------===// 41132718Skan 42169689Skan#ifndef ABSTRACT_TYPE 43169689Skan# define ABSTRACT_TYPE(Class, Base) TYPE(Class, Base) 44169689Skan#endif 45169689Skan 46169689Skan#ifndef NON_CANONICAL_TYPE 47169689Skan# define NON_CANONICAL_TYPE(Class, Base) TYPE(Class, Base) 48169689Skan#endif 49107590Sobrien 50107590Sobrien#ifndef DEPENDENT_TYPE 51107590Sobrien# define DEPENDENT_TYPE(Class, Base) TYPE(Class, Base) 52107590Sobrien#endif 53107590Sobrien 54107590SobrienTYPE(Builtin, Type) 55117395SkanTYPE(Complex, Type) 56117395SkanTYPE(Pointer, Type) 57117395SkanTYPE(BlockPointer, Type) 58107590SobrienABSTRACT_TYPE(Reference, Type) 59117395SkanTYPE(LValueReference, ReferenceType) 60132718SkanTYPE(RValueReference, ReferenceType) 61132718SkanTYPE(MemberPointer, Type) 62169689SkanABSTRACT_TYPE(Array, Type) 63169689SkanTYPE(ConstantArray, ArrayType) 64132718SkanTYPE(IncompleteArray, ArrayType) 65132718SkanTYPE(VariableArray, ArrayType) 66132718SkanDEPENDENT_TYPE(DependentSizedArray, ArrayType) 67132718SkanDEPENDENT_TYPE(DependentSizedExtVector, Type) 68132718SkanTYPE(Vector, Type) 69132718SkanTYPE(ExtVector, VectorType) 70132718SkanABSTRACT_TYPE(Function, Type) 71132718SkanTYPE(FunctionProto, FunctionType) 72132718SkanTYPE(FunctionNoProto, FunctionType) 73132718SkanDEPENDENT_TYPE(UnresolvedUsing, Type) 74132718SkanNON_CANONICAL_TYPE(Typedef, Type) 75132718SkanNON_CANONICAL_TYPE(TypeOfExpr, Type) 76132718SkanNON_CANONICAL_TYPE(TypeOf, Type) 77169689SkanNON_CANONICAL_TYPE(Decltype, Type) 78169689SkanABSTRACT_TYPE(Tag, Type) 79169689SkanTYPE(Record, TagType) 80132718SkanTYPE(Enum, TagType) 81132718SkanNON_CANONICAL_TYPE(Elaborated, Type) 82117395SkanDEPENDENT_TYPE(TemplateTypeParm, Type) 83117395SkanNON_CANONICAL_TYPE(SubstTemplateTypeParm, Type) 84117395SkanTYPE(TemplateSpecialization, Type) 85117395SkanNON_CANONICAL_TYPE(QualifiedName, Type) 86117395SkanDEPENDENT_TYPE(Typename, Type) 87117395SkanTYPE(ObjCInterface, Type) 88117395SkanTYPE(ObjCObjectPointer, Type) 89117395Skan 90117395Skan#ifdef LAST_TYPE 91117395SkanLAST_TYPE(ObjCObjectPointer) 92132718Skan#undef LAST_TYPE 93132718Skan#endif 94169689Skan 95169689Skan// These types are always leaves in the type hierarchy. 96169689Skan#ifdef LEAF_TYPE 97169689SkanLEAF_TYPE(Enum) 98169689SkanLEAF_TYPE(Builtin) 99169689SkanLEAF_TYPE(ObjCInterface) 100117395SkanLEAF_TYPE(TemplateTypeParm) 101117395Skan#undef LEAF_TYPE 102117395Skan#endif 103117395Skan 104117395Skan#undef DEPENDENT_TYPE 105117395Skan#undef NON_CANONICAL_TYPE 106117395Skan#undef ABSTRACT_TYPE 107132718Skan#undef TYPE 108132718Skan