@@ -122,13 +122,13 @@ void TypeVisitor::visitParenType(swift::ParenType* type) {
122122}
123123
124124codeql::OptionalType TypeVisitor::translateOptionalType (const swift::OptionalType& type) {
125- codeql::OptionalType entry{dispatcher_. assignNewLabel (type)} ;
125+ auto entry = createEntry (type);
126126 fillUnarySyntaxSugarType (type, entry);
127127 return entry;
128128}
129129
130130codeql::ArraySliceType TypeVisitor::translateArraySliceType (const swift::ArraySliceType& type) {
131- codeql::ArraySliceType entry{dispatcher_. assignNewLabel (type)} ;
131+ auto entry = createEntry (type);
132132 fillUnarySyntaxSugarType (type, entry);
133133 return entry;
134134}
@@ -163,7 +163,7 @@ void TypeVisitor::visitLValueType(swift::LValueType* type) {
163163
164164codeql::PrimaryArchetypeType TypeVisitor::translatePrimaryArchetypeType (
165165 const swift::PrimaryArchetypeType& type) {
166- PrimaryArchetypeType entry{dispatcher_. assignNewLabel (type)} ;
166+ auto entry = createEntry (type);
167167 fillArchetypeType (type, entry);
168168 return entry;
169169}
@@ -183,7 +183,6 @@ void TypeVisitor::fillUnarySyntaxSugarType(const swift::UnarySyntaxSugarType& ty
183183 codeql::UnarySyntaxSugarType& entry) {
184184 assert (type.getBaseType () && " expect UnarySyntaxSugarType to have BaseType" );
185185 entry.base_type = dispatcher_.fetchLabel (type.getBaseType ());
186- fillType (type, entry);
187186}
188187
189188void TypeVisitor::emitAnyFunctionType (const swift::AnyFunctionType* type,
@@ -230,7 +229,7 @@ void TypeVisitor::emitAnyGenericType(swift::AnyGenericType* type,
230229
231230codeql::NestedArchetypeType TypeVisitor::translateNestedArchetypeType (
232231 const swift::NestedArchetypeType& type) {
233- codeql::NestedArchetypeType entry{dispatcher_. assignNewLabel (type)} ;
232+ auto entry = createEntry (type);
234233 entry.parent = dispatcher_.fetchLabel (type.getParent ());
235234 entry.associated_type_declaration = dispatcher_.fetchLabel (type.getAssocType ());
236235 fillArchetypeType (type, entry);
@@ -247,34 +246,30 @@ void TypeVisitor::fillArchetypeType(const swift::ArchetypeType& type, ArchetypeT
247246 entry.name = type.getName ().str ().str ();
248247 entry.protocols = dispatcher_.fetchRepeatedLabels (type.getConformsTo ());
249248 entry.superclass = dispatcher_.fetchOptionalLabel (type.getSuperclass ());
250- fillType (type, entry);
251249}
252250
253251codeql::ExistentialType TypeVisitor::translateExistentialType (const swift::ExistentialType& type) {
254- codeql::ExistentialType entry{dispatcher_. assignNewLabel (type)} ;
252+ auto entry = createEntry (type);
255253 entry.constraint = dispatcher_.fetchLabel (type.getConstraintType ());
256- fillType (type, entry);
257254 return entry;
258255}
259256
260257codeql::DynamicSelfType TypeVisitor::translateDynamicSelfType (const swift::DynamicSelfType& type) {
261- codeql::DynamicSelfType entry{dispatcher_. assignNewLabel (type)} ;
258+ auto entry = createEntry (type);
262259 entry.static_self_type = dispatcher_.fetchLabel (type.getSelfType ());
263- fillType (type, entry);
264260 return entry;
265261}
266262
267263codeql::VariadicSequenceType TypeVisitor::translateVariadicSequenceType (
268264 const swift::VariadicSequenceType& type) {
269- codeql::VariadicSequenceType entry{dispatcher_. assignNewLabel (type)} ;
265+ auto entry = createEntry (type);
270266 fillUnarySyntaxSugarType (type, entry);
271267 return entry;
272268}
273269
274270codeql::InOutType TypeVisitor::translateInOutType (const swift::InOutType& type) {
275- codeql::InOutType entry{dispatcher_. assignNewLabel (type)} ;
271+ auto entry = createEntry (type);
276272 entry.object_type = dispatcher_.fetchLabel (type.getObjectType ());
277- fillType (type, entry);
278273 return entry;
279274}
280275
0 commit comments