diff options
author | 2024-08-15 07:40:38 +0000 | |
---|---|---|
committer | 2024-08-21 09:12:50 +0000 | |
commit | c08fb725b561ead05dc120f2e92ea5228d14eec0 (patch) | |
tree | c306cd68d8f26a33b3c45e2f07db695dccc00e6e /compiler/optimizing/optimizing_unit_test.h | |
parent | 1ea8807afeea6cd48127449cbd10458cc32cf4ce (diff) |
Change `MakeCondition()` to take `IfCondition`...
... instead of the instruction type argument.
And continue with loop construction cleanup in gtests.
Test: m test-art-host-gtest
Change-Id: I8cb83ae0c6d3cdb2a2ee4da0608cfeb69df722eb
Diffstat (limited to 'compiler/optimizing/optimizing_unit_test.h')
-rw-r--r-- | compiler/optimizing/optimizing_unit_test.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/compiler/optimizing/optimizing_unit_test.h b/compiler/optimizing/optimizing_unit_test.h index f6267c5867..adf24701a5 100644 --- a/compiler/optimizing/optimizing_unit_test.h +++ b/compiler/optimizing/optimizing_unit_test.h @@ -660,17 +660,26 @@ class OptimizingUnitTestHelper { return insn; } - template <typename Type> - Type* MakeCondition(HBasicBlock* block, - HInstruction* first, - HInstruction* second, - uint32_t dex_pc = kNoDexPc) { - static_assert(std::is_base_of_v<HCondition, Type>); - Type* condition = new (GetAllocator()) Type(first, second, dex_pc); + HCondition* MakeCondition(HBasicBlock* block, + IfCondition cond, + HInstruction* first, + HInstruction* second, + uint32_t dex_pc = kNoDexPc) { + HCondition* condition = graph_->CreateCondition(cond, first, second, dex_pc); AddOrInsertInstruction(block, condition); return condition; } + HSelect* MakeSelect(HBasicBlock* block, + HInstruction* condition, + HInstruction* true_value, + HInstruction* false_value, + uint32_t dex_pc = kNoDexPc) { + HSelect* select = new (GetAllocator()) HSelect(condition, true_value, false_value, dex_pc); + AddOrInsertInstruction(block, select); + return select; + } + HSuspendCheck* MakeSuspendCheck(HBasicBlock* block, uint32_t dex_pc = kNoDexPc) { HSuspendCheck* suspend_check = new (GetAllocator()) HSuspendCheck(dex_pc); AddOrInsertInstruction(block, suspend_check); |