Skip to content
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions swift/extractor/infra/SwiftTagTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ MAP(swift::Expr, ExprTag)
MAP(swift::ImplicitConversionExpr, ImplicitConversionExprTag)
MAP(swift::LoadExpr, LoadExprTag)
MAP(swift::DestructureTupleExpr, DestructureTupleExprTag)
MAP(swift::UnresolvedTypeConversionExpr, UnresolvedTypeConversionExprTag)
MAP(swift::FunctionConversionExpr, FunctionConversionExprTag)
MAP(swift::CovariantFunctionConversionExpr, CovariantFunctionConversionExprTag)
MAP(swift::CovariantReturnConversionExpr, CovariantReturnConversionExprTag)
Expand Down Expand Up @@ -267,8 +266,7 @@ MAP(swift::TypeRepr, TypeReprTag)
MAP(swift::Type, TypeTag)
MAP(swift::TypeBase, TypeTag)
MAP(swift::ErrorType, ErrorTypeTag)
MAP(swift::UnresolvedType, UnresolvedTypeTag)
MAP(swift::PlaceholderType, void) // appears in ambiguous types but are then transformed to UnresolvedType
MAP(swift::PlaceholderType, void) // appears in ambiguous types but are then transformed to ErrorType
MAP(swift::BuiltinType, BuiltinTypeTag)
MAP(swift::AnyBuiltinIntegerType, AnyBuiltinIntegerTypeTag)
MAP(swift::BuiltinIntegerType, BuiltinIntegerTypeTag)
Expand All @@ -285,7 +283,8 @@ MAP(swift::TypeBase, TypeTag)
MAP(swift::BuiltinVectorType, BuiltinVectorTypeTag)
MAP(swift::BuiltinPackIndexType, void) // SIL type, cannot really appear in the frontend run
MAP(swift::BuiltinNonDefaultDistributedActorStorageType, void) // Does not appear in AST/SIL, only used during IRGen
MAP(swift::BuiltinFixedArrayType, BuiltinFixedArrayTypeTag)
MAP(swift::BuiltinGenericType, BuiltinGenericTypeTag)
MAP(swift::BuiltinFixedArrayType, BuiltinFixedArrayTypeTag)
MAP(swift::BuiltinUnboundGenericType, void) // Only used during type resolution
MAP(swift::BuiltinImplicitActorType, void) // SIL type
MAP(swift::TupleType, TupleTypeTag)
Expand Down
2 changes: 1 addition & 1 deletion swift/extractor/translators/StmtTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ codeql::CaseStmt StmtTranslator::translateCaseStmt(const swift::CaseStmt& stmt)
auto entry = dispatcher.createEntry(stmt);
entry.body = dispatcher.fetchLabel(stmt.getBody());
entry.labels = dispatcher.fetchRepeatedLabels(stmt.getCaseLabelItems());
entry.variables = dispatcher.fetchRepeatedLabels(stmt.getCaseBodyVariablesOrEmptyArray());
entry.variables = dispatcher.fetchRepeatedLabels(stmt.getCaseBodyVariables());
return entry;
}

Expand Down
12 changes: 8 additions & 4 deletions swift/extractor/translators/TypeTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ codeql::BuiltinIntegerType TypeTranslator::translateBuiltinIntegerType(
return entry;
}

codeql::BuiltinFixedArrayType TypeTranslator::translateBuiltinFixedArrayType(
const swift::BuiltinFixedArrayType& type) {
// currently the translate dispatching mechanism does not go up more than one step in the
// hierarchy so we need to put this explicitly here, as BuiltinFixedArrayType derives from
// BuiltinGenericType which then derives from BuiltinType
return translateBuiltinType(type);
}

codeql::ExistentialArchetypeType TypeTranslator::translateExistentialArchetypeType(
const swift::ExistentialArchetypeType& type) {
auto entry = createTypeEntry(type);
Expand All @@ -258,10 +266,6 @@ codeql::ErrorType TypeTranslator::translateErrorType(const swift::ErrorType& typ
return createTypeEntry(type);
}

codeql::UnresolvedType TypeTranslator::translateUnresolvedType(const swift::UnresolvedType& type) {
return createTypeEntry(type);
}

codeql::ParameterizedProtocolType TypeTranslator::translateParameterizedProtocolType(
const swift::ParameterizedProtocolType& type) {
auto entry = createTypeEntry(type);
Expand Down
3 changes: 2 additions & 1 deletion swift/extractor/translators/TypeTranslator.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ class TypeTranslator : public TypeTranslatorBase<TypeTranslator> {
codeql::BuiltinIntegerLiteralType translateBuiltinIntegerLiteralType(
const swift::BuiltinIntegerLiteralType& type);
codeql::BuiltinIntegerType translateBuiltinIntegerType(const swift::BuiltinIntegerType& type);
codeql::BuiltinFixedArrayType translateBuiltinFixedArrayType(
const swift::BuiltinFixedArrayType& type);
codeql::ExistentialArchetypeType translateExistentialArchetypeType(
const swift::ExistentialArchetypeType& type);
codeql::ModuleType translateModuleType(const swift::ModuleType& type);
codeql::OpaqueTypeArchetypeType translateOpaqueTypeArchetypeType(
const swift::OpaqueTypeArchetypeType& type);
codeql::ErrorType translateErrorType(const swift::ErrorType& type);
codeql::UnresolvedType translateUnresolvedType(const swift::UnresolvedType& type);
codeql::ParameterizedProtocolType translateParameterizedProtocolType(
const swift::ParameterizedProtocolType& type);
codeql::PackArchetypeType translatePackArchetypeType(const swift::PackArchetypeType& type);
Expand Down
15 changes: 9 additions & 6 deletions swift/ql/.generated.list

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions swift/ql/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions swift/ql/lib/codeql/swift/elements.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions swift/ql/lib/codeql/swift/elements/type/BuiltinGenericType.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions swift/ql/lib/codeql/swift/generated/ParentChild.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading