diff options
author | 2015-07-01 08:54:33 +0000 | |
---|---|---|
committer | 2015-07-01 08:54:34 +0000 | |
commit | ed6193a75b90ec3026622b2cbc146452a85b8d47 (patch) | |
tree | b964b6cc449f30a1847de61e1a16812c87bca7a4 /compiler/optimizing/graph_checker.cc | |
parent | e54cd64e97e5626d685e858cd871db248dacf7ea (diff) | |
parent | b7a4790e5a2884e62f6dc85aca1455b145e2a7db (diff) |
Merge "Revert "Revert "Do not update the type of something we already know.""" into mnc-dev
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r-- | compiler/optimizing/graph_checker.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index fd28f0b83f..44c4101369 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -253,6 +253,30 @@ void GraphChecker::VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* invoke) { } } +void GraphChecker::VisitCheckCast(HCheckCast* check) { + VisitInstruction(check); + HInstruction* input = check->InputAt(1); + if (!input->IsLoadClass()) { + AddError(StringPrintf("%s:%d expects a HLoadClass as second input, not %s:%d.", + check->DebugName(), + check->GetId(), + input->DebugName(), + input->GetId())); + } +} + +void GraphChecker::VisitInstanceOf(HInstanceOf* instruction) { + VisitInstruction(instruction); + HInstruction* input = instruction->InputAt(1); + if (!input->IsLoadClass()) { + AddError(StringPrintf("%s:%d expects a HLoadClass as second input, not %s:%d.", + instruction->DebugName(), + instruction->GetId(), + input->DebugName(), + input->GetId())); + } +} + void SSAChecker::VisitBasicBlock(HBasicBlock* block) { super_type::VisitBasicBlock(block); |