[go: up one dir, main page]

Menu

[390b88]: / ir / sym.py  Maximize  Restore  History

Download this file

41 lines (26 with data), 629 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'''Symbol handling transformations.'''
from transf import parse
import ir.match
parse.Transfs('''
#######################################################################
# Local variable table
shared local as table
# TODO: detect local variables from scope rules
isReg = annotation.Has(?Reg)
isTmp = annotation.Has(?Tmp)
isLocalVar =
ir.match.aSym ;
(isReg + isTmp)
updateLocalVar =
isLocalVar ;
Where(local.set [_,_] )
updateLocalVars =
local.clear ;
traverse.AllTD(updateLocalVar)
EnterFunction(operand) =
with local in
updateLocalVars ;
operand
end
EnterModule(operand) = EnterFunction(operand)
''')