Closed LonelyCat124 closed 3 years ago
An implementation of this exists in the DL_MESO_IO branch oftwo_region_privilege_map
for Assignments
only:
if(node.lhs[1]:is(ast.specialized.expr.FieldAccess)) then
local name, symbol = traverse_fieldaccess_postorder_two_region(node.lhs[1],sym1, sym2)
if(symbol == 1) then
write_sym1:insert(name)
elseif(symbol == 2) then
write_sym2:insert(name)
end
else
--For array accesses, we recurse until we find a non-array access and then check if its a FieldAccess if node.lhs[1]:is(ast.specialized.expr.IndexAccess) then
local z = node.lhs[1]
while z.value:is(ast.specialized.expr.IndexAccess) do
z = z.value
end
if z.value:is(ast.specialized.expr.FieldAccess) then
local name, symbol = traverse_fieldaccess_postorder_two_region(z.value,sym1, sym2)
if(symbol == 1) then
write_sym1:insert(name)
elseif(symbol == 2) then
write_sym2:insert(name)
end
end
end
end
This needs to be extended (into a function probably) to apply to other parts of the compute_privilege
code
This is now fully implemented in the dl_meso branch.
With a field space containing an array, e.g.
kernels making use of the array do not correctly compute privileges for these array accesses, so compilation will fail.