TypeNodes.def revision 263508
1199482Srdivacky//===-- TypeNodes.def - Metadata about Type AST nodes -----------*- C++ -*-===// 2199482Srdivacky// 3353358Sdim// The LLVM Compiler Infrastructure 4353358Sdim// 5353358Sdim// This file is distributed under the University of Illinois Open Source 6199482Srdivacky// License. See LICENSE.TXT for details. 7199482Srdivacky// 8249423Sdim//===----------------------------------------------------------------------===// 9249423Sdim// 10341825Sdim// This file defines the AST type info database. Each type node is 11249423Sdim// enumerated by providing its name (e.g., "Builtin" or "Enum") and 12249423Sdim// base class (e.g., "Type" or "TagType"). Depending on where in the 13249423Sdim// abstract syntax tree the type will show up, the enumeration uses 14249423Sdim// one of four different macros: 15249423Sdim// 16199482Srdivacky// TYPE(Class, Base) - A type that can show up anywhere in the AST, 17199482Srdivacky// and might be dependent, canonical, or non-canonical. All clients 18199482Srdivacky// will need to understand these types. 19199482Srdivacky// 20280031Sdim// ABSTRACT_TYPE(Class, Base) - An abstract class that shows up in 21226633Sdim// the type hierarchy but has no concrete instances. 22226633Sdim// 23280031Sdim// NON_CANONICAL_TYPE(Class, Base) - A type that can show up 24234353Sdim// anywhere in the AST but will never be a part of a canonical 25199482Srdivacky// type. Clients that only need to deal with canonical types 26353358Sdim// (ignoring, e.g., typedefs and other type alises used for 27276479Sdim// pretty-printing) can ignore these types. 28199482Srdivacky// 29210299Sed// DEPENDENT_TYPE(Class, Base) - A type that will only show up 30199482Srdivacky// within a C++ template that has not been instantiated, e.g., a 31199482Srdivacky// type that is always dependent. Clients that do not need to deal 32210299Sed// with uninstantiated C++ templates can ignore these types. 33199482Srdivacky// 34199482Srdivacky// NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) - A type that 35249423Sdim// is non-canonical unless it is dependent. Defaults to TYPE because 36199482Srdivacky// it is neither reliably dependent nor reliably non-canonical. 37234353Sdim// 38276479Sdim// There is a sixth macro, independent of the others. Most clients 39199482Srdivacky// will not need to use it. 40203955Srdivacky// 41224145Sdim// LEAF_TYPE(Class) - A type that never has inner types. Clients 42199482Srdivacky// which can operate on such types more efficiently may wish to do so. 43218893Sdim// 44280031Sdim//===----------------------------------------------------------------------===// 45280031Sdim 46218893Sdim#ifndef ABSTRACT_TYPE 47199482Srdivacky# define ABSTRACT_TYPE(Class, Base) TYPE(Class, Base) 48199482Srdivacky#endif 49199482Srdivacky 50199482Srdivacky#ifndef NON_CANONICAL_TYPE 51344779Sdim# define NON_CANONICAL_TYPE(Class, Base) TYPE(Class, Base) 52344779Sdim#endif 53344779Sdim 54344779Sdim#ifndef DEPENDENT_TYPE 55344779Sdim# define DEPENDENT_TYPE(Class, Base) TYPE(Class, Base) 56344779Sdim#endif 57341825Sdim 58199482Srdivacky#ifndef NON_CANONICAL_UNLESS_DEPENDENT_TYPE 59249423Sdim# define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base) TYPE(Class, Base) 60199482Srdivacky#endif 61199482Srdivacky 62199482SrdivackyTYPE(Builtin, Type) 63249423SdimTYPE(Complex, Type) 64199482SrdivackyTYPE(Pointer, Type) 65199482SrdivackyTYPE(BlockPointer, Type) 66249423SdimABSTRACT_TYPE(Reference, Type) 67199482SrdivackyTYPE(LValueReference, ReferenceType) 68199482SrdivackyTYPE(RValueReference, ReferenceType) 69249423SdimTYPE(MemberPointer, Type) 70280031SdimABSTRACT_TYPE(Array, Type) 71280031SdimTYPE(ConstantArray, ArrayType) 72199482SrdivackyTYPE(IncompleteArray, ArrayType) 73341825SdimTYPE(VariableArray, ArrayType) 74224145SdimDEPENDENT_TYPE(DependentSizedArray, ArrayType) 75224145SdimDEPENDENT_TYPE(DependentSizedExtVector, Type) 76224145SdimTYPE(Vector, Type) 77249423SdimTYPE(ExtVector, VectorType) 78249423SdimABSTRACT_TYPE(Function, Type) 79224145SdimTYPE(FunctionProto, FunctionType) 80224145SdimTYPE(FunctionNoProto, FunctionType) 81341825SdimDEPENDENT_TYPE(UnresolvedUsing, Type) 82199482SrdivackyNON_CANONICAL_TYPE(Paren, Type) 83249423SdimNON_CANONICAL_TYPE(Typedef, Type) 84199482SrdivackyNON_CANONICAL_TYPE(Decayed, Type) 85321369SdimNON_CANONICAL_UNLESS_DEPENDENT_TYPE(TypeOfExpr, Type) 86199482SrdivackyNON_CANONICAL_UNLESS_DEPENDENT_TYPE(TypeOf, Type) 87199482SrdivackyNON_CANONICAL_UNLESS_DEPENDENT_TYPE(Decltype, Type) 88199482SrdivackyNON_CANONICAL_UNLESS_DEPENDENT_TYPE(UnaryTransform, Type) 89341825SdimABSTRACT_TYPE(Tag, Type) 90199482SrdivackyTYPE(Record, TagType) 91199482SrdivackyTYPE(Enum, TagType) 92249423SdimNON_CANONICAL_TYPE(Elaborated, Type) 93249423SdimNON_CANONICAL_TYPE(Attributed, Type) 94199482SrdivackyDEPENDENT_TYPE(TemplateTypeParm, Type) 95199482SrdivackyNON_CANONICAL_TYPE(SubstTemplateTypeParm, Type) 96341825SdimDEPENDENT_TYPE(SubstTemplateTypeParmPack, Type) 97249423SdimNON_CANONICAL_UNLESS_DEPENDENT_TYPE(TemplateSpecialization, Type) 98249423SdimTYPE(Auto, Type) 99234353SdimDEPENDENT_TYPE(InjectedClassName, Type) 100199482SrdivackyDEPENDENT_TYPE(DependentName, Type) 101199482SrdivackyDEPENDENT_TYPE(DependentTemplateSpecialization, Type) 102341825SdimNON_CANONICAL_UNLESS_DEPENDENT_TYPE(PackExpansion, Type) 103261991SdimTYPE(ObjCObject, Type) 104261991SdimTYPE(ObjCInterface, ObjCObjectType) 105261991SdimTYPE(ObjCObjectPointer, Type) 106261991SdimTYPE(Atomic, Type) 107261991Sdim 108261991Sdim#ifdef LAST_TYPE 109261991SdimLAST_TYPE(Atomic) 110199482Srdivacky#undef LAST_TYPE 111199482Srdivacky#endif 112199482Srdivacky 113199482Srdivacky// These types are always leaves in the type hierarchy. 114199482Srdivacky#ifdef LEAF_TYPE 115199482SrdivackyLEAF_TYPE(Enum) 116199482SrdivackyLEAF_TYPE(Builtin) 117199482SrdivackyLEAF_TYPE(Record) 118199482SrdivackyLEAF_TYPE(InjectedClassName) 119199482SrdivackyLEAF_TYPE(ObjCInterface) 120199482SrdivackyLEAF_TYPE(TemplateTypeParm) 121199482Srdivacky#undef LEAF_TYPE 122199482Srdivacky#endif 123199482Srdivacky 124199482Srdivacky#undef NON_CANONICAL_UNLESS_DEPENDENT_TYPE 125199482Srdivacky#undef DEPENDENT_TYPE 126199482Srdivacky#undef NON_CANONICAL_TYPE 127199482Srdivacky#undef ABSTRACT_TYPE 128199482Srdivacky#undef TYPE 129199482Srdivacky