diff options
author | Vladimir Marko <vmarko@google.com> | 2015-10-01 20:57:57 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2015-10-08 11:10:18 +0100 |
commit | ec7802a102d49ab5c17495118d4fe0bcc7287beb (patch) | |
tree | 08649609604b9c96bc48ca071c48b0af5abb1a3f /compiler/optimizing/find_loops_test.cc | |
parent | b2e436ffcda1d7a87e7bf9133d8ed878388c73c2 (diff) |
Add DCHECKs to ArenaVector and ScopedArenaVector.
Implement dchecked_vector<> template that DCHECK()s element
access and insert()/emplace()/erase() positions. Change the
ArenaVector<> and ScopedArenaVector<> aliases to use the new
template instead of std::vector<>. Remove DCHECK()s that
have now become unnecessary from the Optimizing compiler.
Change-Id: Ib8506bd30d223f68f52bd4476c76d9991acacadc
Diffstat (limited to 'compiler/optimizing/find_loops_test.cc')
-rw-r--r-- | compiler/optimizing/find_loops_test.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/compiler/optimizing/find_loops_test.cc b/compiler/optimizing/find_loops_test.cc index 9e0d352d3e..9b0eb70742 100644 --- a/compiler/optimizing/find_loops_test.cc +++ b/compiler/optimizing/find_loops_test.cc @@ -118,7 +118,7 @@ static void TestBlock(HGraph* graph, uint32_t parent_loop_header_id, const int* blocks_in_loop = nullptr, size_t number_of_blocks = 0) { - HBasicBlock* block = graph->GetBlock(block_id); + HBasicBlock* block = graph->GetBlocks()[block_id]; ASSERT_EQ(block->IsLoopHeader(), is_loop_header); if (parent_loop_header_id == kInvalidBlockId) { ASSERT_EQ(block->GetLoopInformation(), nullptr); @@ -296,10 +296,10 @@ TEST(FindLoopsTest, InnerLoop) { TestBlock(graph, 7, false, kInvalidBlockId); // exit block TestBlock(graph, 8, false, 2); // synthesized block as pre header of inner loop - ASSERT_TRUE(graph->GetBlock(3)->GetLoopInformation()->IsIn( - *graph->GetBlock(2)->GetLoopInformation())); - ASSERT_FALSE(graph->GetBlock(2)->GetLoopInformation()->IsIn( - *graph->GetBlock(3)->GetLoopInformation())); + ASSERT_TRUE(graph->GetBlocks()[3]->GetLoopInformation()->IsIn( + *graph->GetBlocks()[2]->GetLoopInformation())); + ASSERT_FALSE(graph->GetBlocks()[2]->GetLoopInformation()->IsIn( + *graph->GetBlocks()[3]->GetLoopInformation())); } TEST(FindLoopsTest, TwoLoops) { @@ -326,10 +326,10 @@ TEST(FindLoopsTest, TwoLoops) { TestBlock(graph, 6, false, kInvalidBlockId); // return block TestBlock(graph, 7, false, kInvalidBlockId); // exit block - ASSERT_FALSE(graph->GetBlock(4)->GetLoopInformation()->IsIn( - *graph->GetBlock(2)->GetLoopInformation())); - ASSERT_FALSE(graph->GetBlock(2)->GetLoopInformation()->IsIn( - *graph->GetBlock(4)->GetLoopInformation())); + ASSERT_FALSE(graph->GetBlocks()[4]->GetLoopInformation()->IsIn( + *graph->GetBlocks()[2]->GetLoopInformation())); + ASSERT_FALSE(graph->GetBlocks()[2]->GetLoopInformation()->IsIn( + *graph->GetBlocks()[4]->GetLoopInformation())); } TEST(FindLoopsTest, NonNaturalLoop) { @@ -344,8 +344,8 @@ TEST(FindLoopsTest, NonNaturalLoop) { ArenaPool arena; ArenaAllocator allocator(&arena); HGraph* graph = TestCode(data, &allocator); - ASSERT_TRUE(graph->GetBlock(3)->IsLoopHeader()); - HLoopInformation* info = graph->GetBlock(3)->GetLoopInformation(); + ASSERT_TRUE(graph->GetBlocks()[3]->IsLoopHeader()); + HLoopInformation* info = graph->GetBlocks()[3]->GetLoopInformation(); ASSERT_EQ(1u, info->NumberOfBackEdges()); ASSERT_FALSE(info->GetHeader()->Dominates(info->GetBackEdges()[0])); } |