File tree Expand file tree Collapse file tree 8 files changed +28
-8
lines changed Expand file tree Collapse file tree 8 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -409,4 +409,11 @@ codeql::PoundDiagnosticDecl DeclTranslator::translatePoundDiagnosticDecl(
409
409
entry.message = dispatcher.fetchLabel (decl.getMessage ());
410
410
return entry;
411
411
}
412
+
413
+ codeql::MissingMemberDecl DeclTranslator::translateMissingMemberDecl (
414
+ const swift::MissingMemberDecl& decl) {
415
+ auto entry = createEntry (decl);
416
+ entry.name = decl.getName ().getBaseName ().userFacingName ().str ();
417
+ return entry;
418
+ }
412
419
} // namespace codeql
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class DeclTranslator : public AstTranslatorBase<DeclTranslator> {
47
47
codeql::IfConfigDecl translateIfConfigDecl (const swift::IfConfigDecl& decl);
48
48
std::optional<codeql::OpaqueTypeDecl> translateOpaqueTypeDecl (const swift::OpaqueTypeDecl& decl);
49
49
codeql::PoundDiagnosticDecl translatePoundDiagnosticDecl (const swift::PoundDiagnosticDecl& decl);
50
+ codeql::MissingMemberDecl translateMissingMemberDecl (const swift::MissingMemberDecl& decl);
50
51
51
52
private:
52
53
std::string mangledName (const swift::ValueDecl& decl);
Original file line number Diff line number Diff line change 1
- // generated by codegen/codegen.py, remove this comment if you wish to edit this file
2
1
private import codeql.swift.generated.decl.MissingMemberDecl
3
2
4
- class MissingMemberDecl extends Generated:: MissingMemberDecl { }
3
+ class MissingMemberDecl extends Generated:: MissingMemberDecl {
4
+ override string toString ( ) { result = this .getName ( ) + " (missing)" }
5
+ }
Original file line number Diff line number Diff line change @@ -115,6 +115,8 @@ module Raw {
115
115
116
116
class MissingMemberDecl extends @missing_member_decl, Decl {
117
117
override string toString ( ) { result = "MissingMemberDecl" }
118
+
119
+ string getName ( ) { missing_member_decls ( this , result ) }
118
120
}
119
121
120
122
class OperatorDecl extends @operator_decl, Decl {
Original file line number Diff line number Diff line change @@ -4,7 +4,17 @@ private import codeql.swift.generated.Raw
4
4
import codeql.swift.elements.decl.Decl
5
5
6
6
module Generated {
7
+ /**
8
+ * A placeholder for missing declarations that can arise on object deserialization.
9
+ */
7
10
class MissingMemberDecl extends Synth:: TMissingMemberDecl , Decl {
8
11
override string getAPrimaryQlClass ( ) { result = "MissingMemberDecl" }
12
+
13
+ /**
14
+ * Gets the name of this missing member declaration.
15
+ */
16
+ string getName ( ) {
17
+ result = Synth:: convertMissingMemberDeclToRaw ( this ) .( Raw:: MissingMemberDecl ) .getName ( )
18
+ }
9
19
}
10
20
}
Original file line number Diff line number Diff line change @@ -254,7 +254,8 @@ import_decl_declarations( //dir=decl
254
254
);
255
255
256
256
missing_member_decls( //dir=decl
257
- unique int id: @missing_member_decl
257
+ unique int id: @missing_member_decl,
258
+ string name: string ref
258
259
);
259
260
260
261
@operator_decl =
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -112,8 +112,10 @@ class ImportDecl(Decl):
112
112
imported_module : optional ["ModuleDecl" ]
113
113
declarations : list ["ValueDecl" ]
114
114
115
+ @qltest .skip
115
116
class MissingMemberDecl (Decl ):
116
- pass
117
+ """A placeholder for missing declarations that can arise on object deserialization."""
118
+ name : string
117
119
118
120
class OperatorDecl (Decl ):
119
121
name : string
You can’t perform that action at this time.
0 commit comments