Quick: Kill unreachable blocks instead of just hiding them.
This changes the block type from kDalvikByteCode to kDead
and properly cleans up predecessors and MIRGraph::catches_.
Bug: 18626174
Change-Id: I268bf68f7947604bcb82caf95ee79c6831ee6e2a
diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h
index 1a18841..263f47c 100644
--- a/compiler/dex/mir_graph.h
+++ b/compiler/dex/mir_graph.h
@@ -410,15 +410,15 @@
void ResetOptimizationFlags(uint16_t reset_flags);
/**
- * @brief Hide the BasicBlock.
- * @details Set it to kDalvikByteCode, set hidden to true, remove all MIRs,
- * remove itself from any predecessor edges, remove itself from any
- * child's predecessor array.
+ * @brief Kill the BasicBlock.
+ * @details Unlink predecessors to make this block unreachable, then KillUnreachable().
*/
- void Hide(MIRGraph* mir_graph);
+ void Kill(MIRGraph* mir_graph);
/**
- * @brief Kill the unreachable block and all blocks that become unreachable by killing this one.
+ * @brief Kill the unreachable block and all blocks that become unreachable by killing this one.
+ * @details Set the block type to kDead and set hidden to true, remove all MIRs,
+ * unlink all successors and recursively kill successors that become unreachable.
*/
void KillUnreachable(MIRGraph* mir_graph);