summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2024-03-07 14:46:40 +0000
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-03-19 13:48:04 +0000
commit799ea81c066e910da7efb1ad06bc7d2dbc966726 (patch)
tree20d0bcd36da21962eac0bd5522014605d9bfeb58 /compiler/optimizing/graph_checker.cc
parentc655cdc973087e8357e6aa388cbb1b0e737b69e6 (diff)
Remove the environment from ArraySets which can't throw
When clearing the NeedsTypeCheck flag in ArraySet instructions, we can remove the environment as it is no longer needed. Also add a check in GraphChecker that instructions have an environment iff they need one. Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I698d9d88bc7c6c8569caf6397cbebf29b34585d5
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index b061b401ff..f2662700c7 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -673,9 +673,15 @@ void GraphChecker::VisitInstruction(HInstruction* instruction) {
}
}
- if (instruction->NeedsEnvironment() && !instruction->HasEnvironment()) {
- AddError(StringPrintf("Instruction %s:%d in block %d requires an environment "
- "but does not have one.",
+ if (instruction->NeedsEnvironment() != instruction->HasEnvironment()) {
+ const char* str;
+ if (instruction->NeedsEnvironment()) {
+ str = "Instruction %s:%d in block %d requires an environment but does not have one.";
+ } else {
+ str = "Instruction %s:%d in block %d doesn't require an environment but it has one.";
+ }
+
+ AddError(StringPrintf(str,
instruction->DebugName(),
instruction->GetId(),
current_block_->GetBlockId()));