@@ -52,7 +52,7 @@ class DeclVisitor : public AstVisitorBase<DeclVisitor> {
52
52
53
53
void translateParamDecl (swift::ParamDecl* decl, codeql::ParamDecl* entry) {
54
54
entry->id = dispatcher_.assignNewLabel (decl);
55
- fillAbstractVarDecl (decl, entry);
55
+ fillVarDecl (decl, entry);
56
56
}
57
57
58
58
void translateTopLevelCodeDecl (swift::TopLevelCodeDecl* decl, codeql::TopLevelCodeDecl* entry) {
@@ -75,7 +75,7 @@ class DeclVisitor : public AstVisitorBase<DeclVisitor> {
75
75
void translateVarDecl (swift::VarDecl* decl, codeql::ConcreteVarDecl* entry) {
76
76
entry->id = dispatcher_.assignNewLabel (decl);
77
77
entry->introducer_int = static_cast <uint8_t >(decl->getIntroducer ());
78
- fillAbstractVarDecl (decl, entry);
78
+ fillVarDecl (decl, entry);
79
79
}
80
80
81
81
void translateStructDecl (swift::StructDecl* decl, codeql::StructDecl* entry) {
@@ -161,8 +161,8 @@ class DeclVisitor : public AstVisitorBase<DeclVisitor> {
161
161
void fillAbstractFunctionDecl (swift::AbstractFunctionDecl* decl,
162
162
codeql::AbstractFunctionDecl* entry) {
163
163
assert (decl->hasParameterList () && " Expect functions to have a parameter list" );
164
- entry->name = !decl->hasName () || decl->getName ().isSpecial () ? " (unnamed function decl)"
165
- : decl->getNameStr ().str ();
164
+ entry->name = !decl->hasName () || decl->getName ().isSpecial () ? " (unnamed function decl)"
165
+ : decl->getNameStr ().str ();
166
166
entry->body = dispatcher_.fetchOptionalLabel (decl->getBody ());
167
167
entry->params = dispatcher_.fetchRepeatedLabels (*decl->getParameters ());
168
168
fillValueDecl (decl, entry);
@@ -188,7 +188,8 @@ class DeclVisitor : public AstVisitorBase<DeclVisitor> {
188
188
entry->members = dispatcher_.fetchRepeatedLabels (decl->getAllMembers ());
189
189
}
190
190
191
- void fillAbstractVarDecl (swift::VarDecl* decl, codeql::VarDecl* entry) {
191
+ void fillVarDecl (swift::VarDecl* decl, codeql::VarDecl* entry) {
192
+ entry->name = decl->getNameStr ().str ();
192
193
entry->type = dispatcher_.fetchLabel (decl->getType ());
193
194
entry->parent_pattern = dispatcher_.fetchOptionalLabel (decl->getParentPattern ());
194
195
entry->parent_initializer = dispatcher_.fetchOptionalLabel (decl->getParentInitializer ());
0 commit comments