| commit | 453b52259e7921c5f4016bc43e8f161fa9bc1c29 | [log] [tgz] |
|---|---|---|
| author | mikaelpeltier <mikaelpeltier@google.com> | Thu Sep 07 13:17:08 2017 +0200 |
| committer | mikaelpeltier <mikaelpeltier@google.com> | Thu Sep 07 13:17:08 2017 +0200 |
| tree | 4159b8c5a26650b766f1822642fc375686f2bdf1 | |
| parent | b50adc9669241bc4a5386828c8ec4064ce8ffd9b [diff] |
Do not remove instruction with debug values - Instead of removing it, replaces it by a nop instruction. Bug: 65434539 Change-Id: I7c5dec22af04dd3ecad0c84d7c9b520697561fd0
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(); } }