commit | 187f9b454c971163cd6e3eed566a3e650b4b7cc0 | [log] [tgz] |
---|---|---|
author | Ian Zerny <zerny@google.com> | Thu Sep 07 12:13:47 2017 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Thu Sep 07 12:13:47 2017 +0000 |
tree | dcd87f0c079b87cb2b29eafb232d7674e83693ef | |
parent | 453b52259e7921c5f4016bc43e8f161fa9bc1c29 [diff] | |
parent | 69c75dcc486a7672dc6b14af7ecab3862c548b36 [diff] |
Merge "Don't collapse goto-return if the return is affected by a debug position."
diff --git a/src/main/java/com/android/tools/r8/ir/code/Instruction.java b/src/main/java/com/android/tools/r8/ir/code/Instruction.java index de198c9..466a455 100644 --- a/src/main/java/com/android/tools/r8/ir/code/Instruction.java +++ b/src/main/java/com/android/tools/r8/ir/code/Instruction.java
@@ -142,6 +142,9 @@ public void clearDebugValues() { if (debugValues != null) { + for (Value debugValue : debugValues) { + debugValue.removeDebugUser(this); + } debugValues.clear(); } }
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/DeadCodeRemover.java b/src/main/java/com/android/tools/r8/ir/optimize/DeadCodeRemover.java index 50f224c..ebf69b5 100644 --- a/src/main/java/com/android/tools/r8/ir/optimize/DeadCodeRemover.java +++ b/src/main/java/com/android/tools/r8/ir/optimize/DeadCodeRemover.java
@@ -120,7 +120,7 @@ // All users will be removed for this instruction. Eagerly clear them so further inspection // of this instruction during dead code elimination will terminate here. outValue.clearUsers(); - iterator.remove(); + iterator.removeOrReplaceByNop(); } }