summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/graph_test.cc')
-rw-r--r--compiler/optimizing/graph_test.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/optimizing/graph_test.cc b/compiler/optimizing/graph_test.cc
index b5d712736f..46c93aff84 100644
--- a/compiler/optimizing/graph_test.cc
+++ b/compiler/optimizing/graph_test.cc
@@ -38,18 +38,15 @@ HBasicBlock* GraphTest::CreateIfBlock(HGraph* graph) {
HBasicBlock* if_block = new (GetAllocator()) HBasicBlock(graph);
graph->AddBlock(if_block);
HInstruction* instr = graph->GetIntConstant(4);
- HInstruction* equal = new (GetAllocator()) HEqual(instr, instr);
- if_block->AddInstruction(equal);
- instr = new (GetAllocator()) HIf(equal);
- if_block->AddInstruction(instr);
+ HInstruction* equal = MakeCondition<HEqual>(if_block, instr, instr);
+ MakeIf(if_block, equal);
return if_block;
}
HBasicBlock* GraphTest::CreateGotoBlock(HGraph* graph) {
HBasicBlock* block = new (GetAllocator()) HBasicBlock(graph);
graph->AddBlock(block);
- HInstruction* got = new (GetAllocator()) HGoto();
- block->AddInstruction(got);
+ MakeGoto(block);
return block;
}
@@ -70,8 +67,7 @@ HBasicBlock* GraphTest::CreateReturnBlock(HGraph* graph) {
HBasicBlock* GraphTest::CreateExitBlock(HGraph* graph) {
HBasicBlock* block = new (GetAllocator()) HBasicBlock(graph);
graph->AddBlock(block);
- HInstruction* exit_instr = new (GetAllocator()) HExit();
- block->AddInstruction(exit_instr);
+ MakeExit(block);
return block;
}