diff options
author | 2016-06-07 14:20:52 +0100 | |
---|---|---|
committer | 2016-06-07 14:49:18 +0100 | |
commit | d6c205eb9b04bcfa072cd5ffdd93deef167ec340 (patch) | |
tree | ba2d71a03b266e317fe7278d1136098cb890dfee /compiler/optimizing/nodes.cc | |
parent | f1c25cf31d29c70b5102b249344bea76c374ecd8 (diff) |
ART: Remove redundant MoveInstructionBefore method
Change-Id: If53d7011197cc6b9c1702a3d98ef11b59eb76f0c
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r-- | compiler/optimizing/nodes.cc | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 150d6b029b..ae3c4b01e6 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -785,22 +785,6 @@ void HBasicBlock::ReplaceAndRemoveInstructionWith(HInstruction* initial, RemoveInstruction(initial); } -void HBasicBlock::MoveInstructionBefore(HInstruction* insn, HInstruction* cursor) { - DCHECK(!cursor->IsPhi()); - DCHECK(!insn->IsPhi()); - DCHECK(!insn->IsControlFlow()); - DCHECK(insn->CanBeMoved()); - DCHECK(!insn->HasSideEffects()); - - HBasicBlock* from_block = insn->GetBlock(); - HBasicBlock* to_block = cursor->GetBlock(); - DCHECK(from_block != to_block); - - from_block->RemoveInstruction(insn, /* ensure_safety */ false); - insn->SetBlock(to_block); - to_block->instructions_.InsertInstructionBefore(insn, cursor); -} - static void Add(HInstructionList* instruction_list, HBasicBlock* block, HInstruction* instruction) { @@ -1352,6 +1336,11 @@ std::ostream& operator<<(std::ostream& os, const HInstruction::InstructionKind& } void HInstruction::MoveBefore(HInstruction* cursor) { + DCHECK(!IsPhi()); + DCHECK(!IsControlFlow()); + DCHECK(CanBeMoved()); + DCHECK(!cursor->IsPhi()); + next_->previous_ = previous_; if (previous_ != nullptr) { previous_->next_ = next_; |