Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2,630 changes: 2,630 additions & 0 deletions swift/downgrades/ba4171b90d0665b40e9e203bac9e3d4a0b2d03ec/old.dbscheme

Large diffs are not rendered by default.

2,630 changes: 2,630 additions & 0 deletions swift/downgrades/ba4171b90d0665b40e9e203bac9e3d4a0b2d03ec/swift.dbscheme

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
description: Revert renaming the Function hierarchy
compatibility: full

abstract_storage_decl_accessor_decls.rel: reorder abstract_storage_decl_accessors (int id, int index, int accessor) id index accessor
abstract_storage_decl_accessors.rel: delete

destructor_decls.rel: reorder deinitializers (int id) id
deinitializers.rel: delete

constructor_decls.rel: reorder initializers (int id) id
initializers.rel: delete

accessor_decls.rel: reorder accessors (int id) id
accessors.rel: delete

accessor_decl_is_getter.rel: reorder accessor_is_getter (int id) id
accessor_is_getter.rel: delete

accessor_decl_is_setter.rel: reorder accessor_is_setter (int id) id
accessor_is_setter.rel: delete

accessor_decl_is_will_set.rel: reorder accessor_is_will_set (int id) id
accessor_is_will_set.rel: delete

accessor_decl_is_did_set.rel: reorder accessor_is_did_set (int id) id
accessor_is_did_set.rel: delete

accessor_decl_is_read.rel: reorder accessor_is_read (int id) id
accessor_is_read.rel: delete

accessor_decl_is_modify.rel: reorder accessor_is_modify (int id) id
accessor_is_modify.rel: delete

accessor_decl_is_unsafe_address.rel: reorder accessor_is_unsafe_address (int id) id
accessor_is_unsafe_address.rel: delete

accessor_decl_is_unsafe_mutable_address.rel: reorder accessor_is_unsafe_mutable_address (int id) id
accessor_is_unsafe_mutable_address.rel: delete

concrete_func_decls.rel: reorder named_functions (int id) id
named_functions.rel: delete

lazy_initializer_exprs.rel: reorder lazy_initialization_exprs (int id, int sub_expr) id sub_expr
lazy_initialization_exprs.rel: delete

other_constructor_decl_ref_exprs.rel: reorder other_initializer_ref_exprs (int id, int constructor_decl) id constructor_decl
other_initializer_ref_exprs.rel: delete

rebind_self_in_constructor_exprs.rel: reorder rebind_self_in_initializer_exprs (int id, int sub_expr, int self) id sub_expr self
rebind_self_in_initializer_exprs.rel: delete

closure_exprs.rel: reorder explicit_closure_exprs (int id) id
explicit_closure_exprs.rel: delete

constructor_ref_call_exprs.rel: reorder initializer_ref_call_exprs (int id) id
initializer_ref_call_exprs.rel: delete
24 changes: 12 additions & 12 deletions swift/extractor/infra/SwiftTagTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ MAP(swift::Expr, ExprTag)
MAP(swift::DeclRefExpr, DeclRefExprTag)
MAP(swift::SuperRefExpr, SuperRefExprTag)
MAP(swift::TypeExpr, TypeExprTag)
MAP(swift::OtherConstructorDeclRefExpr, OtherConstructorDeclRefExprTag)
MAP(swift::OtherConstructorDeclRefExpr, OtherInitializerRefExprTag)
MAP(swift::DotSyntaxBaseIgnoredExpr, DotSyntaxBaseIgnoredExprTag)
MAP(swift::OverloadSetRefExpr, OverloadedDeclRefExprTag) // collapsed with its only derived class OverloadedDeclRefExpr
MAP(swift::OverloadedDeclRefExpr, OverloadedDeclRefExprTag)
Expand Down Expand Up @@ -108,13 +108,13 @@ MAP(swift::Expr, ExprTag)
MAP(swift::KeyPathApplicationExpr, KeyPathApplicationExprTag)
MAP(swift::TupleElementExpr, TupleElementExprTag)
MAP(swift::CaptureListExpr, CaptureListExprTag)
MAP(swift::AbstractClosureExpr, AbstractClosureExprTag)
MAP(swift::ClosureExpr, ClosureExprTag)
MAP(swift::AbstractClosureExpr, ClosureExprTag)
MAP(swift::ClosureExpr, ExplicitClosureExprTag)
MAP(swift::AutoClosureExpr, AutoClosureExprTag)
MAP(swift::InOutExpr, InOutExprTag)
MAP(swift::VarargExpansionExpr, VarargExpansionExprTag)
MAP(swift::DynamicTypeExpr, DynamicTypeExprTag)
MAP(swift::RebindSelfInConstructorExpr, RebindSelfInConstructorExprTag)
MAP(swift::RebindSelfInConstructorExpr, RebindSelfInInitializerExprTag)
MAP(swift::OpaqueValueExpr, OpaqueValueExprTag)
MAP(swift::PropertyWrapperValuePlaceholderExpr, PropertyWrapperValuePlaceholderExprTag)
MAP(swift::AppliedPropertyWrapperExpr, AppliedPropertyWrapperExprTag)
Expand All @@ -131,7 +131,7 @@ MAP(swift::Expr, ExprTag)
MAP(swift::BinaryExpr, BinaryExprTag)
MAP(swift::SelfApplyExpr, SelfApplyExprTag)
MAP(swift::DotSyntaxCallExpr, DotSyntaxCallExprTag)
MAP(swift::ConstructorRefCallExpr, ConstructorRefCallExprTag)
MAP(swift::ConstructorRefCallExpr, InitializerRefCallExprTag)
MAP(swift::ImplicitConversionExpr, ImplicitConversionExprTag)
MAP(swift::LoadExpr, LoadExprTag)
MAP(swift::DestructureTupleExpr, DestructureTupleExprTag)
Expand Down Expand Up @@ -178,7 +178,7 @@ MAP(swift::Expr, ExprTag)
MAP(swift::AssignExpr, AssignExprTag)
MAP(swift::CodeCompletionExpr, void) // only generated for code editing
MAP(swift::UnresolvedPatternExpr, UnresolvedPatternExprTag)
MAP(swift::LazyInitializerExpr, LazyInitializerExprTag)
MAP(swift::LazyInitializerExpr, LazyInitializationExprTag)
MAP(swift::EditorPlaceholderExpr, void) // only generated for code editing
MAP(swift::ObjCSelectorExpr, ObjCSelectorExprTag)
MAP(swift::KeyPathExpr, KeyPathExprTag)
Expand Down Expand Up @@ -207,12 +207,12 @@ MAP(swift::Decl, DeclTag)
MAP_CONCRETE(swift::VarDecl, ConcreteVarDeclTag)
MAP(swift::ParamDecl, ParamDeclTag)
MAP(swift::SubscriptDecl, SubscriptDeclTag)
MAP(swift::AbstractFunctionDecl, AbstractFunctionDeclTag)
MAP(swift::ConstructorDecl, ConstructorDeclTag)
MAP(swift::DestructorDecl, DestructorDeclTag)
MAP(swift::FuncDecl, FuncDeclTag)
MAP_CONCRETE(swift::FuncDecl, ConcreteFuncDeclTag)
MAP(swift::AccessorDecl, AccessorDeclTag)
MAP(swift::AbstractFunctionDecl, FunctionTag)
MAP(swift::ConstructorDecl, InitializerTag)
MAP(swift::DestructorDecl, DeinitializerTag)
MAP(swift::FuncDecl, AccessorOrNamedFunctionTag)
MAP_CONCRETE(swift::FuncDecl, NamedFunctionTag)
MAP(swift::AccessorDecl, AccessorTag)
MAP(swift::EnumElementDecl, EnumElementDeclTag)
MAP(swift::ExtensionDecl, ExtensionDeclTag)
MAP(swift::TopLevelCodeDecl, TopLevelCodeDeclTag)
Expand Down
23 changes: 11 additions & 12 deletions swift/extractor/translators/DeclTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,21 @@ std::string constructName(const swift::DeclName& declName) {
}
} // namespace

codeql::ConcreteFuncDecl DeclTranslator::translateFuncDecl(const swift::FuncDecl& decl) {
codeql::NamedFunction DeclTranslator::translateFuncDecl(const swift::FuncDecl& decl) {
auto entry = createEntry(decl);
fillAbstractFunctionDecl(decl, entry);
fillFunction(decl, entry);
return entry;
}

codeql::ConstructorDecl DeclTranslator::translateConstructorDecl(
const swift::ConstructorDecl& decl) {
codeql::Initializer DeclTranslator::translateConstructorDecl(const swift::ConstructorDecl& decl) {
auto entry = createEntry(decl);
fillAbstractFunctionDecl(decl, entry);
fillFunction(decl, entry);
return entry;
}

codeql::DestructorDecl DeclTranslator::translateDestructorDecl(const swift::DestructorDecl& decl) {
codeql::Deinitializer DeclTranslator::translateDestructorDecl(const swift::DestructorDecl& decl) {
auto entry = createEntry(decl);
fillAbstractFunctionDecl(decl, entry);
fillFunction(decl, entry);
return entry;
}

Expand Down Expand Up @@ -173,7 +172,7 @@ codeql::TypeAliasDecl DeclTranslator::translateTypeAliasDecl(const swift::TypeAl
return entry;
}

codeql::AccessorDecl DeclTranslator::translateAccessorDecl(const swift::AccessorDecl& decl) {
codeql::Accessor DeclTranslator::translateAccessorDecl(const swift::AccessorDecl& decl) {
auto entry = createEntry(decl);
switch (decl.getAccessorKind()) {
case swift::AccessorKind::Get:
Expand Down Expand Up @@ -201,7 +200,7 @@ codeql::AccessorDecl DeclTranslator::translateAccessorDecl(const swift::Accessor
entry.is_unsafe_mutable_address = true;
break;
}
fillAbstractFunctionDecl(decl, entry);
fillFunction(decl, entry);
return entry;
}

Expand Down Expand Up @@ -251,8 +250,8 @@ codeql::ModuleDecl DeclTranslator::translateModuleDecl(const swift::ModuleDecl&
return entry;
}

void DeclTranslator::fillAbstractFunctionDecl(const swift::AbstractFunctionDecl& decl,
codeql::AbstractFunctionDecl& entry) {
void DeclTranslator::fillFunction(const swift::AbstractFunctionDecl& decl,
codeql::Function& entry) {
assert(decl.hasParameterList() && "Expect functions to have a parameter list");
entry.name = !decl.hasName() ? "(unnamed function decl)" : constructName(decl.getName());
entry.body = dispatcher.fetchOptionalLabel(decl.getBody());
Expand Down Expand Up @@ -328,7 +327,7 @@ void DeclTranslator::fillValueDecl(const swift::ValueDecl& decl, codeql::ValueDe

void DeclTranslator::fillAbstractStorageDecl(const swift::AbstractStorageDecl& decl,
codeql::AbstractStorageDecl& entry) {
entry.accessor_decls = dispatcher.fetchRepeatedLabels(decl.getAllAccessors());
entry.accessors = dispatcher.fetchRepeatedLabels(decl.getAllAccessors());
fillValueDecl(decl, entry);
}

Expand Down
11 changes: 5 additions & 6 deletions swift/extractor/translators/DeclTranslator.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class DeclTranslator : public AstTranslatorBase<DeclTranslator> {
public:
using AstTranslatorBase<DeclTranslator>::AstTranslatorBase;

codeql::ConcreteFuncDecl translateFuncDecl(const swift::FuncDecl& decl);
codeql::ConstructorDecl translateConstructorDecl(const swift::ConstructorDecl& decl);
codeql::DestructorDecl translateDestructorDecl(const swift::DestructorDecl& decl);
codeql::NamedFunction translateFuncDecl(const swift::FuncDecl& decl);
codeql::Initializer translateConstructorDecl(const swift::ConstructorDecl& decl);
codeql::Deinitializer translateDestructorDecl(const swift::DestructorDecl& decl);
codeql::PrefixOperatorDecl translatePrefixOperatorDecl(const swift::PrefixOperatorDecl& decl);
codeql::PostfixOperatorDecl translatePostfixOperatorDecl(const swift::PostfixOperatorDecl& decl);
codeql::InfixOperatorDecl translateInfixOperatorDecl(const swift::InfixOperatorDecl& decl);
Expand All @@ -37,7 +37,7 @@ class DeclTranslator : public AstTranslatorBase<DeclTranslator> {
const swift::GenericTypeParamDecl& decl);
codeql::AssociatedTypeDecl translateAssociatedTypeDecl(const swift::AssociatedTypeDecl& decl);
codeql::TypeAliasDecl translateTypeAliasDecl(const swift::TypeAliasDecl& decl);
codeql::AccessorDecl translateAccessorDecl(const swift::AccessorDecl& decl);
codeql::Accessor translateAccessorDecl(const swift::AccessorDecl& decl);
codeql::SubscriptDecl translateSubscriptDecl(const swift::SubscriptDecl& decl);
codeql::ExtensionDecl translateExtensionDecl(const swift::ExtensionDecl& decl);
codeql::ImportDecl translateImportDecl(const swift::ImportDecl& decl);
Expand All @@ -49,8 +49,7 @@ class DeclTranslator : public AstTranslatorBase<DeclTranslator> {
codeql::CapturedDecl translateCapturedValue(const swift::CapturedValue& capture);

private:
void fillAbstractFunctionDecl(const swift::AbstractFunctionDecl& decl,
codeql::AbstractFunctionDecl& entry);
void fillFunction(const swift::AbstractFunctionDecl& decl, codeql::Function& entry);
void fillOperatorDecl(const swift::OperatorDecl& decl, codeql::OperatorDecl& entry);
void fillTypeDecl(const swift::TypeDecl& decl, codeql::TypeDecl& entry);
void fillIterableDeclContext(const swift::IterableDeclContext& decl, codeql::Decl& entry);
Expand Down
20 changes: 10 additions & 10 deletions swift/extractor/translators/ExprTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ codeql::OptionalEvaluationExpr ExprTranslator::translateOptionalEvaluationExpr(
return entry;
}

codeql::RebindSelfInConstructorExpr ExprTranslator::translateRebindSelfInConstructorExpr(
codeql::RebindSelfInInitializerExpr ExprTranslator::translateRebindSelfInConstructorExpr(
const swift::RebindSelfInConstructorExpr& expr) {
auto entry = createExprEntry(expr);
entry.sub_expr = dispatcher.fetchLabel(expr.getSubExpr());
Expand Down Expand Up @@ -300,7 +300,7 @@ codeql::OptionalTryExpr ExprTranslator::translateOptionalTryExpr(
return entry;
}

codeql::ConstructorRefCallExpr ExprTranslator::translateConstructorRefCallExpr(
codeql::InitializerRefCallExpr ExprTranslator::translateConstructorRefCallExpr(
const swift::ConstructorRefCallExpr& expr) {
auto entry = createExprEntry(expr);
fillSelfApplyExpr(expr, entry);
Expand All @@ -313,16 +313,16 @@ codeql::DiscardAssignmentExpr ExprTranslator::translateDiscardAssignmentExpr(
return entry;
}

codeql::ClosureExpr ExprTranslator::translateClosureExpr(const swift::ClosureExpr& expr) {
codeql::ExplicitClosureExpr ExprTranslator::translateClosureExpr(const swift::ClosureExpr& expr) {
auto entry = createExprEntry(expr);
fillAbstractClosureExpr(expr, entry);
fillClosureExpr(expr, entry);
return entry;
}

codeql::AutoClosureExpr ExprTranslator::translateAutoClosureExpr(
const swift::AutoClosureExpr& expr) {
auto entry = createExprEntry(expr);
fillAbstractClosureExpr(expr, entry);
fillClosureExpr(expr, entry);
return entry;
}

Expand Down Expand Up @@ -393,7 +393,7 @@ codeql::KeyPathExpr ExprTranslator::translateKeyPathExpr(const swift::KeyPathExp
return entry;
}

codeql::LazyInitializerExpr ExprTranslator::translateLazyInitializerExpr(
codeql::LazyInitializationExpr ExprTranslator::translateLazyInitializerExpr(
const swift::LazyInitializerExpr& expr) {
auto entry = createExprEntry(expr);
entry.sub_expr = dispatcher.fetchLabel(expr.getSubExpr());
Expand Down Expand Up @@ -427,10 +427,10 @@ codeql::KeyPathApplicationExpr ExprTranslator::translateKeyPathApplicationExpr(
return entry;
}

codeql::OtherConstructorDeclRefExpr ExprTranslator::translateOtherConstructorDeclRefExpr(
codeql::OtherInitializerRefExpr ExprTranslator::translateOtherConstructorDeclRefExpr(
const swift::OtherConstructorDeclRefExpr& expr) {
auto entry = createExprEntry(expr);
entry.constructor_decl = dispatcher.fetchLabel(expr.getDecl());
entry.initializer = dispatcher.fetchLabel(expr.getDecl());
return entry;
}

Expand Down Expand Up @@ -472,8 +472,8 @@ codeql::ErrorExpr ExprTranslator::translateErrorExpr(const swift::ErrorExpr& exp
return entry;
}

void ExprTranslator::fillAbstractClosureExpr(const swift::AbstractClosureExpr& expr,
codeql::AbstractClosureExpr& entry) {
void ExprTranslator::fillClosureExpr(const swift::AbstractClosureExpr& expr,
codeql::ClosureExpr& entry) {
assert(expr.getParameters() && "AbstractClosureExpr has getParameters()");
entry.params = dispatcher.fetchRepeatedLabels(*expr.getParameters());
entry.body = dispatcher.fetchLabel(expr.getBody());
Expand Down
14 changes: 7 additions & 7 deletions swift/extractor/translators/ExprTranslator.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ExprTranslator : public AstTranslatorBase<ExprTranslator> {
codeql::OpenExistentialExpr translateOpenExistentialExpr(const swift::OpenExistentialExpr& expr);
codeql::OptionalEvaluationExpr translateOptionalEvaluationExpr(
const swift::OptionalEvaluationExpr& expr);
codeql::RebindSelfInConstructorExpr translateRebindSelfInConstructorExpr(
codeql::RebindSelfInInitializerExpr translateRebindSelfInConstructorExpr(
const swift::RebindSelfInConstructorExpr& expr);
codeql::SuperRefExpr translateSuperRefExpr(const swift::SuperRefExpr& expr);
codeql::DotSyntaxCallExpr translateDotSyntaxCallExpr(const swift::DotSyntaxCallExpr& expr);
Expand Down Expand Up @@ -69,11 +69,11 @@ class ExprTranslator : public AstTranslatorBase<ExprTranslator> {
codeql::TryExpr translateTryExpr(const swift::TryExpr& expr);
codeql::ForceTryExpr translateForceTryExpr(const swift::ForceTryExpr& expr);
codeql::OptionalTryExpr translateOptionalTryExpr(const swift::OptionalTryExpr& expr);
codeql::ConstructorRefCallExpr translateConstructorRefCallExpr(
codeql::InitializerRefCallExpr translateConstructorRefCallExpr(
const swift::ConstructorRefCallExpr& expr);
codeql::DiscardAssignmentExpr translateDiscardAssignmentExpr(
const swift::DiscardAssignmentExpr& expr);
codeql::ClosureExpr translateClosureExpr(const swift::ClosureExpr& expr);
codeql::ExplicitClosureExpr translateClosureExpr(const swift::ClosureExpr& expr);
codeql::AutoClosureExpr translateAutoClosureExpr(const swift::AutoClosureExpr& expr);
codeql::CoerceExpr translateCoerceExpr(const swift::CoerceExpr& expr);
codeql::ConditionalCheckedCastExpr translateConditionalCheckedCastExpr(
Expand All @@ -85,13 +85,14 @@ class ExprTranslator : public AstTranslatorBase<ExprTranslator> {
codeql::DictionaryExpr translateDictionaryExpr(const swift::DictionaryExpr& expr);
codeql::MemberRefExpr translateMemberRefExpr(const swift::MemberRefExpr& expr);
codeql::KeyPathExpr translateKeyPathExpr(const swift::KeyPathExpr& expr);
codeql::LazyInitializerExpr translateLazyInitializerExpr(const swift::LazyInitializerExpr& expr);
codeql::LazyInitializationExpr translateLazyInitializerExpr(
const swift::LazyInitializerExpr& expr);
codeql::ForceValueExpr translateForceValueExpr(const swift::ForceValueExpr& expr);
codeql::IfExpr translateIfExpr(const swift::IfExpr& expr);
codeql::KeyPathDotExpr translateKeyPathDotExpr(const swift::KeyPathDotExpr& expr);
codeql::KeyPathApplicationExpr translateKeyPathApplicationExpr(
const swift::KeyPathApplicationExpr& expr);
codeql::OtherConstructorDeclRefExpr translateOtherConstructorDeclRefExpr(
codeql::OtherInitializerRefExpr translateOtherConstructorDeclRefExpr(
const swift::OtherConstructorDeclRefExpr& expr);
codeql::UnresolvedDeclRefExpr translateUnresolvedDeclRefExpr(
const swift::UnresolvedDeclRefExpr& expr);
Expand All @@ -118,8 +119,7 @@ class ExprTranslator : public AstTranslatorBase<ExprTranslator> {
codeql::RegexLiteralExpr translateRegexLiteralExpr(const swift::RegexLiteralExpr& expr);

private:
void fillAbstractClosureExpr(const swift::AbstractClosureExpr& expr,
codeql::AbstractClosureExpr& entry);
void fillClosureExpr(const swift::AbstractClosureExpr& expr, codeql::ClosureExpr& entry);
TrapLabel<ArgumentTag> emitArgument(const swift::Argument& arg);
TrapLabel<KeyPathComponentTag> emitKeyPathComponent(const swift::KeyPathExpr::Component& expr);
void fillExplicitCastExpr(const swift::ExplicitCastExpr& expr, codeql::ExplicitCastExpr& entry);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import swift

from DestructorDecl d
from Deinitializer d
where d.getLocation().getFile().getBaseName() != "Package.swift"
select d
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import swift
import codeql.swift.elements.decl.AccessorOrNamedFunction

from FuncDecl f
from AccessorOrNamedFunction f
where f.getLocation().getFile().getBaseName() != "Package.swift"
select f
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import swift

from ConstructorDecl d
from Initializer d
where d.getLocation().getFile().getBaseName() != "Package.swift"
select d
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
| Sources/deduplication/def.swift:1:1:1:9 | var ... = ... | PatternBindingDecl |
| Sources/deduplication/def.swift:1:5:1:5 | x | ConcreteVarDecl |
| Sources/deduplication/def.swift:3:1:3:20 | Generic | StructDecl |
| Sources/deduplication/def.swift:3:8:3:8 | Generic<T>.init() | ConstructorDecl |
| Sources/deduplication/def.swift:3:8:3:8 | Generic<T>.init() | Initializer |
| Sources/deduplication/def.swift:3:8:3:8 | self | ParamDecl |
| Sources/deduplication/def.swift:3:16:3:16 | T | GenericTypeParamDecl |
| Sources/deduplication/def.swift:5:1:5:41 | var ... = ... | PatternBindingDecl |
| Sources/deduplication/def.swift:5:5:5:5 | instantiated_generic | ConcreteVarDecl |
| Sources/deduplication/def.swift:7:1:7:42 | function(_:) | ConcreteFuncDecl |
| Sources/deduplication/def.swift:7:1:7:42 | function(_:) | NamedFunction |
| Sources/deduplication/def.swift:7:15:7:18 | _ | ParamDecl |
| Sources/deduplication/use.swift:1:1:1:13 | var ... = ... | PatternBindingDecl |
| Sources/deduplication/use.swift:1:5:1:5 | use_x | ConcreteVarDecl |
Expand Down
2 changes: 1 addition & 1 deletion swift/integration-tests/posix-only/hello-world/Bodies.ql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import swift

from StructDecl struct, ConstructorDecl decl, BraceStmt body
from StructDecl struct, Initializer decl, BraceStmt body
where struct.getName() = "hello_world" and decl = struct.getAMember() and body = decl.getBody()
select decl, body
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import swift

from ConcreteFuncDecl decl, BraceStmt body
from NamedFunction decl, BraceStmt body
where decl.getName() = "foo()" and decl.getBody() = body
select decl, body
Loading