From 86ea7eeabe30c98bbe1651a51d03cb89776724e7 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Tue, 16 Feb 2016 09:26:07 +0000 Subject: Build dominator tree before generating HInstructions Second CL in the series of merging HGraphBuilder and SsaBuilder. This patch refactors the builders so that dominator tree can be built before any HInstructions are generated. This puts the SsaBuilder removal of HLoadLocals/HStoreLocals straight after HGraphBuilder's HInstruction generation phase. Next CL will therefore be able to merge them. This patch also adds util classes for iterating bytecode and switch tables which allowed to simplify the code. Bug: 27894376 Change-Id: Ic425d298b2e6e7980481ed697230b1a0b7904526 --- compiler/optimizing/optimizing_unit_test.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/optimizing_unit_test.h') diff --git a/compiler/optimizing/optimizing_unit_test.h b/compiler/optimizing/optimizing_unit_test.h index 0ca7305d13..b140125d14 100644 --- a/compiler/optimizing/optimizing_unit_test.h +++ b/compiler/optimizing/optimizing_unit_test.h @@ -91,8 +91,8 @@ inline HGraph* CreateCFG(ArenaAllocator* allocator, { ScopedObjectAccess soa(Thread::Current()); StackHandleScopeCollection handles(soa.Self()); - HGraphBuilder builder(graph, return_type); - bool graph_built = (builder.BuildGraph(*item, &handles) == kAnalysisSuccess); + HGraphBuilder builder(graph, *item, return_type); + bool graph_built = (builder.BuildGraph(&handles) == kAnalysisSuccess); return graph_built ? graph : nullptr; } } @@ -109,7 +109,8 @@ inline std::string Patch(const std::string& original, const diff_t& diff) { std::string result = original; for (const auto& p : diff) { std::string::size_type pos = result.find(p.first); - EXPECT_NE(pos, std::string::npos); + DCHECK_NE(pos, std::string::npos) + << "Could not find: \"" << p.first << "\" in \"" << result << "\""; result.replace(pos, p.first.size(), p.second); } return result; -- cgit v1.2.3-59-g8ed1b