summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2016-03-22 16:38:18 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-03-22 16:38:18 +0000
commit6fa06e6f5a92cd318021afad9b036126438b2de4 (patch)
treed48878a61532d4d901d5f31c18c569cc6234242d /compiler/optimizing/graph_checker.cc
parent2a07b80dfbfb869aabe96c88b10e07d26c0ce137 (diff)
parent937e6cd515bbe7ff2f255c8fcd40bf1a575a9a16 (diff)
Merge "Tighten art::HNeg type constraints on its input."
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index 9491ef6119..6fe8bf4496 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -920,6 +920,19 @@ void GraphChecker::VisitCondition(HCondition* op) {
}
}
+void GraphChecker::VisitNeg(HNeg* instruction) {
+ VisitInstruction(instruction);
+ Primitive::Type input_type = instruction->InputAt(0)->GetType();
+ Primitive::Type result_type = instruction->GetType();
+ if (result_type != Primitive::PrimitiveKind(input_type)) {
+ AddError(StringPrintf("Binary operation %s %d has a result type different "
+ "from its input kind: %s vs %s.",
+ instruction->DebugName(), instruction->GetId(),
+ Primitive::PrettyDescriptor(result_type),
+ Primitive::PrettyDescriptor(input_type)));
+ }
+}
+
void GraphChecker::VisitBinaryOperation(HBinaryOperation* op) {
VisitInstruction(op);
Primitive::Type lhs_type = op->InputAt(0)->GetType();