diff options
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r-- | compiler/optimizing/graph_checker.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index f2e77e28a6..c790d013b5 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -1005,4 +1005,19 @@ void GraphChecker::VisitBoundType(HBoundType* instruction) { } } +void GraphChecker::VisitTypeConversion(HTypeConversion* instruction) { + VisitInstruction(instruction); + Primitive::Type result_type = instruction->GetResultType(); + Primitive::Type input_type = instruction->GetInputType(); + // Invariant: We should never generate a conversion to a Boolean value. + if (result_type == Primitive::kPrimBoolean) { + AddError(StringPrintf( + "%s %d converts to a %s (from a %s).", + instruction->DebugName(), + instruction->GetId(), + Primitive::PrettyDescriptor(result_type), + Primitive::PrettyDescriptor(input_type))); + } +} + } // namespace art |