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(
409409 entry.message = dispatcher.fetchLabel (decl.getMessage ());
410410 return entry;
411411}
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+ }
412419} // namespace codeql
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class DeclTranslator : public AstTranslatorBase<DeclTranslator> {
4747 codeql::IfConfigDecl translateIfConfigDecl (const swift::IfConfigDecl& decl);
4848 std::optional<codeql::OpaqueTypeDecl> translateOpaqueTypeDecl (const swift::OpaqueTypeDecl& decl);
4949 codeql::PoundDiagnosticDecl translatePoundDiagnosticDecl (const swift::PoundDiagnosticDecl& decl);
50+ codeql::MissingMemberDecl translateMissingMemberDecl (const swift::MissingMemberDecl& decl);
5051
5152 private:
5253 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
21private import codeql.swift.generated.decl.MissingMemberDecl
32
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 {
115115
116116 class MissingMemberDecl extends @missing_member_decl, Decl {
117117 override string toString ( ) { result = "MissingMemberDecl" }
118+
119+ string getName ( ) { missing_member_decls ( this , result ) }
118120 }
119121
120122 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
44import codeql.swift.elements.decl.Decl
55
66module Generated {
7+ /**
8+ * A placeholder for missing declarations that can arise on object deserialization.
9+ */
710 class MissingMemberDecl extends Synth:: TMissingMemberDecl , Decl {
811 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+ }
919 }
1020}
Original file line number Diff line number Diff line change @@ -254,7 +254,8 @@ import_decl_declarations( //dir=decl
254254);
255255
256256missing_member_decls( //dir=decl
257- unique int id: @missing_member_decl
257+ unique int id: @missing_member_decl,
258+ string name: string ref
258259);
259260
260261@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):
112112 imported_module : optional ["ModuleDecl" ]
113113 declarations : list ["ValueDecl" ]
114114
115+ @qltest .skip
115116class MissingMemberDecl (Decl ):
116- pass
117+ """A placeholder for missing declarations that can arise on object deserialization."""
118+ name : string
117119
118120class OperatorDecl (Decl ):
119121 name : string
You can’t perform that action at this time.
0 commit comments