File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
test/queries/overlay/InlineOverlayCaller Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -2542,6 +2542,10 @@ private class CallerArg extends AnnotationArg {
25422542 CallerArg ( ) { this .getValue ( ) = "caller" }
25432543}
25442544
2545+ private class CallerQArg extends AnnotationArg {
2546+ CallerQArg ( ) { this .getValue ( ) = "caller?" }
2547+ }
2548+
25452549private class LocalArg extends AnnotationArg {
25462550 LocalArg ( ) { this .getValue ( ) = "local" }
25472551}
@@ -2616,6 +2620,13 @@ class OverlayCaller extends Annotation {
26162620 override string toString ( ) { result = "overlay[caller]" }
26172621}
26182622
2623+ /** An `overlay[caller?]` annotation. */
2624+ class OverlayCallerQ extends Annotation {
2625+ OverlayCallerQ ( ) { this .getName ( ) = "overlay" and this .getArgs ( 0 ) instanceof CallerQArg }
2626+
2627+ override string toString ( ) { result = "overlay[caller?]" }
2628+ }
2629+
26192630/** An `overlay[local]` annotation. */
26202631class OverlayLocal extends Annotation {
26212632 OverlayLocal ( ) { this .getName ( ) = "overlay" and this .getArgs ( 0 ) instanceof LocalArg }
Original file line number Diff line number Diff line change @@ -31,11 +31,12 @@ where
3131 mayBeLocal ( p ) and
3232 p .getAnAnnotation ( ) instanceof Inline and
3333 not p .getAnAnnotation ( ) instanceof OverlayCaller and
34+ not p .getAnAnnotation ( ) instanceof OverlayCallerQ and
3435 not p .isPrivate ( )
3536select p ,
3637 "This possibly local non-private inline predicate will not " +
3738 "be inlined across the overlay frontier. This may negatively " +
3839 "affect evaluation performance. Consider adding an " +
39- "`overlay[caller]` annotation to allow inlining across the " +
40- "overlay frontier. Note that adding an `overlay[caller]` " +
40+ "`overlay[caller]` or `overlay[caller?]` annotation to allow inlining across the " +
41+ "overlay frontier. Note that adding an `overlay[caller]` or `overlay[caller?]` " +
4142 "annotation affects semantics under overlay evaluation."
Original file line number Diff line number Diff line change @@ -12,3 +12,7 @@ predicate bar(int x) { x = 43 }
1212
1313pragma [ inline]
1414private predicate baz ( int x ) { x = 44 }
15+
16+ overlay [ caller?]
17+ pragma [ inline]
18+ predicate baw ( int x ) { x = = 45 }
You can’t perform that action at this time.
0 commit comments