@@ -121,21 +121,16 @@ void TypeVisitor::visitParenType(swift::ParenType* type) {
121121 dispatcher_.emit (ParenTypesTrap{label, typeLabel});
122122}
123123
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;
133128}
134129
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 ;
139134}
140135
141136void TypeVisitor::visitDictionaryType (swift::DictionaryType* type) {
@@ -184,10 +179,11 @@ void TypeVisitor::visitBoundGenericType(swift::BoundGenericType* type) {
184179 emitBoundGenericType (type, label);
185180}
186181
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);
191187}
192188
193189void TypeVisitor::emitAnyFunctionType (const swift::AnyFunctionType* type,
@@ -260,11 +256,19 @@ codeql::ExistentialType TypeVisitor::translateExistentialType(const swift::Exist
260256 fillType (type, entry);
261257 return entry;
262258}
259+
263260codeql::DynamicSelfType TypeVisitor::translateDynamicSelfType (const swift::DynamicSelfType& type) {
264261 codeql::DynamicSelfType entry{dispatcher_.assignNewLabel (type)};
265262 entry.static_self_type = dispatcher_.fetchLabel (type.getSelfType ());
266263 fillType (type, entry);
267264 return entry;
268265}
269266
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+
270274} // namespace codeql
0 commit comments