diff options
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r-- | compiler/optimizing/graph_checker.cc | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index e694273e0b..596049f369 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -53,8 +53,7 @@ static bool IsExitTryBoundaryIntoExitBlock(HBasicBlock* block) { return false; } - // TODO: Remove "OrNull". - HTryBoundary* boundary = block->GetLastInstruction()->AsTryBoundaryOrNull(); + HTryBoundary* boundary = block->GetLastInstruction()->AsTryBoundary(); return block->GetPredecessors().size() == 1u && boundary->GetNormalFlowSuccessor()->IsExitBlock() && !boundary->IsEntry(); @@ -248,8 +247,7 @@ void GraphChecker::VisitBasicBlock(HBasicBlock* block) { AddError(StringPrintf("Block %d doesn't have a Nop as its first instruction.", current_block_->GetBlockId())); } else { - // TODO: Remove "OrNull". - HNop* nop = block->GetFirstInstruction()->AsNopOrNull(); + HNop* nop = block->GetFirstInstruction()->AsNop(); if (!nop->NeedsEnvironment()) { AddError( StringPrintf("%s:%d is a Nop and the first instruction of block %d, but it doesn't " @@ -660,8 +658,7 @@ void GraphChecker::VisitInstruction(HInstruction* instruction) { for (HBasicBlock* catch_block : entry.GetExceptionHandlers()) { const HEnvironment* environment = catch_block->GetFirstInstruction()->GetEnvironment(); for (HInstructionIterator phi_it(catch_block->GetPhis()); !phi_it.Done(); phi_it.Advance()) { - // TODO: Remove "OrNull". - HPhi* catch_phi = phi_it.Current()->AsPhiOrNull(); + HPhi* catch_phi = phi_it.Current()->AsPhi(); if (environment->GetInstructionAt(catch_phi->GetRegNumber()) == nullptr) { AddError(StringPrintf("Instruction %s:%d throws into catch block %d " "with catch phi %d for vreg %d but its " @@ -750,9 +747,8 @@ void GraphChecker::CheckTypeCheckBitstringInput(HTypeCheckInstruction* check, check->InputAt(2)->DebugName(), check->InputAt(2)->GetId())); } else if (check_value) { - // TODO: Remove "OrNull". uint32_t actual_value = - static_cast<uint32_t>(check->InputAt(input_pos)->AsIntConstantOrNull()->GetValue()); + static_cast<uint32_t>(check->InputAt(input_pos)->AsIntConstant()->GetValue()); if (actual_value != expected_value) { AddError(StringPrintf("%s:%d (bitstring) has %s 0x%x, not 0x%x as expected.", check->DebugName(), @@ -948,8 +944,7 @@ static bool IsSameSizeConstant(const HInstruction* insn1, const HInstruction* in static bool IsConstantEquivalent(const HInstruction* insn1, const HInstruction* insn2, BitVector* visited) { - // TODO: Remove "OrNull". - if (insn1->IsPhi() && insn1->AsPhiOrNull()->IsVRegEquivalentOf(insn2)) { + if (insn1->IsPhi() && insn1->AsPhi()->IsVRegEquivalentOf(insn2)) { HConstInputsRef insn1_inputs = insn1->GetInputs(); HConstInputsRef insn2_inputs = insn2->GetInputs(); if (insn1_inputs.size() != insn2_inputs.size()) { @@ -969,9 +964,7 @@ static bool IsConstantEquivalent(const HInstruction* insn1, } return true; } else if (IsSameSizeConstant(insn1, insn2)) { - // TODO: Remove "OrNull". - return insn1->AsConstantOrNull()->GetValueAsUint64() == - insn2->AsConstantOrNull()->GetValueAsUint64(); + return insn1->AsConstant()->GetValueAsUint64() == insn2->AsConstant()->GetValueAsUint64(); } else { return false; } @@ -1065,8 +1058,7 @@ void GraphChecker::VisitPhi(HPhi* phi) { // phis which can be constructed artifically. if (phi->IsCatchPhi()) { HInstruction* next_phi = phi->GetNext(); - // TODO: Remove "OrNull". - if (next_phi != nullptr && phi->GetRegNumber() > next_phi->AsPhiOrNull()->GetRegNumber()) { + if (next_phi != nullptr && phi->GetRegNumber() > next_phi->AsPhi()->GetRegNumber()) { AddError(StringPrintf("Catch phis %d and %d in block %d are not sorted by their " "vreg numbers.", phi->GetId(), @@ -1082,8 +1074,7 @@ void GraphChecker::VisitPhi(HPhi* phi) { for (HInstructionIterator phi_it(phi->GetBlock()->GetPhis()); !phi_it.Done(); phi_it.Advance()) { - // TODO: Remove "OrNull". - HPhi* other_phi = phi_it.Current()->AsPhiOrNull(); + HPhi* other_phi = phi_it.Current()->AsPhi(); if (phi != other_phi && phi->GetRegNumber() == other_phi->GetRegNumber()) { if (phi->GetType() == other_phi->GetType()) { std::stringstream type_str; @@ -1126,8 +1117,7 @@ void GraphChecker::VisitPhi(HPhi* phi) { void GraphChecker::HandleBooleanInput(HInstruction* instruction, size_t input_index) { HInstruction* input = instruction->InputAt(input_index); if (input->IsIntConstant()) { - // TODO: Remove "OrNull". - int32_t value = input->AsIntConstantOrNull()->GetValue(); + int32_t value = input->AsIntConstant()->GetValue(); if (value != 0 && value != 1) { AddError(StringPrintf( "%s instruction %d has a non-Boolean constant input %d whose value is: %d.", |