1
1
# This script is used to annotate .qll files without any existing overlay annotations
2
- # with overlay[local?] and overlay[caller] annotations. Maintenance of overlay annotations
2
+ # with overlay[local?] and overlay[caller? ] annotations. Maintenance of overlay annotations
3
3
# in annotated files will be handled by QL-for-QL queries.
4
4
5
5
# It will walk the directory tree and annotate most .qll files, skipping only
@@ -24,7 +24,7 @@ def has_overlay_annotations(lines):
24
24
'''
25
25
Check whether the given lines contain any overlay[...] annotations.
26
26
'''
27
- overlays = ["local" , "local?" , "global" , "caller" ]
27
+ overlays = ["local" , "local?" , "global" , "caller" , "caller?" ]
28
28
annotations = [f"overlay[{ t } ]" for t in overlays ]
29
29
return any (ann in line for ann in annotations for line in lines )
30
30
@@ -165,15 +165,15 @@ def insert_toplevel_maybe_local_annotation(filename, lines):
165
165
166
166
def insert_overlay_caller_annotations (lines ):
167
167
'''
168
- Mark pragma[inline] predicates as overlay[caller] if they are not declared private.
168
+ Mark pragma[inline] predicates as overlay[caller? ] if they are not declared private.
169
169
'''
170
170
out_lines = []
171
171
for i , line in enumerate (lines ):
172
172
trimmed = line .strip ()
173
173
if trimmed == "pragma[inline]" :
174
174
if i + 1 < len (lines ) and not "private" in lines [i + 1 ]:
175
175
whitespace = line [0 : line .find (trimmed )]
176
- out_lines .append (f"{ whitespace } overlay[caller]\n " )
176
+ out_lines .append (f"{ whitespace } overlay[caller? ]\n " )
177
177
out_lines .append (line )
178
178
return out_lines
179
179
0 commit comments