summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2015-11-10 18:49:28 +0000
committer David Brazdil <dbrazdil@google.com> 2015-11-10 18:49:28 +0000
commitd8ef0c69330f74f325f7671236ca6bf44b7ec9c9 (patch)
treea1fd3b679a67ca623bbb6c2786d5691046617226 /compiler/optimizing/graph_checker.cc
parent969670298516b9316b36270fcc4c21bfcd499595 (diff)
ART: Remove unnecessary helper method from GraphChecker
Change-Id: I59f50a559da560033f4c9407d83b68fc5d64bd3c
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc11
1 files changed, 2 insertions, 9 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index 091f1c7e89..5814d7556f 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -162,13 +162,6 @@ void GraphChecker::VisitBoundsCheck(HBoundsCheck* check) {
VisitInstruction(check);
}
-// Returns true if there exists `index2` such that `index2 > index` and
-// `array[index] == array[index2]`.
-static bool ContainsSameValueAfter(ArrayRef<HBasicBlock* const> array, size_t index) {
- ArrayRef<HBasicBlock* const> tail = array.SubArray(index + 1);
- return std::find(tail.begin(), tail.end(), array[index]) != tail.end();
-}
-
void GraphChecker::VisitTryBoundary(HTryBoundary* try_boundary) {
ArrayRef<HBasicBlock* const> handlers = try_boundary->GetExceptionHandlers();
@@ -188,8 +181,8 @@ void GraphChecker::VisitTryBoundary(HTryBoundary* try_boundary) {
// Ensure that handlers are not listed multiple times.
for (size_t i = 0, e = handlers.size(); i < e; ++i) {
- if (ContainsSameValueAfter(handlers, i)) {
- AddError(StringPrintf("Exception handler block %d of %s:%d is listed multiple times.",
+ if (ContainsElement(handlers, handlers[i], i + 1)) {
+ AddError(StringPrintf("Exception handler block %d of %s:%d is listed multiple times.",
handlers[i]->GetBlockId(),
try_boundary->DebugName(),
try_boundary->GetId()));