|
@@ -106,6 +106,12 @@ class BasicBlock(object):
|
|
|
for definition in self.definitions:
|
|
|
definition.renumber(self.definition_counter.next_value())
|
|
|
|
|
|
+ assert (
|
|
|
+ len(set(
|
|
|
+ [definition.definition_index
|
|
|
+ for definition in self.parameters + self.definitions])) ==
|
|
|
+ len(self.parameters) + len(self.definitions))
|
|
|
+
|
|
|
def __str__(self):
|
|
|
prefix = '!%d(%s):' % (self.index, ', '.join(map(str, self.parameters)))
|
|
|
return '\n'.join(
|
|
@@ -1029,9 +1035,9 @@ def get_all_reachable_blocks(entry_point):
|
|
|
|
|
|
def get_all_blocks(entry_point):
|
|
|
"""Gets all basic blocks in the control-flow graph defined by the given entry point."""
|
|
|
- yield entry_point
|
|
|
- for block in get_reachable_blocks(entry_point):
|
|
|
- yield block
|
|
|
+ reachable_blocks = get_reachable_blocks(entry_point)
|
|
|
+ reachable_blocks.add(entry_point)
|
|
|
+ return reachable_blocks
|
|
|
|
|
|
def get_trivial_phi_value(parameter_def, values):
|
|
|
"""Tests if the given parameter definition is an alias for another definition.
|