diff options
| author | 2015-09-22 23:05:00 +0000 | |
|---|---|---|
| committer | 2015-09-22 23:05:00 +0000 | |
| commit | 33c0ed6cc26d07d4512a87a5d39d3412ee077020 (patch) | |
| tree | a1ac0376f982c7e3898ae13a2053a39a7aa155ce /compiler/optimizing/graph_checker.cc | |
| parent | 4ef16199765253bfe0ae1f02daf3b4f392d9ff67 (diff) | |
| parent | fe57faa2e0349418dda38e77ef1c0ac29db75f4d (diff) | |
Merge "[optimizing] Add basic PackedSwitch support"
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
| -rw-r--r-- | compiler/optimizing/graph_checker.cc | 16 | 
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index 583da30438..4e1cafee66 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -743,6 +743,22 @@ void SSAChecker::HandleBooleanInput(HInstruction* instruction, size_t input_inde    }  } +void SSAChecker::VisitPackedSwitch(HPackedSwitch* instruction) { +  VisitInstruction(instruction); +  // Check that the number of block successors matches the switch count plus +  // one for the default block. +  HBasicBlock* block = instruction->GetBlock(); +  if (instruction->GetNumEntries() + 1u != block->GetSuccessors().size()) { +    AddError(StringPrintf( +        "%s instruction %d in block %d expects %u successors to the block, but found: %zu.", +        instruction->DebugName(), +        instruction->GetId(), +        block->GetBlockId(), +        instruction->GetNumEntries() + 1u, +        block->GetSuccessors().size())); +  } +} +  void SSAChecker::VisitIf(HIf* instruction) {    VisitInstruction(instruction);    HandleBooleanInput(instruction, 0);  |