diff options
Diffstat (limited to 'compiler/optimizing/nodes.cc')
| -rw-r--r-- | compiler/optimizing/nodes.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index f07029d6c2..207c605ddd 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -468,4 +468,16 @@ bool HCondition::NeedsMaterialization() const { return false; } +bool HInstruction::Equals(HInstruction* other) const { + if (!InstructionTypeEquals(other)) return false; + if (!InstructionDataEquals(other)) return false; + if (GetType() != other->GetType()) return false; + if (InputCount() != other->InputCount()) return false; + + for (size_t i = 0, e = InputCount(); i < e; ++i) { + if (InputAt(i) != other->InputAt(i)) return false; + } + return true; +} + } // namespace art |