Skip to content

Commit 8b3b2f5

Browse files
committed
QL AST: Add overlay annotations
1 parent a519eab commit 8b3b2f5

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

ql/ql/src/codeql_ql/ast/Ast.qll

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,6 +2538,18 @@ private class NoOptArg extends AnnotationArg {
25382538
NoOptArg() { this.getValue() = "noopt" }
25392539
}
25402540

2541+
private class CallerArg extends AnnotationArg {
2542+
CallerArg() { this.getValue() = "caller" }
2543+
}
2544+
2545+
private class LocalArg extends AnnotationArg {
2546+
LocalArg() { this.getValue() = "local" }
2547+
}
2548+
2549+
private class LocalQArg extends AnnotationArg {
2550+
LocalQArg() { this.getValue() = "local?" }
2551+
}
2552+
25412553
private class MonotonicAggregatesArg extends AnnotationArg {
25422554
MonotonicAggregatesArg() { this.getValue() = "monotonicAggregates" }
25432555
}
@@ -2597,6 +2609,27 @@ class NoOpt extends Annotation {
25972609
override string toString() { result = "noopt" }
25982610
}
25992611

2612+
/** An `overlay[caller]` annotation. */
2613+
class OverlayCaller extends Annotation {
2614+
OverlayCaller() { this.getName() = "overlay" and this.getArgs(0) instanceof CallerArg }
2615+
2616+
override string toString() { result = "caller" }
2617+
}
2618+
2619+
/** An `overlay[local]` annotation. */
2620+
class OverlayLocal extends Annotation {
2621+
OverlayLocal() { this.getName() = "overlay" and this.getArgs(0) instanceof LocalArg }
2622+
2623+
override string toString() { result = "local" }
2624+
}
2625+
2626+
/** An `overlay[local?]` annotation. */
2627+
class OverlayLocalQ extends Annotation {
2628+
OverlayLocalQ() { this.getName() = "overlay" and this.getArgs(0) instanceof LocalQArg }
2629+
2630+
override string toString() { result = "local?" }
2631+
}
2632+
26002633
/** A `language[monotonicAggregates]` annotation. */
26012634
class MonotonicAggregates extends Annotation {
26022635
MonotonicAggregates() { this.getArgs(0) instanceof MonotonicAggregatesArg }

0 commit comments

Comments
 (0)