From 9264b2a6d62d795a6368f063348e9f2d2d98065e Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 24 Nov 2023 05:58:45 +0100 Subject: [PATCH 1/5] Codegen: add `internal` to properties, rename `ql_internal->internal` --- misc/codegen/generators/qlgen.py | 10 ++-- misc/codegen/lib/ql.py | 7 +-- .../templates/ql_stub_class_qldoc.mustache | 4 +- .../templates/ql_stub_module_qldoc.mustache | 4 +- misc/codegen/test/test_ql.py | 6 +-- misc/codegen/test/test_qlgen.py | 48 +++++++++++++------ 6 files changed, 50 insertions(+), 29 deletions(-) diff --git a/misc/codegen/generators/qlgen.py b/misc/codegen/generators/qlgen.py index dd1cb679be9e..305f5d866b25 100755 --- a/misc/codegen/generators/qlgen.py +++ b/misc/codegen/generators/qlgen.py @@ -114,6 +114,7 @@ def get_ql_property(cls: schema.Class, prop: schema.Property, lookup: typing.Dic description=prop.description, synth=bool(cls.synth) or prop.synth, type_is_hideable=lookup[prop.type].hideable if prop.type in lookup else False, + internal="ql_internal" in prop.pragmas, ) if prop.is_single: args.update( @@ -151,7 +152,7 @@ def get_ql_property(cls: schema.Class, prop: schema.Property, lookup: typing.Dic def get_ql_class(cls: schema.Class, lookup: typing.Dict[str, schema.Class]) -> ql.Class: - pragmas = {k: True for k in cls.pragmas if k.startswith("ql")} + pragmas = {k: True for k in cls.pragmas if k.startswith("qltest")} prev_child = "" properties = [] for p in cls.properties: @@ -167,6 +168,7 @@ def get_ql_class(cls: schema.Class, lookup: typing.Dict[str, schema.Class]) -> q dir=pathlib.Path(cls.group or ""), doc=cls.doc, hideable=cls.hideable, + internal="ql_internal" in cls.pragmas, **pragmas, ) @@ -313,7 +315,7 @@ def _get_stub(cls: schema.Class, base_import: str, generated_import_prefix: str) accessors = [] return ql.Stub(name=cls.name, base_import=base_import, import_prefix=generated_import_prefix, doc=cls.doc, synth_accessors=accessors, - ql_internal="ql_internal" in cls.pragmas) + internal="ql_internal" in cls.pragmas) _stub_qldoc_header = "// the following QLdoc is generated: if you need to edit it, do it in the schema file\n" @@ -397,7 +399,7 @@ def generate(opts, renderer): _patch_class_qldoc(c.name, qldoc, stub_file) # for example path/to/elements -> path/to/elements.qll - renderer.render(ql.ImportList([i for name, i in imports.items() if not classes[name].ql_internal]), + renderer.render(ql.ImportList([i for name, i in imports.items() if not classes[name].internal]), include_file) elements_module = get_import(include_file, opts.root_dir) @@ -405,7 +407,7 @@ def generate(opts, renderer): renderer.render( ql.GetParentImplementation( classes=list(classes.values()), - imports=[elements_module] + [i for name, i in imports.items() if classes[name].ql_internal], + imports=[elements_module] + [i for name, i in imports.items() if classes[name].internal], ), out / 'ParentChild.qll') diff --git a/misc/codegen/lib/ql.py b/misc/codegen/lib/ql.py index a9dca42b5e1c..39c4c2f90ca3 100644 --- a/misc/codegen/lib/ql.py +++ b/misc/codegen/lib/ql.py @@ -44,6 +44,7 @@ class Property: doc_plural: Optional[str] = None synth: bool = False type_is_hideable: bool = False + internal: bool = False def __post_init__(self): if self.tableparams: @@ -112,7 +113,7 @@ class Class: qltest_skip: bool = False qltest_collapse_hierarchy: bool = False qltest_uncollapse_hierarchy: bool = False - ql_internal: bool = False + internal: bool = False doc: List[str] = field(default_factory=list) hideable: bool = False @@ -162,7 +163,7 @@ class Stub: base_import: str import_prefix: str synth_accessors: List[SynthUnderlyingAccessor] = field(default_factory=list) - ql_internal: bool = False + internal: bool = False doc: List[str] = field(default_factory=list) @property @@ -171,7 +172,7 @@ def has_synth_accessors(self) -> bool: @property def has_qldoc(self) -> bool: - return bool(self.doc) or self.ql_internal + return bool(self.doc) or self.internal @dataclass diff --git a/misc/codegen/templates/ql_stub_class_qldoc.mustache b/misc/codegen/templates/ql_stub_class_qldoc.mustache index de130ee8c0e7..7ab8d6967197 100644 --- a/misc/codegen/templates/ql_stub_class_qldoc.mustache +++ b/misc/codegen/templates/ql_stub_class_qldoc.mustache @@ -3,8 +3,8 @@ {{#doc}} * {{.}} {{/doc}} -{{#ql_internal}} +{{#internal}} * INTERNAL: Do not use. -{{/ql_internal}} +{{/internal}} */ {{/has_qldoc}} diff --git a/misc/codegen/templates/ql_stub_module_qldoc.mustache b/misc/codegen/templates/ql_stub_module_qldoc.mustache index f931eef8b456..2dc821c17f08 100644 --- a/misc/codegen/templates/ql_stub_module_qldoc.mustache +++ b/misc/codegen/templates/ql_stub_module_qldoc.mustache @@ -1,6 +1,6 @@ /** * This module provides a hand-modifiable wrapper around the generated class `{{name}}`. -{{#ql_internal}} +{{#internal}} * INTERNAL: Do not use. -{{/ql_internal}} +{{/internal}} */ diff --git a/misc/codegen/test/test_ql.py b/misc/codegen/test/test_ql.py index d7359ea7ca1c..f58fbaf15dda 100644 --- a/misc/codegen/test/test_ql.py +++ b/misc/codegen/test/test_ql.py @@ -147,15 +147,15 @@ def test_class_with_children(): assert cls.has_children is True -@pytest.mark.parametrize("doc,ql_internal,expected", +@pytest.mark.parametrize("doc,internal,expected", [ (["foo", "bar"], False, True), (["foo", "bar"], True, True), ([], False, False), ([], True, True), ]) -def test_has_doc(doc, ql_internal, expected): - stub = ql.Stub("Class", base_import="foo", import_prefix="bar", doc=doc, ql_internal=ql_internal) +def test_has_doc(doc, internal, expected): + stub = ql.Stub("Class", base_import="foo", import_prefix="bar", doc=doc, internal=internal) assert stub.has_qldoc is expected diff --git a/misc/codegen/test/test_qlgen.py b/misc/codegen/test/test_qlgen.py index 3a4f057b1644..0d797d07198f 100644 --- a/misc/codegen/test/test_qlgen.py +++ b/misc/codegen/test/test_qlgen.py @@ -157,8 +157,8 @@ def test_one_empty_internal_class(generate_classes): assert generate_classes([ schema.Class("A", pragmas=["ql_internal"]) ]) == { - "A.qll": (a_ql_stub(name="A", ql_internal=True), - a_ql_class(name="A", final=True, ql_internal=True)), + "A.qll": (a_ql_stub(name="A", internal=True), + a_ql_class(name="A", final=True, internal=True)), } @@ -202,11 +202,11 @@ def test_hierarchy_children(generate_children_implementations): schema.Class("C", bases=["A"], derived={"D"}, pragmas=["ql_internal"]), schema.Class("D", bases=["B", "C"]), ]) == ql.GetParentImplementation( - classes=[a_ql_class(name="A", ql_internal=True), + classes=[a_ql_class(name="A", internal=True), a_ql_class(name="B", bases=["A"], imports=[ stub_import_prefix + "A"]), a_ql_class(name="C", bases=["A"], imports=[ - stub_import_prefix + "A"], ql_internal=True), + stub_import_prefix + "A"], internal=True), a_ql_class(name="D", final=True, bases=["B", "C"], imports=[stub_import_prefix + cls for cls in "BC"]), ], @@ -228,6 +228,21 @@ def test_single_property(generate_classes): } +def test_internal_property(generate_classes): + assert generate_classes([ + schema.Class("MyObject", properties=[ + schema.SingleProperty("foo", "bar", pragmas=["ql_internal"])]), + ]) == { + "MyObject.qll": (a_ql_stub(name="MyObject"), + a_ql_class(name="MyObject", final=True, + properties=[ + ql.Property(singular="Foo", type="bar", tablename="my_objects", + tableparams=["this", "result"], doc="foo of this my object", + internal=True), + ])), + } + + def test_children(generate_classes): assert generate_classes([ schema.Class("FakeRoot"), @@ -424,7 +439,8 @@ def test_class_dir(generate_classes): schema.Class("A", derived={"B"}, group=dir), schema.Class("B", bases=["A"]), ]) == { - f"{dir}/A.qll": (a_ql_stub(name="A", import_prefix="another.rel.path."), a_ql_class(name="A", dir=pathlib.Path(dir))), + f"{dir}/A.qll": ( + a_ql_stub(name="A", import_prefix="another.rel.path."), a_ql_class(name="A", dir=pathlib.Path(dir))), "B.qll": (a_ql_stub(name="B"), a_ql_class(name="B", final=True, bases=["A"], imports=[stub_import_prefix + "another.rel.path.A"])), @@ -878,9 +894,9 @@ def test_stub_on_class_with_synth_from_class(generate_classes): ql.SynthUnderlyingAccessor(argument="Entity", type="Raw::A", constructorparams=["result"]), ]), a_ql_class(name="MyObject", final=True, properties=[ - ql.Property(singular="Foo", type="bar", tablename="my_objects", synth=True, - tableparams=["this", "result"], doc="foo of this my object"), - ])), + ql.Property(singular="Foo", type="bar", tablename="my_objects", synth=True, + tableparams=["this", "result"], doc="foo of this my object"), + ])), } @@ -895,9 +911,9 @@ def test_stub_on_class_with_synth_on_arguments(generate_classes): ql.SynthUnderlyingAccessor(argument="Label", type="string", constructorparams=["_", "_", "result"]), ]), a_ql_class(name="MyObject", final=True, properties=[ - ql.Property(singular="Foo", type="bar", tablename="my_objects", synth=True, - tableparams=["this", "result"], doc="foo of this my object"), - ])), + ql.Property(singular="Foo", type="bar", tablename="my_objects", synth=True, + tableparams=["this", "result"], doc="foo of this my object"), + ])), } @@ -909,7 +925,8 @@ def test_synth_property(generate_classes): "MyObject.qll": (a_ql_stub(name="MyObject"), a_ql_class(name="MyObject", final=True, properties=[ - ql.Property(singular="Foo", type="bar", tablename="my_objects", synth=True, + ql.Property(singular="Foo", type="bar", tablename="my_objects", + synth=True, tableparams=["this", "result"], doc="foo of this my object"), ])), } @@ -934,9 +951,10 @@ def test_hideable_property(generate_classes): "Other.qll": (a_ql_stub(name="Other"), a_ql_class(name="Other", imports=[stub_import_prefix + "MyObject"], final=True, properties=[ - ql.Property(singular="X", type="MyObject", tablename="others", type_is_hideable=True, - tableparams=["this", "result"], doc="x of this other"), - ])), + ql.Property(singular="X", type="MyObject", tablename="others", + type_is_hideable=True, + tableparams=["this", "result"], doc="x of this other"), + ])), } From 2d34fec0a2da8b8c504915098dfde100eb96d37f Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 24 Nov 2023 06:00:05 +0100 Subject: [PATCH 2/5] Codegen: remove unneeded `has_description` property --- misc/codegen/lib/ql.py | 4 ---- misc/codegen/templates/ql_class.mustache | 4 ---- misc/codegen/templates/ql_db.mustache | 2 -- misc/codegen/test/test_ql.py | 10 ---------- 4 files changed, 20 deletions(-) diff --git a/misc/codegen/lib/ql.py b/misc/codegen/lib/ql.py index 39c4c2f90ca3..a2762d6f4989 100644 --- a/misc/codegen/lib/ql.py +++ b/misc/codegen/lib/ql.py @@ -81,10 +81,6 @@ def is_single(self): def is_child(self): return self.prev_child is not None - @property - def has_description(self) -> bool: - return bool(self.description) - @property def is_indexed(self) -> bool: return self.is_repeated and not self.is_unordered diff --git a/misc/codegen/templates/ql_class.mustache b/misc/codegen/templates/ql_class.mustache index c01f74875b78..5187c62f4116 100644 --- a/misc/codegen/templates/ql_class.mustache +++ b/misc/codegen/templates/ql_class.mustache @@ -83,11 +83,9 @@ module Generated { /** * {{>ql_property_doc}} * - {{#has_description}} {{#description}} * {{.}} {{/description}} - {{/has_description}} */ final {{type}} {{getter}}({{#is_indexed}}int index{{/is_indexed}}) { exists({{type}} immediate | immediate = this.get{{#is_unordered}}An{{/is_unordered}}Immediate{{singular}}({{#is_indexed}}index{{/is_indexed}}) and @@ -98,11 +96,9 @@ module Generated { {{^type_is_hideable}} /** * {{>ql_property_doc}} * - {{#has_description}} {{#description}} * {{.}} {{/description}} - {{/has_description}} */ {{type}} {{getter}}({{#is_indexed}}int index{{/is_indexed}}) { {{^synth}} diff --git a/misc/codegen/templates/ql_db.mustache b/misc/codegen/templates/ql_db.mustache index 188abebc120d..8326bb3adb7d 100644 --- a/misc/codegen/templates/ql_db.mustache +++ b/misc/codegen/templates/ql_db.mustache @@ -18,11 +18,9 @@ module Raw { {{^synth}} /** * {{>ql_property_doc}} * - {{#has_description}} {{#description}} * {{.}} {{/description}} - {{/has_description}} */ {{type}} {{getter}}({{#is_indexed}}int index{{/is_indexed}}) { {{tablename}}({{#tableparams}}{{^first}}, {{/first}}{{param}}{{/tableparams}}) diff --git a/misc/codegen/test/test_ql.py b/misc/codegen/test/test_ql.py index f58fbaf15dda..8faa3b0cc995 100644 --- a/misc/codegen/test/test_ql.py +++ b/misc/codegen/test/test_ql.py @@ -159,16 +159,6 @@ def test_has_doc(doc, internal, expected): assert stub.has_qldoc is expected -def test_property_with_description(): - prop = ql.Property("X", "int", description=["foo", "bar"]) - assert prop.has_description is True - - -def test_class_without_description(): - prop = ql.Property("X", "int") - assert prop.has_description is False - - def test_synth_accessor_has_first_constructor_param_marked(): params = ["a", "b", "c"] x = ql.SynthUnderlyingAccessor("foo", "bar", params) From 0b57ecf0c706e11b311ffe8bd0fc9afd90b5ef62 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 24 Nov 2023 06:54:03 +0100 Subject: [PATCH 3/5] Codegen: add internal QLdoc to property templates --- misc/codegen/templates/ql_class.mustache | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/misc/codegen/templates/ql_class.mustache b/misc/codegen/templates/ql_class.mustache index 5187c62f4116..100d5ebe939c 100644 --- a/misc/codegen/templates/ql_class.mustache +++ b/misc/codegen/templates/ql_class.mustache @@ -71,6 +71,9 @@ module Generated { * {{>ql_property_doc}} * * This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the * behavior of both the `Immediate` and non-`Immediate` versions. + {{#internal}} + * INTERNAL: Do not use. + {{/internal}} */ {{type}} get{{#is_unordered}}An{{/is_unordered}}Immediate{{singular}}({{#is_indexed}}int index{{/is_indexed}}) { {{^synth}} @@ -86,6 +89,9 @@ module Generated { {{#description}} * {{.}} {{/description}} + {{#internal}} + * INTERNAL: Do not use. + {{/internal}} */ final {{type}} {{getter}}({{#is_indexed}}int index{{/is_indexed}}) { exists({{type}} immediate | immediate = this.get{{#is_unordered}}An{{/is_unordered}}Immediate{{singular}}({{#is_indexed}}index{{/is_indexed}}) and @@ -99,6 +105,9 @@ module Generated { {{#description}} * {{.}} {{/description}} + {{#internal}} + * INTERNAL: Do not use. + {{/internal}} */ {{type}} {{getter}}({{#is_indexed}}int index{{/is_indexed}}) { {{^synth}} @@ -113,6 +122,9 @@ module Generated { {{#is_optional}} /** * Holds if `{{getter}}({{#is_repeated}}index{{/is_repeated}})` exists. + {{#internal}} + * INTERNAL: Do not use. + {{/internal}} */ final predicate has{{singular}}({{#is_repeated}}int index{{/is_repeated}}) { exists(this.{{getter}}({{#is_repeated}}index{{/is_repeated}})) @@ -122,6 +134,9 @@ module Generated { /** * Gets any of the {{doc_plural}}. + {{#internal}} + * INTERNAL: Do not use. + {{/internal}} */ final {{type}} {{indefinite_getter}}() { result = this.{{getter}}(_) @@ -130,6 +145,9 @@ module Generated { /** * Gets the number of {{doc_plural}}. + {{#internal}} + * INTERNAL: Do not use. + {{/internal}} */ final int getNumberOf{{plural}}() { result = count(int i | exists(this.{{getter}}(i))) @@ -139,6 +157,9 @@ module Generated { {{#is_unordered}} /** * Gets the number of {{doc_plural}}. + {{#internal}} + * INTERNAL: Do not use. + {{/internal}} */ final int getNumberOf{{plural}}() { result = count(this.{{getter}}()) From cc6da2829cd2f74fd47391f41ce0d27cef8a69ee Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 24 Nov 2023 06:56:12 +0100 Subject: [PATCH 4/5] Swift: make `PoundDiagnostics::getKind` internal --- swift/ql/.generated.list | 2 +- .../ql/lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll | 1 + swift/schema.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 07aea55f1701..54ca084522c8 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -439,7 +439,7 @@ lib/codeql/swift/generated/decl/OperatorDecl.qll 76901a6aa7bf34c925b93e1466e3601 lib/codeql/swift/generated/decl/ParamDecl.qll 9774c4aea3fa140c90a00018c6991947b0ac7b7d847d4319f1ceac5b8ab0b5ac 971d3f63ab70975812cbf80f03a63516bfff113a15f53c720bd1834c82e49ca4 lib/codeql/swift/generated/decl/PatternBindingDecl.qll ef627fd2f8a19f587b5690ea4d608f6ca6aca6be78ecd930f0b150df6c6c9a92 456c823ee71d7c81dd887fbe5b77f64a1a53d2a84e6266ed18aadca62a4bbbcb lib/codeql/swift/generated/decl/PostfixOperatorDecl.qll f6a26b6b6632c9eaefc5d0ee9aeb99ddd56fed792afff9037114d92c3a42bb23 f6a26b6b6632c9eaefc5d0ee9aeb99ddd56fed792afff9037114d92c3a42bb23 -lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll 975d88abaed11eefa434d266960c45ac83e040a790c8fed14c2703c2e256850d a6dedac1a7b085d512b96bb40805a70910de4e2293e60d1f765b1e512ed838a5 +lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll 6e1ef7f47d1fb7817a472724f025fc498366dfed7a31692dee66d60bd5dbacc1 9fcd2ed7afe5ede92a50d17036c1ffb14dcb5491bccac3e7218c5919f7c12efb lib/codeql/swift/generated/decl/PrecedenceGroupDecl.qll 40adef005cbe080485867888bf4b71c10e67fa5a3c843d4d3d79f4dd13c76605 40adef005cbe080485867888bf4b71c10e67fa5a3c843d4d3d79f4dd13c76605 lib/codeql/swift/generated/decl/PrefixOperatorDecl.qll 853f3a15d5bbe629e5fc7cbb2b9ad2946af74771e00369ba97b66370827033cb 853f3a15d5bbe629e5fc7cbb2b9ad2946af74771e00369ba97b66370827033cb lib/codeql/swift/generated/decl/ProtocolDecl.qll 2de9a6b5b2fab8a3bb517ad2cf424ca9f3d29f7bd15b7c8861c0caea7d28baf7 2de9a6b5b2fab8a3bb517ad2cf424ca9f3d29f7bd15b7c8861c0caea7d28baf7 diff --git a/swift/ql/lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll index ef22f91d8459..2c7005edfbbb 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll @@ -26,6 +26,7 @@ module Generated { * Gets the kind of this pound diagnostic declaration. * * This is 1 for `#error` and 2 for `#warning`. + * INTERNAL: Do not use. */ int getKind() { result = Synth::convertPoundDiagnosticDeclToRaw(this).(Raw::PoundDiagnosticDecl).getKind() diff --git a/swift/schema.py b/swift/schema.py index 9ae7368a839e..e0f6e3a27c8c 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -143,7 +143,7 @@ class PatternBindingDecl(Decl): class PoundDiagnosticDecl(Decl): """ A diagnostic directive, which is either `#error` or `#warning`.""" - kind: int | desc("""This is 1 for `#error` and 2 for `#warning`.""") + kind: int | desc("""This is 1 for `#error` and 2 for `#warning`.""") | ql.internal message: "StringLiteralExpr" | child class PrecedenceGroupDecl(Decl): From ba098c3b1b7b26409fdec2223408ce7220e7dd04 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 24 Nov 2023 07:04:03 +0100 Subject: [PATCH 5/5] Swift: make `kind` and `macro_syntax` in `MacroRole` internal --- swift/ql/.generated.list | 2 +- swift/ql/lib/codeql/swift/generated/MacroRole.qll | 4 ++++ swift/schema.py | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/swift/ql/.generated.list b/swift/ql/.generated.list index 528618a3b772..0460b21d8a18 100644 --- a/swift/ql/.generated.list +++ b/swift/ql/.generated.list @@ -401,7 +401,7 @@ lib/codeql/swift/generated/File.qll 27b43d817c9335a3d11686b7a09369f5cbf4b1f6a5b7 lib/codeql/swift/generated/KeyPathComponent.qll cdfd7123f6b03186f36204eac00a0e5a1ee323fd42c3e8997da3390cb4989caf 96fa51fbf43b690c10b13201446af73ec9c4d57187eef80b4f70689323bcf35f lib/codeql/swift/generated/Locatable.qll 6cb437dd7ff7331429ec6586b0af50b1af15e4f72be47b5c89278923d4a9cea0 a93ac33767e077fa5a4c65b2110111de1939c9bb73fecdaf5aee80dce54469b7 lib/codeql/swift/generated/Location.qll 3f3bad413be87d05a596fe7b8004f415c2caa98cb759021a6aad20b589b7d700 ed30ed646962b3ffb6b47c97c6434fe47a6b1ea8e3f2e0589577bea5cf96c88e -lib/codeql/swift/generated/MacroRole.qll 8d15ac897080165635e0728f2b45d9b3066759b26c487f0456b821a1b08c1482 678ef0077de578e13472ec58c124397cd66b913db503f4db558aef919266b892 +lib/codeql/swift/generated/MacroRole.qll aaf5631c49de81e046854955341202d6d3516713cd09bc2e7b870e40c261cc9f 6cd17d40cbf1d8fa4ef01dfb8b3462b7cee902e6058fb76417c2035be12481d1 lib/codeql/swift/generated/OtherAvailabilitySpec.qll 06393a08e8da36106c5ec6efb9f1bd56a5c7b3d3f3d0bcefc6fa07fa96860c31 06393a08e8da36106c5ec6efb9f1bd56a5c7b3d3f3d0bcefc6fa07fa96860c31 lib/codeql/swift/generated/ParentChild.qll fffa8748471139e0143521443cb7bf566db136f932e80e1917e7ab7140389835 c7768c3ad33fb1934b7b8955d09fe1d2978187e8d1f59a9ba0595f5bcb884d2d lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll 5355be9da8b778d1d8ae60d25d9c3394477da24f94e8a6ab4484c6a16d07cd7c 075438c1762ec0a7775004b39032dcf85aada038a4269e6f428c34b8282786e9 diff --git a/swift/ql/lib/codeql/swift/generated/MacroRole.qll b/swift/ql/lib/codeql/swift/generated/MacroRole.qll index 4c42045876c3..7033fa385ece 100644 --- a/swift/ql/lib/codeql/swift/generated/MacroRole.qll +++ b/swift/ql/lib/codeql/swift/generated/MacroRole.qll @@ -24,11 +24,15 @@ module Generated { /** * Gets the kind of this macro role (declaration, expression, member, etc.). + * + * INTERNAL: Do not use. */ int getKind() { result = Synth::convertMacroRoleToRaw(this).(Raw::MacroRole).getKind() } /** * Gets the #freestanding or @attached. + * + * INTERNAL: Do not use. */ int getMacroSyntax() { result = Synth::convertMacroRoleToRaw(this).(Raw::MacroRole).getMacroSyntax() diff --git a/swift/schema.py b/swift/schema.py index 2f8593d94c6c..625e5825c320 100644 --- a/swift/schema.py +++ b/swift/schema.py @@ -1367,8 +1367,8 @@ class MacroRole(AstNode): """ The role of a macro, for example #freestanding(declaration) or @attached(member). """ - kind: int | doc("kind of this macro role (declaration, expression, member, etc.)") - macro_syntax: int | doc("#freestanding or @attached") + kind: int | doc("kind of this macro role (declaration, expression, member, etc.)") | ql.internal + macro_syntax: int | doc("#freestanding or @attached") | ql.internal conformances: list[TypeExpr] | doc("conformances of this macro role") names: list[string] | doc("names of this macro role")