 |
|
 |
|
| Files: |
1 |
|
Branches Taken: |
32.5% |
13 / 40 |
| Generated: |
2010-02-10 01:31 |
|
Branches Executed: |
90.0% |
36 / 40 |
| |
|
Line Coverage: |
47.5% |
58 / 122 |
| |
 |
|
 |
1 : //===-- TypeXML.def - Metadata about Type XML 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 XML type info database as written in the
11 : // <ReferenceSection>/<Types> sub-nodes of the XML document. Type nodes
12 : // are referred by "type" reference attributes throughout the document.
13 : // A type node never contains sub-nodes.
14 : // The semantics of the attributes and enums are mostly self-documenting
15 : // by looking at the appropriate internally used functions and values.
16 : // The following macros are used:
17 : //
18 : // NODE_XML( CLASS, NAME ) - A node of name NAME denotes a concrete
19 : // type of class CLASS where CLASS is a class name used internally by clang.
20 : // After a NODE_XML the definition of all (optional) attributes of that type
21 : // node follows.
22 : //
23 : // END_NODE_XML - Closes the attribute definition of the current node.
24 : //
25 : // ID_ATTRIBUTE_XML - Each type node has an "id" attribute containing a
26 : // string, which value uniquely identify the type. Other nodes may refer
27 : // by "type" reference attributes to this value.
28 : //
29 : // TYPE_ATTRIBUTE_XML( FN ) - Type nodes may refer to the ids of other type
30 : // nodes by a "type" attribute. FN is internally used by clang.
31 : //
32 : // CONTEXT_ATTRIBUTE_XML( FN ) - Type nodes may refer to the ids of their
33 : // declaration contexts by a "context" attribute. FN is internally used by
34 : // clang.
35 : //
36 : // ATTRIBUTE_XML( FN, NAME ) - An attribute named NAME. FN is internally
37 : // used by clang. A boolean attribute have the values "0" or "1".
38 : //
39 : // ATTRIBUTE_OPT_XML( FN, NAME ) - An optional attribute named NAME.
40 : // Optional attributes are omitted for boolean types, if the value is false,
41 : // for integral types, if the value is null and for strings,
42 : // if the value is the empty string. FN is internally used by clang.
43 : //
44 : // ATTRIBUTE_ENUM[_OPT]_XML( FN, NAME ) - An attribute named NAME. The value
45 : // is an enumeration defined with ENUM_XML macros immediately following after
46 : // that macro. An optional attribute is ommited, if the particular enum is the
47 : // empty string. FN is internally used by clang.
48 : //
49 : // ENUM_XML( VALUE, NAME ) - An enumeration element named NAME. VALUE is
50 : // internally used by clang.
51 : //
52 : // END_ENUM_XML - Closes the enumeration definition of the current attribute.
53 : //
54 : //===----------------------------------------------------------------------===//
55 :
56 : #ifndef TYPE_ATTRIBUTE_XML
57 : # define TYPE_ATTRIBUTE_XML( FN ) ATTRIBUTE_XML(FN, "type")
58 : #endif
59 :
60 : #ifndef CONTEXT_ATTRIBUTE_XML
61 : # define CONTEXT_ATTRIBUTE_XML( FN ) ATTRIBUTE_XML(FN, "context")
62 : #endif
63 :
64 :
65 2: NODE_XML(QualType, "CvQualifiedType")
66 : ID_ATTRIBUTE_XML
67 2: TYPE_ATTRIBUTE_XML(getTypePtr()) // the qualified type, e.g. for 'T* const' it's 'T*'
68 2: ATTRIBUTE_OPT_XML(isLocalConstQualified(), "const") // boolean
69 2: ATTRIBUTE_OPT_XML(isLocalVolatileQualified(), "volatile") // boolean
70 2: ATTRIBUTE_OPT_XML(isLocalRestrictQualified(), "restrict") // boolean
71 2: ATTRIBUTE_OPT_XML(getObjCGCAttr(), "objc_gc") // Qualifiers::GC
72 2: ATTRIBUTE_OPT_XML(getAddressSpace(), "address_space") // unsigned
73 2: END_NODE_XML
74 :
75 20: NODE_XML(BuiltinType, "FundamentalType")
76 : ID_ATTRIBUTE_XML
0: branch 1 not taken
1: branch 2 taken
0: branch 3 not taken
0: branch 4 not taken
1: branch 5 taken
1: branch 6 taken
1: branch 7 taken
1: branch 8 taken
0: branch 9 not taken
0: branch 10 not taken
0: branch 11 not taken
1: branch 12 taken
0: branch 13 not taken
1: branch 14 taken
0: branch 15 not taken
0: branch 16 not taken
0: branch 17 not taken
1: branch 18 taken
1: branch 19 taken
1: branch 20 taken
0: branch 21 not taken
0: branch 22 not taken
0: branch 23 not taken
0: branch 24 not taken
0: branch 25 not taken
0: branch 26 not taken
77 10: ATTRIBUTE_ENUM_XML(getKind(), "kind")
78 1: ENUM_XML(BuiltinType::Void, "void")
79 0: ENUM_XML(BuiltinType::Bool, "bool")
80 0: ENUM_XML(BuiltinType::Char_U, "char") // not explicitely qualified char, depends on target platform
81 1: ENUM_XML(BuiltinType::Char_S, "char") // not explicitely qualified char, depends on target platform
82 1: ENUM_XML(BuiltinType::SChar, "signed char")
83 1: ENUM_XML(BuiltinType::Short, "short");
84 1: ENUM_XML(BuiltinType::Int, "int");
85 0: ENUM_XML(BuiltinType::Long, "long");
86 0: ENUM_XML(BuiltinType::LongLong, "long long");
87 0: ENUM_XML(BuiltinType::Int128, "__int128_t");
88 1: ENUM_XML(BuiltinType::UChar, "unsigned char");
89 0: ENUM_XML(BuiltinType::UShort, "unsigned short");
90 1: ENUM_XML(BuiltinType::UInt, "unsigned int");
91 0: ENUM_XML(BuiltinType::ULong, "unsigned long");
92 0: ENUM_XML(BuiltinType::ULongLong, "unsigned long long");
93 0: ENUM_XML(BuiltinType::UInt128, "__uint128_t");
94 1: ENUM_XML(BuiltinType::Float, "float");
95 1: ENUM_XML(BuiltinType::Double, "double");
96 1: ENUM_XML(BuiltinType::LongDouble, "long double");
97 0: ENUM_XML(BuiltinType::WChar, "wchar_t");
98 0: ENUM_XML(BuiltinType::Char16, "char16_t");
99 0: ENUM_XML(BuiltinType::Char32, "char32_t");
100 0: ENUM_XML(BuiltinType::NullPtr, "nullptr_t"); // This is the type of C++0x 'nullptr'.
101 0: ENUM_XML(BuiltinType::Overload, "overloaded");
102 0: ENUM_XML(BuiltinType::Dependent, "dependent");
103 : END_ENUM_XML
104 20: END_NODE_XML
105 :
106 24: NODE_XML(PointerType, "PointerType")
107 : ID_ATTRIBUTE_XML
108 24: TYPE_ATTRIBUTE_XML(getPointeeType())
109 24: END_NODE_XML
110 :
111 2: NODE_XML(LValueReferenceType, "ReferenceType")
112 : ID_ATTRIBUTE_XML
113 2: TYPE_ATTRIBUTE_XML(getPointeeType())
114 2: END_NODE_XML
115 :
116 0: NODE_XML(RValueReferenceType, "ReferenceType")
117 : ID_ATTRIBUTE_XML
118 0: TYPE_ATTRIBUTE_XML(getPointeeType())
119 0: END_NODE_XML
120 :
121 4: NODE_XML(FunctionNoProtoType, "FunctionNoProtoType")
122 : ID_ATTRIBUTE_XML
123 4: END_NODE_XML
124 :
125 18: NODE_XML(FunctionProtoType, "FunctionType")
126 : ID_ATTRIBUTE_XML
127 18: ATTRIBUTE_XML(getResultType(), "result_type")
128 9: ATTRIBUTE_OPT_XML(isVariadic(), "variadic")
129 18: END_NODE_XML
130 :
131 10: NODE_XML(TypedefType, "Typedef")
132 : ID_ATTRIBUTE_XML
133 10: TYPE_ATTRIBUTE_XML(getDecl()->getUnderlyingType())
134 10: ATTRIBUTE_XML(getDecl()->getNameAsString(), "name") // string
135 5: CONTEXT_ATTRIBUTE_XML(getDecl()->getDeclContext())
136 10: END_NODE_XML
137 :
138 2: NODE_XML(ComplexType, "ComplexType") // C99 complex types (_Complex float etc)
139 : ID_ATTRIBUTE_XML
140 2: TYPE_ATTRIBUTE_XML(getElementType())
141 2: END_NODE_XML
142 :
143 0: NODE_XML(BlockPointerType, "BlockPointerType")
144 : ID_ATTRIBUTE_XML
145 0: TYPE_ATTRIBUTE_XML(getPointeeType()) // alway refers to a function type
146 0: END_NODE_XML
147 :
148 0: NODE_XML(MemberPointerType, "MemberPointerType")
149 : ID_ATTRIBUTE_XML
150 0: TYPE_ATTRIBUTE_XML(getPointeeType())
151 0: ATTRIBUTE_XML(getClass(), "class_type") // refers to the class type id of which the pointee is a member
152 0: END_NODE_XML
153 :
154 12: NODE_XML(ConstantArrayType, "ArrayType")
155 : ID_ATTRIBUTE_XML
156 12: TYPE_ATTRIBUTE_XML(getElementType())
157 12: ATTRIBUTE_XML(getSize(), "size") // unsigned
0: branch 1 not taken
6: branch 2 taken
0: branch 3 not taken
0: branch 4 not taken
158 6: ATTRIBUTE_ENUM_OPT_XML(getSizeModifier(), "size_modifier")
0: branch 0 not taken
6: branch 1 taken
159 6: ENUM_XML(ArrayType::Normal, "")
0: branch 0 not taken
0: branch 1 not taken
160 0: ENUM_XML(ArrayType::Static, "static")
0: branch 0 not taken
0: branch 1 not taken
161 0: ENUM_XML(ArrayType::Star, "star")
162 : END_ENUM_XML
163 6: ATTRIBUTE_OPT_XML(getIndexTypeCVRQualifiers(), "index_type_qualifier") // unsigned
164 12: END_NODE_XML
165 :
166 0: NODE_XML(IncompleteArrayType, "IncompleteArrayType")
167 : ID_ATTRIBUTE_XML
168 0: TYPE_ATTRIBUTE_XML(getElementType())
169 0: END_NODE_XML
170 :
171 0: NODE_XML(VariableArrayType, "VariableArrayType")
172 : ID_ATTRIBUTE_XML
173 0: TYPE_ATTRIBUTE_XML(getElementType())
174 : // note: the size expression is print at the point of declaration
175 0: END_NODE_XML
176 :
177 0: NODE_XML(DependentSizedArrayType, "DependentSizedArrayType")
178 : ID_ATTRIBUTE_XML
179 0: TYPE_ATTRIBUTE_XML(getElementType())
180 : // FIXME: how to deal with size expression?
181 0: END_NODE_XML
182 :
183 0: NODE_XML(VectorType, "VectorType")
184 : ID_ATTRIBUTE_XML
185 0: TYPE_ATTRIBUTE_XML(getElementType())
186 0: ATTRIBUTE_XML(getNumElements(), "size") // unsigned
187 0: END_NODE_XML
188 :
189 4: NODE_XML(ExtVectorType, "ExtVectorType")
190 : ID_ATTRIBUTE_XML
191 4: TYPE_ATTRIBUTE_XML(getElementType())
192 4: ATTRIBUTE_XML(getNumElements(), "size") // unsigned
193 4: END_NODE_XML
194 :
195 0: NODE_XML(TypeOfExprType, "TypeOfExprType")
196 : ID_ATTRIBUTE_XML
197 : // note: the typeof expression is print at the point of use
198 0: END_NODE_XML
199 :
200 0: NODE_XML(TypeOfType, "TypeOfType")
201 : ID_ATTRIBUTE_XML
202 0: TYPE_ATTRIBUTE_XML(getUnderlyingType())
203 0: END_NODE_XML
204 :
205 :
206 12: NODE_XML(RecordType, "Record")
207 : ID_ATTRIBUTE_XML
208 12: ATTRIBUTE_XML(getDecl()->getNameAsString(), "name") // string
0: branch 2 not taken
6: branch 3 taken
0: branch 4 not taken
0: branch 5 not taken
209 6: ATTRIBUTE_ENUM_XML(getDecl()->getTagKind(), "kind")
210 6: ENUM_XML(TagDecl::TK_struct, "struct")
211 0: ENUM_XML(TagDecl::TK_union, "union")
212 0: ENUM_XML(TagDecl::TK_class, "class")
213 : END_ENUM_XML
214 6: CONTEXT_ATTRIBUTE_XML(getDecl()->getDeclContext())
215 12: END_NODE_XML
216 :
217 0: NODE_XML(EnumType, "Enum")
218 : ID_ATTRIBUTE_XML
219 0: ATTRIBUTE_XML(getDecl()->getNameAsString(), "name") // string
220 0: CONTEXT_ATTRIBUTE_XML(getDecl()->getDeclContext())
221 0: END_NODE_XML
222 :
223 0: NODE_XML(TemplateTypeParmType, "TemplateTypeParmType")
224 : ID_ATTRIBUTE_XML
225 0: END_NODE_XML
226 :
227 0: NODE_XML(TemplateSpecializationType, "TemplateSpecializationType")
228 : ID_ATTRIBUTE_XML
229 0: END_NODE_XML
230 :
231 0: NODE_XML(QualifiedNameType, "QualifiedNameType")
232 : ID_ATTRIBUTE_XML
233 0: TYPE_ATTRIBUTE_XML(getNamedType())
234 0: END_NODE_XML
235 :
236 0: NODE_XML(TypenameType, "TypenameType")
237 : ID_ATTRIBUTE_XML
238 0: END_NODE_XML
239 :
240 0: NODE_XML(ObjCInterfaceType, "ObjCInterfaceType")
241 : ID_ATTRIBUTE_XML
242 0: END_NODE_XML
243 :
244 0: NODE_XML(ObjCObjectPointerType, "ObjCObjectPointerType")
245 : ID_ATTRIBUTE_XML
246 0: END_NODE_XML
247 :
248 :
249 : //===----------------------------------------------------------------------===//
250 : #undef NODE_XML
251 : #undef ID_ATTRIBUTE_XML
252 : #undef TYPE_ATTRIBUTE_XML
253 : #undef CONTEXT_ATTRIBUTE_XML
254 : #undef ATTRIBUTE_XML
255 : #undef ATTRIBUTE_OPT_XML
256 : #undef ATTRIBUTE_ENUM_XML
257 : #undef ATTRIBUTE_ENUM_OPT_XML
258 : #undef ENUM_XML
259 : #undef END_ENUM_XML
260 : #undef END_NODE_XML
Generated: 2010-02-10 01:31 by zcov