Relax signatures from AppInfoWithLiveness to AppInfoWithClassHierarchy
Change-Id: Ic7b22e4bae093bdab87462ccad190d5636163b3f
diff --git a/src/main/java/com/android/tools/r8/graph/DexType.java b/src/main/java/com/android/tools/r8/graph/DexType.java
index b3ab15a..1bdd42a 100644
--- a/src/main/java/com/android/tools/r8/graph/DexType.java
+++ b/src/main/java/com/android/tools/r8/graph/DexType.java
@@ -81,7 +81,7 @@
}
public DynamicTypeWithUpperBound toDynamicType(
- AppView<AppInfoWithLiveness> appView, Nullability nullability) {
+ AppView<? extends AppInfoWithClassHierarchy> appView, Nullability nullability) {
return DynamicType.create(appView, toTypeElement(appView, nullability));
}
diff --git a/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicType.java b/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicType.java
index fd17fa4..f3d73dd 100644
--- a/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicType.java
+++ b/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicType.java
@@ -4,6 +4,7 @@
package com.android.tools.r8.ir.analysis.type;
+import com.android.tools.r8.graph.AppInfoWithClassHierarchy;
import com.android.tools.r8.graph.AppView;
import com.android.tools.r8.graph.DexClass;
import com.android.tools.r8.graph.DexType;
@@ -22,7 +23,7 @@
public abstract class DynamicType {
public static DynamicTypeWithUpperBound create(
- AppView<AppInfoWithLiveness> appView, TypeElement dynamicUpperBoundType) {
+ AppView<? extends AppInfoWithClassHierarchy> appView, TypeElement dynamicUpperBoundType) {
ClassTypeElement dynamicLowerBoundType = null;
if (dynamicUpperBoundType.isClassType()) {
ClassTypeElement dynamicUpperBoundClassType = dynamicUpperBoundType.asClassType();
@@ -36,7 +37,7 @@
}
public static DynamicTypeWithUpperBound create(
- AppView<AppInfoWithLiveness> appView,
+ AppView<? extends AppInfoWithClassHierarchy> appView,
TypeElement dynamicUpperBoundType,
ClassTypeElement dynamicLowerBoundType) {
if (dynamicUpperBoundType.isBottom()) {
@@ -66,7 +67,7 @@
}
public static DynamicTypeWithUpperBound create(
- AppView<AppInfoWithLiveness> appView, Value value) {
+ AppView<? extends AppInfoWithClassHierarchy> appView, Value value) {
assert value.getType().isReferenceType();
TypeElement dynamicUpperBoundType = value.getDynamicUpperBoundType(appView);
ClassTypeElement dynamicLowerBoundType =
@@ -212,7 +213,7 @@
public abstract int hashCode();
private static boolean verifyNotEffectivelyFinalClassType(
- AppView<AppInfoWithLiveness> appView, TypeElement type) {
+ AppView<? extends AppInfoWithClassHierarchy> appView, TypeElement type) {
if (type.isClassType()) {
ClassTypeElement classType = type.asClassType();
DexClass clazz = appView.definitionFor(classType.getClassType());
diff --git a/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicTypeWithLowerBound.java b/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicTypeWithLowerBound.java
index 19d4965..2ee12b5 100644
--- a/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicTypeWithLowerBound.java
+++ b/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicTypeWithLowerBound.java
@@ -4,8 +4,8 @@
package com.android.tools.r8.ir.analysis.type;
+import com.android.tools.r8.graph.AppInfoWithClassHierarchy;
import com.android.tools.r8.graph.AppView;
-import com.android.tools.r8.shaking.AppInfoWithLiveness;
import java.util.Objects;
public class DynamicTypeWithLowerBound extends DynamicTypeWithUpperBound {
@@ -21,7 +21,7 @@
}
static DynamicTypeWithLowerBound create(
- AppView<AppInfoWithLiveness> appView,
+ AppView<? extends AppInfoWithClassHierarchy> appView,
ClassTypeElement dynamicUpperBoundType,
ClassTypeElement dynamicLowerBoundType) {
assert dynamicUpperBoundType != null;
diff --git a/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicTypeWithUpperBound.java b/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicTypeWithUpperBound.java
index 2c9fc11..aed734c 100644
--- a/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicTypeWithUpperBound.java
+++ b/src/main/java/com/android/tools/r8/ir/analysis/type/DynamicTypeWithUpperBound.java
@@ -4,6 +4,7 @@
package com.android.tools.r8.ir.analysis.type;
+import com.android.tools.r8.graph.AppInfoWithClassHierarchy;
import com.android.tools.r8.graph.AppView;
import com.android.tools.r8.graph.DexClass;
import com.android.tools.r8.graph.DexType;
@@ -37,7 +38,7 @@
}
public static DynamicTypeWithUpperBound create(
- AppView<AppInfoWithLiveness> appView, TypeElement dynamicUpperBoundType) {
+ AppView<? extends AppInfoWithClassHierarchy> appView, TypeElement dynamicUpperBoundType) {
ClassTypeElement dynamicLowerBoundType =
isEffectivelyFinal(appView, dynamicUpperBoundType)
? dynamicUpperBoundType.asClassType()
@@ -46,7 +47,7 @@
}
public static DynamicTypeWithUpperBound create(
- AppView<AppInfoWithLiveness> appView,
+ AppView<? extends AppInfoWithClassHierarchy> appView,
TypeElement dynamicUpperBoundType,
ClassTypeElement dynamicLowerBoundType) {
if (dynamicUpperBoundType.isBottom()) {
@@ -72,7 +73,7 @@
}
public static DynamicTypeWithUpperBound create(
- AppView<AppInfoWithLiveness> appView, Value value) {
+ AppView<? extends AppInfoWithClassHierarchy> appView, Value value) {
assert value.getType().isReferenceType();
TypeElement dynamicUpperBoundType = value.getDynamicUpperBoundType(appView);
ClassTypeElement dynamicLowerBoundType =
@@ -285,7 +286,7 @@
}
private static boolean verifyNotEffectivelyFinalClassType(
- AppView<AppInfoWithLiveness> appView, TypeElement type) {
+ AppView<? extends AppInfoWithClassHierarchy> appView, TypeElement type) {
if (type.isClassType()) {
ClassTypeElement classType = type.asClassType();
DexClass clazz = appView.definitionFor(classType.getClassType());
diff --git a/src/main/java/com/android/tools/r8/ir/code/Value.java b/src/main/java/com/android/tools/r8/ir/code/Value.java
index 409c9ca..fbccb7c 100644
--- a/src/main/java/com/android/tools/r8/ir/code/Value.java
+++ b/src/main/java/com/android/tools/r8/ir/code/Value.java
@@ -1160,7 +1160,7 @@
}
public ClassTypeElement getDynamicLowerBoundType(
- AppView<AppInfoWithLiveness> appView,
+ AppView<? extends AppInfoWithClassHierarchy> appView,
TypeElement dynamicUpperBoundType,
Nullability maxNullability) {
// If the dynamic upper bound type is a final or effectively-final class type, then we know the
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/AssumeInserter.java b/src/main/java/com/android/tools/r8/ir/optimize/AssumeInserter.java
index a08f82d..fc63ec3 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/AssumeInserter.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/AssumeInserter.java
@@ -6,6 +6,7 @@
import static com.android.tools.r8.ir.analysis.type.Nullability.definitelyNotNull;
import static com.google.common.base.Predicates.alwaysTrue;
+import com.android.tools.r8.graph.AppInfoWithClassHierarchy;
import com.android.tools.r8.graph.AppView;
import com.android.tools.r8.graph.DexClassAndField;
import com.android.tools.r8.graph.DexClassAndMethod;
@@ -37,7 +38,6 @@
import com.android.tools.r8.ir.optimize.info.MethodOptimizationInfo;
import com.android.tools.r8.ir.optimize.membervaluepropagation.assume.AssumeInfo;
import com.android.tools.r8.ir.optimize.membervaluepropagation.assume.AssumeInfoLookup;
-import com.android.tools.r8.shaking.AppInfoWithLiveness;
import com.android.tools.r8.utils.Timing;
import com.android.tools.r8.utils.TriFunction;
import com.android.tools.r8.utils.TriPredicate;
@@ -60,14 +60,15 @@
public class AssumeInserter {
- private final AppView<AppInfoWithLiveness> appView;
+ private final AppView<? extends AppInfoWithClassHierarchy> appView;
private final boolean keepRedundantBlocks;
- public AssumeInserter(AppView<AppInfoWithLiveness> appView) {
+ public AssumeInserter(AppView<? extends AppInfoWithClassHierarchy> appView) {
this(appView, false);
}
- public AssumeInserter(AppView<AppInfoWithLiveness> appView, boolean keepRedundantBlocks) {
+ public AssumeInserter(
+ AppView<? extends AppInfoWithClassHierarchy> appView, boolean keepRedundantBlocks) {
this.appView = appView;
this.keepRedundantBlocks = keepRedundantBlocks;
}
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/membervaluepropagation/assume/AssumeInfoLookup.java b/src/main/java/com/android/tools/r8/ir/optimize/membervaluepropagation/assume/AssumeInfoLookup.java
index 223fa00..b515031 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/membervaluepropagation/assume/AssumeInfoLookup.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/membervaluepropagation/assume/AssumeInfoLookup.java
@@ -4,16 +4,16 @@
package com.android.tools.r8.ir.optimize.membervaluepropagation.assume;
+import com.android.tools.r8.graph.AppInfoWithClassHierarchy;
import com.android.tools.r8.graph.AppView;
import com.android.tools.r8.graph.DexClassAndMethod;
import com.android.tools.r8.graph.MethodResolutionResult.SingleResolutionResult;
-import com.android.tools.r8.shaking.AppInfoWithLiveness;
import com.android.tools.r8.shaking.AssumeInfoCollection;
public class AssumeInfoLookup {
public static AssumeInfo lookupAssumeInfo(
- AppView<AppInfoWithLiveness> appView,
+ AppView<? extends AppInfoWithClassHierarchy> appView,
SingleResolutionResult<?> resolutionResult,
DexClassAndMethod singleTarget) {
AssumeInfoCollection assumeInfoCollection = appView.getAssumeInfoCollection();