ART: Dead block removal
Adds a new pass which finds all unreachable blocks, typically due to
simplifying an if-condition to a constant, and removes them from the
graph. The patch also slightly generalizes the graph-transforming
operations.
Change-Id: Iff7c97f1d10b52886f3cd7401689ebe1bfdbf456
diff --git a/compiler/utils/growable_array.h b/compiler/utils/growable_array.h
index 821e28b..e4b1e7d 100644
--- a/compiler/utils/growable_array.h
+++ b/compiler/utils/growable_array.h
@@ -46,6 +46,14 @@
}
}
+ bool Contains(T value) const {
+ for (size_t i = 0; i < num_used_; ++i) {
+ if (elem_list_[i] == value) {
+ return true;
+ }
+ }
+ return false;
+ }
// Expand the list size to at least new length.
void Resize(size_t new_length) {