diff options
| author | 2015-04-24 17:06:35 -0400 | |
|---|---|---|
| committer | 2015-04-24 19:25:51 -0400 | |
| commit | 1152c926076a760490085c4497c3f117fa8da891 (patch) | |
| tree | 215d3f45a946f51ae680ec50239ebc48f929aed7 /compiler/optimizing/graph_checker.cc | |
| parent | 76f1413492c228bfa710e1eaa4c60370eaffbb8a (diff) | |
[optimizing] Rename HasArrayAccesses and check it
Since the flag is only used to see if there is a HBoundsCheck, rename
HasArrayAccesses() to HasBoundsChecks().
Add a check in graph_checker to see that the flag is set if we see a
HBoundsCheck instruction.
Change-Id: I10fe92897374fb247082152dd75c3611cc40ff30
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
| -rw-r--r-- | compiler/optimizing/graph_checker.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index 890676467f..dc3124b35f 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -121,6 +121,18 @@ void GraphChecker::VisitBasicBlock(HBasicBlock* block) { } } +void GraphChecker::VisitBoundsCheck(HBoundsCheck* check) { + if (!GetGraph()->HasBoundsChecks()) { + AddError(StringPrintf("Instruction %s:%d is a HBoundsCheck, " + "but HasBoundsChecks() returns false", + check->DebugName(), + check->GetId())); + } + + // Perform the instruction base checks too. + VisitInstruction(check); +} + void GraphChecker::VisitInstruction(HInstruction* instruction) { if (seen_ids_.IsBitSet(instruction->GetId())) { AddError(StringPrintf("Instruction id %d is duplicate in graph.", |