Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions misc/codegen/templates/ql_class.mustache
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
// generated by {{generator}}
/**
* This module provides the generated definition of `{{name}}`.
{{#ql_internal}}
* INTERNAL: Do not use.
{{/ql_internal}}
*/

private import {{import_prefix}}.Synth
private import {{import_prefix}}.Raw
{{#imports}}
Expand Down
4 changes: 4 additions & 0 deletions misc/codegen/templates/ql_imports.mustache
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// generated by {{generator}}
/**
* This module exports all modules providing `Element` subclasses.
*/

{{#imports}}
import {{.}}
{{/imports}}
3 changes: 3 additions & 0 deletions misc/codegen/templates/ql_parent.mustache
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// generated by {{generator}}
/**
* This module provides the generated parent/child relationship.
*/

{{#imports}}
import {{.}}
Expand Down
6 changes: 6 additions & 0 deletions misc/codegen/templates/ql_stub.mustache
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// generated by {{generator}}, remove this comment if you wish to edit this file
/**
* This module provides a hand-modifiable wrapper around the generated class `{{name}}`.
{{#ql_internal}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure ql_internal is part of the Stub?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! And it made me think, that all the generated classes should actually be marked INTERNAL, as they should never be used directly, so I changed that as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But methods from generated classes are used all the time and thus should not be marked as internal, right? For example Callable.getName() is from Generated::Callable.

Copy link
Contributor Author

@redsun82 redsun82 Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly. Unless ql.internal is used on a specific property (for example kind: int | ql.internal), getters are not marked as internal.

* INTERNAL: Do not use.
{{/ql_internal}}
*/
private import {{base_import}}
{{#has_synth_accessors}}
private import {{import_prefix}}.Raw
Expand Down
9 changes: 9 additions & 0 deletions misc/codegen/templates/ql_synth_constructor_stub.mustache
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
// generated by {{generator}}, remove this comment if you wish to edit this file
/**
* This module defines the hook used internally to tweak the characteristic predicate of
* `{{cls.name}}` synthesized instances.
* INTERNAL: Do not use.
*/
private import {{import_prefix}}.Raw
{{#cls}}
{{#is_db}}
Expand All @@ -7,6 +12,10 @@ private import {{import_prefix}}.PureSynthConstructors
{{/has_subtracted_synth_types}}
{{/is_db}}

/**
* The characteristic predicate of `{{name}}` synthesized instances.
* INTERNAL: Do not use.
*/
predicate construct{{name}}({{#params}}{{^first}}, {{/first}}{{type}} {{param}}{{/params}}) {
{{#is_db}}
{{#subtracted_synth_types}}{{^first}} and {{/first}}not construct{{name}}(id){{/subtracted_synth_types}}
Expand Down
1,302 changes: 651 additions & 651 deletions swift/ql/.generated.list

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions swift/ql/lib/codeql/swift/elements.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions swift/ql/lib/codeql/swift/elements/AvailabilitySpec.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions swift/ql/lib/codeql/swift/elements/CommentConstructor.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions swift/ql/lib/codeql/swift/elements/DbFile.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions swift/ql/lib/codeql/swift/elements/DbFileConstructor.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions swift/ql/lib/codeql/swift/elements/DbLocation.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions swift/ql/lib/codeql/swift/elements/DbLocationConstructor.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions swift/ql/lib/codeql/swift/elements/DiagnosticsConstructor.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions swift/ql/lib/codeql/swift/elements/ErrorElement.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions swift/ql/lib/codeql/swift/elements/decl/AccessorConstructor.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions swift/ql/lib/codeql/swift/elements/decl/ClassDecl.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions swift/ql/lib/codeql/swift/elements/decl/ConcreteVarDecl.qll

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading