Package compiler :: Module pyassem :: Class Block
[hide private]
[frames] | no frames]

_ClassType Block

Instance Methods [hide private]
 
__init__(self, label='')
 
__repr__(self)
 
__str__(self)
 
emit(self, inst)
 
getInstructions(self)
 
addInEdge(self, block)
 
addOutEdge(self, block)
 
addNext(self, block)
 
pruneNext(self)
Remove bogus edge for unconditional transfers
 
get_children(self)
 
getContainedGraphs(self)
Return all graphs contained within this block.
Class Variables [hide private]
  _count = 0
  _uncond_transfer = ('RETURN_VALUE', 'RAISE_VARARGS', 'YIELD_VA...
Method Details [hide private]

pruneNext(self)

 

Remove bogus edge for unconditional transfers

Each block has a next edge that accounts for implicit control transfers, e.g. from a JUMP_IF_FALSE to the block that will be executed if the test is true.

These edges must remain for the current assembler code to work. If they are removed, the dfs_postorder gets things in weird orders. However, they shouldn't be there for other purposes, e.g. conversion to SSA form. This method will remove the next edge when it follows an unconditional control transfer.

getContainedGraphs(self)

 

Return all graphs contained within this block.

For example, a MAKE_FUNCTION block will contain a reference to the graph for the function body.


Class Variable Details [hide private]

_uncond_transfer

Value:
('RETURN_VALUE',
 'RAISE_VARARGS',
 'YIELD_VALUE',
 'JUMP_ABSOLUTE',
 'JUMP_FORWARD',
 'CONTINUE_LOOP')