@@ -122,13 +122,13 @@ void TypeVisitor::visitParenType(swift::ParenType* type) {
122
122
}
123
123
124
124
codeql::OptionalType TypeVisitor::translateOptionalType (const swift::OptionalType& type) {
125
- codeql::OptionalType entry{dispatcher_. assignNewLabel (type)} ;
125
+ auto entry = createEntry (type);
126
126
fillUnarySyntaxSugarType (type, entry);
127
127
return entry;
128
128
}
129
129
130
130
codeql::ArraySliceType TypeVisitor::translateArraySliceType (const swift::ArraySliceType& type) {
131
- codeql::ArraySliceType entry{dispatcher_. assignNewLabel (type)} ;
131
+ auto entry = createEntry (type);
132
132
fillUnarySyntaxSugarType (type, entry);
133
133
return entry;
134
134
}
@@ -163,7 +163,7 @@ void TypeVisitor::visitLValueType(swift::LValueType* type) {
163
163
164
164
codeql::PrimaryArchetypeType TypeVisitor::translatePrimaryArchetypeType (
165
165
const swift::PrimaryArchetypeType& type) {
166
- PrimaryArchetypeType entry{dispatcher_. assignNewLabel (type)} ;
166
+ auto entry = createEntry (type);
167
167
fillArchetypeType (type, entry);
168
168
return entry;
169
169
}
@@ -183,7 +183,6 @@ void TypeVisitor::fillUnarySyntaxSugarType(const swift::UnarySyntaxSugarType& ty
183
183
codeql::UnarySyntaxSugarType& entry) {
184
184
assert (type.getBaseType () && " expect UnarySyntaxSugarType to have BaseType" );
185
185
entry.base_type = dispatcher_.fetchLabel (type.getBaseType ());
186
- fillType (type, entry);
187
186
}
188
187
189
188
void TypeVisitor::emitAnyFunctionType (const swift::AnyFunctionType* type,
@@ -230,7 +229,7 @@ void TypeVisitor::emitAnyGenericType(swift::AnyGenericType* type,
230
229
231
230
codeql::NestedArchetypeType TypeVisitor::translateNestedArchetypeType (
232
231
const swift::NestedArchetypeType& type) {
233
- codeql::NestedArchetypeType entry{dispatcher_. assignNewLabel (type)} ;
232
+ auto entry = createEntry (type);
234
233
entry.parent = dispatcher_.fetchLabel (type.getParent ());
235
234
entry.associated_type_declaration = dispatcher_.fetchLabel (type.getAssocType ());
236
235
fillArchetypeType (type, entry);
@@ -247,34 +246,30 @@ void TypeVisitor::fillArchetypeType(const swift::ArchetypeType& type, ArchetypeT
247
246
entry.name = type.getName ().str ().str ();
248
247
entry.protocols = dispatcher_.fetchRepeatedLabels (type.getConformsTo ());
249
248
entry.superclass = dispatcher_.fetchOptionalLabel (type.getSuperclass ());
250
- fillType (type, entry);
251
249
}
252
250
253
251
codeql::ExistentialType TypeVisitor::translateExistentialType (const swift::ExistentialType& type) {
254
- codeql::ExistentialType entry{dispatcher_. assignNewLabel (type)} ;
252
+ auto entry = createEntry (type);
255
253
entry.constraint = dispatcher_.fetchLabel (type.getConstraintType ());
256
- fillType (type, entry);
257
254
return entry;
258
255
}
259
256
260
257
codeql::DynamicSelfType TypeVisitor::translateDynamicSelfType (const swift::DynamicSelfType& type) {
261
- codeql::DynamicSelfType entry{dispatcher_. assignNewLabel (type)} ;
258
+ auto entry = createEntry (type);
262
259
entry.static_self_type = dispatcher_.fetchLabel (type.getSelfType ());
263
- fillType (type, entry);
264
260
return entry;
265
261
}
266
262
267
263
codeql::VariadicSequenceType TypeVisitor::translateVariadicSequenceType (
268
264
const swift::VariadicSequenceType& type) {
269
- codeql::VariadicSequenceType entry{dispatcher_. assignNewLabel (type)} ;
265
+ auto entry = createEntry (type);
270
266
fillUnarySyntaxSugarType (type, entry);
271
267
return entry;
272
268
}
273
269
274
270
codeql::InOutType TypeVisitor::translateInOutType (const swift::InOutType& type) {
275
- codeql::InOutType entry{dispatcher_. assignNewLabel (type)} ;
271
+ auto entry = createEntry (type);
276
272
entry.object_type = dispatcher_.fetchLabel (type.getObjectType ());
277
- fillType (type, entry);
278
273
return entry;
279
274
}
280
275
0 commit comments