@@ -121,21 +121,16 @@ void TypeVisitor::visitParenType(swift::ParenType* type) {
121
121
dispatcher_.emit (ParenTypesTrap{label, typeLabel});
122
122
}
123
123
124
- void TypeVisitor::visitUnarySyntaxSugarType (swift::UnarySyntaxSugarType* type) {
125
- auto label = dispatcher_.assignNewLabel (type);
126
- emitUnarySyntaxSugarType (type, label);
127
- }
128
-
129
- void TypeVisitor::visitOptionalType (swift::OptionalType* type) {
130
- auto label = dispatcher_.assignNewLabel (type);
131
- dispatcher_.emit (OptionalTypesTrap{label});
132
- emitUnarySyntaxSugarType (type, label);
124
+ codeql::OptionalType TypeVisitor::translateOptionalType (const swift::OptionalType& type) {
125
+ codeql::OptionalType entry{dispatcher_.assignNewLabel (type)};
126
+ fillUnarySyntaxSugarType (type, entry);
127
+ return entry;
133
128
}
134
129
135
- void TypeVisitor::visitArraySliceType ( swift::ArraySliceType* type) {
136
- auto label = dispatcher_.assignNewLabel (type);
137
- dispatcher_. emit (ArraySliceTypesTrap{label} );
138
- emitUnarySyntaxSugarType (type, label) ;
130
+ codeql::ArraySliceType TypeVisitor::translateArraySliceType ( const swift::ArraySliceType& type) {
131
+ codeql::ArraySliceType entry{ dispatcher_.assignNewLabel (type)} ;
132
+ fillUnarySyntaxSugarType (type, entry );
133
+ return entry ;
139
134
}
140
135
141
136
void TypeVisitor::visitDictionaryType (swift::DictionaryType* type) {
@@ -184,10 +179,11 @@ void TypeVisitor::visitBoundGenericType(swift::BoundGenericType* type) {
184
179
emitBoundGenericType (type, label);
185
180
}
186
181
187
- void TypeVisitor::emitUnarySyntaxSugarType (const swift::UnarySyntaxSugarType* type,
188
- TrapLabel<UnarySyntaxSugarTypeTag> label) {
189
- assert (type->getBaseType () && " expect UnarySyntaxSugarType to have BaseType" );
190
- dispatcher_.emit (UnarySyntaxSugarTypesTrap{label, dispatcher_.fetchLabel (type->getBaseType ())});
182
+ void TypeVisitor::fillUnarySyntaxSugarType (const swift::UnarySyntaxSugarType& type,
183
+ codeql::UnarySyntaxSugarType& entry) {
184
+ assert (type.getBaseType () && " expect UnarySyntaxSugarType to have BaseType" );
185
+ entry.base_type = dispatcher_.fetchLabel (type.getBaseType ());
186
+ fillType (type, entry);
191
187
}
192
188
193
189
void TypeVisitor::emitAnyFunctionType (const swift::AnyFunctionType* type,
@@ -260,11 +256,19 @@ codeql::ExistentialType TypeVisitor::translateExistentialType(const swift::Exist
260
256
fillType (type, entry);
261
257
return entry;
262
258
}
259
+
263
260
codeql::DynamicSelfType TypeVisitor::translateDynamicSelfType (const swift::DynamicSelfType& type) {
264
261
codeql::DynamicSelfType entry{dispatcher_.assignNewLabel (type)};
265
262
entry.static_self_type = dispatcher_.fetchLabel (type.getSelfType ());
266
263
fillType (type, entry);
267
264
return entry;
268
265
}
269
266
267
+ codeql::VariadicSequenceType TypeVisitor::translateVariadicSequenceType (
268
+ const swift::VariadicSequenceType& type) {
269
+ codeql::VariadicSequenceType entry{dispatcher_.assignNewLabel (type)};
270
+ fillUnarySyntaxSugarType (type, entry);
271
+ return entry;
272
+ }
273
+
270
274
} // namespace codeql
0 commit comments