aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/TypeXML.def
blob: e8cb4a6de0550eb1cf1566b1174ebe76b37fc495 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
//===-- TypeXML.def - Metadata about Type XML nodes ------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This file defines the XML type info database as written in the   
//  <ReferenceSection>/<Types> sub-nodes of the XML document. Type nodes 
//  are referred by "type" reference attributes throughout the document.
//  A type node never contains sub-nodes. 
//  The semantics of the attributes and enums are mostly self-documenting
//  by looking at the appropriate internally used functions and values.
//  The following macros are used:
//
//  NODE_XML( CLASS, NAME ) - A node of name NAME denotes a concrete 
//  type of class CLASS where CLASS is a class name used internally by clang. 
//  After a NODE_XML the definition of all (optional) attributes of that type 
//  node follows.
//
//  END_NODE_XML - Closes the attribute definition of the current node.
//
//  ID_ATTRIBUTE_XML - Each type node has an "id" attribute containing a 
//  string, which value uniquely identify the type. Other nodes may refer 
//  by "type" reference attributes to this value.
//
//  TYPE_ATTRIBUTE_XML( FN ) - Type nodes may refer to the ids of other type 
//  nodes by a "type" attribute. FN is internally used by clang.
// 
//  CONTEXT_ATTRIBUTE_XML( FN ) - Type nodes may refer to the ids of their 
//  declaration contexts by a "context" attribute. FN is internally used by 
//  clang.
//
//  ATTRIBUTE_XML( FN, NAME ) - An attribute named NAME. FN is internally 
//  used by clang. A boolean attribute have the values "0" or "1".
//
//  ATTRIBUTE_OPT_XML( FN, NAME ) - An optional attribute named NAME. 
//  Optional attributes are omitted for boolean types, if the value is false, 
//  for integral types, if the value is null and for strings, 
//  if the value is the empty string. FN is internally used by clang.
//
//  ATTRIBUTE_ENUM[_OPT]_XML( FN, NAME ) - An attribute named NAME. The value
//  is an enumeration defined with ENUM_XML macros immediately following after 
//  that macro. An optional attribute is ommited, if the particular enum is the 
//  empty string. FN is internally used by clang.
//  
//  ENUM_XML( VALUE, NAME ) - An enumeration element named NAME. VALUE is 
//  internally used by clang.
//
//  END_ENUM_XML - Closes the enumeration definition of the current attribute.
//
//===----------------------------------------------------------------------===//

#ifndef TYPE_ATTRIBUTE_XML
#  define TYPE_ATTRIBUTE_XML( FN )     ATTRIBUTE_XML(FN, "type")
#endif

#ifndef CONTEXT_ATTRIBUTE_XML
#  define CONTEXT_ATTRIBUTE_XML( FN )  ATTRIBUTE_XML(FN, "context")
#endif

NODE_XML(Type, "FIXME_Type")
  ID_ATTRIBUTE_XML
  ATTRIBUTE_XML(getTypeClassName(), "unhandled_type_name")
END_NODE_XML

NODE_XML(QualType, "CvQualifiedType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getTypePtr())                      // the qualified type, e.g. for 'T* const' it's 'T*'
  ATTRIBUTE_OPT_XML(isLocalConstQualified(), "const")        // boolean
  ATTRIBUTE_OPT_XML(isLocalVolatileQualified(), "volatile")  // boolean
  ATTRIBUTE_OPT_XML(isLocalRestrictQualified(), "restrict")  // boolean
  ATTRIBUTE_OPT_XML(getObjCGCAttr(), "objc_gc")         // Qualifiers::GC
  ATTRIBUTE_OPT_XML(getAddressSpace(), "address_space") // unsigned
END_NODE_XML

NODE_XML(BuiltinType, "FundamentalType")
  ID_ATTRIBUTE_XML
  ATTRIBUTE_ENUM_XML(getKind(), "kind")
	  ENUM_XML(BuiltinType::Void, "void")
	  ENUM_XML(BuiltinType::Bool, "bool")
	  ENUM_XML(BuiltinType::Char_U, "char")               // not explicitely qualified char, depends on target platform
	  ENUM_XML(BuiltinType::Char_S, "char")               // not explicitely qualified char, depends on target platform
	  ENUM_XML(BuiltinType::SChar, "signed char")
	  ENUM_XML(BuiltinType::Short, "short");
	  ENUM_XML(BuiltinType::Int, "int");
	  ENUM_XML(BuiltinType::Long, "long");
	  ENUM_XML(BuiltinType::LongLong, "long long");
	  ENUM_XML(BuiltinType::Int128, "__int128_t");
	  ENUM_XML(BuiltinType::UChar, "unsigned char");
	  ENUM_XML(BuiltinType::UShort, "unsigned short");
	  ENUM_XML(BuiltinType::UInt, "unsigned int");
	  ENUM_XML(BuiltinType::ULong, "unsigned long");
	  ENUM_XML(BuiltinType::ULongLong, "unsigned long long");
	  ENUM_XML(BuiltinType::UInt128, "__uint128_t");
	  ENUM_XML(BuiltinType::Float, "float");
	  ENUM_XML(BuiltinType::Double, "double");
	  ENUM_XML(BuiltinType::LongDouble, "long double");
	  ENUM_XML(BuiltinType::WChar, "wchar_t");
	  ENUM_XML(BuiltinType::Char16, "char16_t");
	  ENUM_XML(BuiltinType::Char32, "char32_t");
	  ENUM_XML(BuiltinType::NullPtr, "nullptr_t");        // This is the type of C++0x 'nullptr'.
	  ENUM_XML(BuiltinType::Overload, "overloaded");
	  ENUM_XML(BuiltinType::Dependent, "dependent");
  END_ENUM_XML
END_NODE_XML

NODE_XML(PointerType, "PointerType")    
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getPointeeType())
END_NODE_XML

NODE_XML(LValueReferenceType, "ReferenceType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getPointeeType())
END_NODE_XML

NODE_XML(RValueReferenceType, "ReferenceType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getPointeeType())
END_NODE_XML

NODE_XML(FunctionNoProtoType, "FunctionNoProtoType")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(FunctionProtoType, "FunctionType")
  ID_ATTRIBUTE_XML
  ATTRIBUTE_XML(getResultType(), "result_type")
  ATTRIBUTE_OPT_XML(isVariadic(), "variadic")
END_NODE_XML

NODE_XML(TypedefType, "Typedef")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getDecl()->getUnderlyingType())
  ATTRIBUTE_XML(getDecl()->getNameAsString(), "name")     // string
  CONTEXT_ATTRIBUTE_XML(getDecl()->getDeclContext())
END_NODE_XML

NODE_XML(ComplexType, "ComplexType")                      // C99 complex types (_Complex float etc)
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getElementType())
END_NODE_XML

NODE_XML(BlockPointerType, "BlockPointerType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getPointeeType())                    // alway refers to a function type
END_NODE_XML

NODE_XML(MemberPointerType, "MemberPointerType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getPointeeType())
  ATTRIBUTE_XML(getClass(), "class_type")                 // refers to the class type id of which the pointee is a member
END_NODE_XML

NODE_XML(ConstantArrayType, "ArrayType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getElementType())
  ATTRIBUTE_XML(getSize(), "size")                        // unsigned                    
  ATTRIBUTE_ENUM_OPT_XML(getSizeModifier(), "size_modifier")
	  ENUM_XML(ArrayType::Normal, "")
	  ENUM_XML(ArrayType::Static, "static")
	  ENUM_XML(ArrayType::Star, "star")
  END_ENUM_XML
  ATTRIBUTE_OPT_XML(getIndexTypeCVRQualifiers(), "index_type_qualifier")   // unsigned
END_NODE_XML

NODE_XML(IncompleteArrayType, "IncompleteArrayType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getElementType())
END_NODE_XML

NODE_XML(VariableArrayType, "VariableArrayType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getElementType())
  // note: the size expression is print at the point of declaration
END_NODE_XML

NODE_XML(DependentSizedArrayType, "DependentSizedArrayType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getElementType())
  // FIXME: how to deal with size expression?
END_NODE_XML

NODE_XML(VectorType, "VectorType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getElementType())
  ATTRIBUTE_XML(getNumElements(), "size")               // unsigned
END_NODE_XML

NODE_XML(ExtVectorType, "ExtVectorType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getElementType())
  ATTRIBUTE_XML(getNumElements(), "size")               // unsigned
END_NODE_XML

NODE_XML(TypeOfExprType, "TypeOfExprType")
  ID_ATTRIBUTE_XML
  // note: the typeof expression is print at the point of use
END_NODE_XML

NODE_XML(TypeOfType, "TypeOfType")
  ID_ATTRIBUTE_XML
  TYPE_ATTRIBUTE_XML(getUnderlyingType())
END_NODE_XML


NODE_XML(RecordType, "Record")
  ID_ATTRIBUTE_XML
  ATTRIBUTE_XML(getDecl()->getNameAsString(), "name")   // string
  ATTRIBUTE_ENUM_XML(getDecl()->getTagKind(), "kind")
    ENUM_XML(TTK_Struct, "struct")
    ENUM_XML(TTK_Union, "union")
    ENUM_XML(TTK_Class, "class")
  END_ENUM_XML
  CONTEXT_ATTRIBUTE_XML(getDecl()->getDeclContext())
END_NODE_XML

NODE_XML(EnumType, "Enum")
  ID_ATTRIBUTE_XML
  ATTRIBUTE_XML(getDecl()->getNameAsString(), "name")   // string
  CONTEXT_ATTRIBUTE_XML(getDecl()->getDeclContext())
END_NODE_XML

NODE_XML(TemplateTypeParmType, "TemplateTypeParmType")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(TemplateSpecializationType, "TemplateSpecializationType")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(ElaboratedType, "ElaboratedType")
  ID_ATTRIBUTE_XML
  ATTRIBUTE_ENUM_XML(getKeyword(), "keyword")
    ENUM_XML(ETK_None, "none")
    ENUM_XML(ETK_Typename, "typename")
    ENUM_XML(ETK_Struct, "struct")
    ENUM_XML(ETK_Union, "union")
    ENUM_XML(ETK_Class, "class")
    ENUM_XML(ETK_Enum, "enum")
  END_ENUM_XML
  TYPE_ATTRIBUTE_XML(getNamedType())
END_NODE_XML

NODE_XML(InjectedClassNameType, "InjectedClassNameType")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(DependentNameType, "DependentNameType")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(DependentTemplateSpecializationType,
         "DependentTemplateSpecializationType")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(ObjCInterfaceType, "ObjCInterfaceType")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(ObjCObjectPointerType, "ObjCObjectPointerType")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(SubstTemplateTypeParmType, "SubstTemplateTypeParm")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(DependentSizedExtVectorType, "DependentSizedExtVector")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(UnresolvedUsingType, "UnresolvedUsing")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(DependentTypeOfExprType, "DependentTypeOfExpr")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(DecltypeType, "Decltype")
  ID_ATTRIBUTE_XML
END_NODE_XML

NODE_XML(DependentDecltypeType, "DependentDecltype")
  ID_ATTRIBUTE_XML
END_NODE_XML

//===----------------------------------------------------------------------===//
#undef NODE_XML
#undef ID_ATTRIBUTE_XML                
#undef TYPE_ATTRIBUTE_XML
#undef CONTEXT_ATTRIBUTE_XML
#undef ATTRIBUTE_XML
#undef ATTRIBUTE_OPT_XML
#undef ATTRIBUTE_ENUM_XML
#undef ATTRIBUTE_ENUM_OPT_XML
#undef ENUM_XML
#undef END_ENUM_XML                    
#undef END_NODE_XML