diff options
| author | 2015-05-11 13:18:05 +0000 | |
|---|---|---|
| committer | 2015-05-11 13:18:06 +0000 | |
| commit | 0e4c27e555d854f00185603138a6434358d07757 (patch) | |
| tree | 39d69de5d812826c4065d0acd38a58cd983f21f0 /compiler/optimizing/optimizing_unit_test.h | |
| parent | cdeb0b5fede4c06488f43a212591e661d946bc78 (diff) | |
| parent | 0a23d74dc2751440822960eab218be4cb8843647 (diff) | |
Merge "Add a parent environment to HEnvironment."
Diffstat (limited to 'compiler/optimizing/optimizing_unit_test.h')
| -rw-r--r-- | compiler/optimizing/optimizing_unit_test.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/optimizing/optimizing_unit_test.h b/compiler/optimizing/optimizing_unit_test.h index 6b236927da..4f8ec65e43 100644 --- a/compiler/optimizing/optimizing_unit_test.h +++ b/compiler/optimizing/optimizing_unit_test.h @@ -72,11 +72,16 @@ void RemoveSuspendChecks(HGraph* graph) { } } +inline HGraph* CreateGraph(ArenaAllocator* allocator) { + return new (allocator) HGraph( + allocator, *reinterpret_cast<DexFile*>(allocator->Alloc(sizeof(DexFile))), -1); +} + // Create a control-flow graph from Dex instructions. inline HGraph* CreateCFG(ArenaAllocator* allocator, const uint16_t* data, Primitive::Type return_type = Primitive::kPrimInt) { - HGraph* graph = new (allocator) HGraph(allocator); + HGraph* graph = CreateGraph(allocator); HGraphBuilder builder(graph, return_type); const DexFile::CodeItem* item = reinterpret_cast<const DexFile::CodeItem*>(data); |