3 from Cython.Compiler.Visitor cimport CythonTransform, TreeVisitor
5 cdef class ControlBlock:
6 cdef public set children
7 cdef public set parents
8 cdef public set positions
11 cdef public set bounded
12 cdef public dict input
13 cdef public dict output
15 # Big integer it bitsets
16 cdef public object i_input
17 cdef public object i_output
18 cdef public object i_gen
19 cdef public object i_kill
20 cdef public object i_state
22 cpdef bint empty(self)
24 cpdef add_child(self, block)
26 cdef class ExitBlock(ControlBlock):
27 cpdef bint empty(self)
29 cdef class NameAssignment:
30 cdef public bint is_arg
31 cdef public bint is_deletion
32 cdef public object lhs
33 cdef public object rhs
34 cdef public object entry
35 cdef public object pos
37 cdef public object bit
38 cdef public object inferred_type
40 cdef class AssignmentList:
41 cdef public object bit
42 cdef public object mask
43 cdef public list stats
45 cdef class AssignmentCollector(TreeVisitor):
49 cdef class ControlFlow:
50 cdef public set blocks
51 cdef public set entries
52 cdef public list loops
53 cdef public list exceptions
55 cdef public ControlBlock entry_point
56 cdef public ExitBlock exit_point
57 cdef public ControlBlock block
59 cdef public dict assmts
61 cpdef newblock(self, ControlBlock parent=*)
62 cpdef nextblock(self, ControlBlock parent=*)
63 cpdef bint is_tracked(self, entry)
64 cpdef bint is_statically_assigned(self, entry)
65 cpdef mark_position(self, node)
66 cpdef mark_assignment(self, lhs, rhs, entry)
67 cpdef mark_argument(self, lhs, rhs, entry)
68 cpdef mark_deletion(self, node, entry)
69 cpdef mark_reference(self, node, entry)
71 @cython.locals(block=ControlBlock, parent=ControlBlock, unreachable=set)
74 @cython.locals(bit=object, assmts=AssignmentList,
76 cpdef initialize(self)
78 @cython.locals(assmts=AssignmentList, assmt=NameAssignment)
79 cpdef set map_one(self, istate, entry)
81 @cython.locals(block=ControlBlock, parent=ControlBlock)
82 cdef reaching_definitions(self)
84 cdef class Uninitialized:
90 @cython.locals(dirty=bint, block=ControlBlock, parent=ControlBlock,
92 cdef check_definitions(ControlFlow flow, dict compiler_directives)
95 cdef class ControlFlowAnalysis(CythonTransform):
101 cdef ControlFlow flow
102 cdef bint in_inplace_assignment
104 cpdef mark_assignment(self, lhs, rhs=*)
105 cpdef mark_position(self, node)