Remove as- and isDexReference utility methods
These are not used and can be easily confused with toReference.
Change-Id: I1cc7fc6f768177c7fb2548d47e5a3a9e4bd2e79a
diff --git a/src/main/java/com/android/tools/r8/graph/DexDefinition.java b/src/main/java/com/android/tools/r8/graph/DexDefinition.java
index 9127b94..82dfc12 100644
--- a/src/main/java/com/android/tools/r8/graph/DexDefinition.java
+++ b/src/main/java/com/android/tools/r8/graph/DexDefinition.java
@@ -12,16 +12,6 @@
*/
public abstract class DexDefinition extends DexItem {
- @Override
- public boolean isDexDefinition() {
- return true;
- }
-
- @Override
- public DexDefinition asDexDefinition() {
- return this;
- }
-
public boolean isDexClass() {
return false;
}
diff --git a/src/main/java/com/android/tools/r8/graph/DexItem.java b/src/main/java/com/android/tools/r8/graph/DexItem.java
index 8aa09b6..eb8e150 100644
--- a/src/main/java/com/android/tools/r8/graph/DexItem.java
+++ b/src/main/java/com/android/tools/r8/graph/DexItem.java
@@ -64,22 +64,6 @@
return toString();
}
- public boolean isDexReference() {
- return false;
- }
-
- public DexReference asDexReference() {
- return null;
- }
-
- public boolean isDexDefinition() {
- return false;
- }
-
- public DexDefinition asDexDefinition() {
- return null;
- }
-
static <T extends DexItem> Stream<T> filter(Stream<DexItem> stream, Class<T> clazz) {
return stream.filter(clazz::isInstance).map(clazz::cast);
}
diff --git a/src/main/java/com/android/tools/r8/graph/DexReference.java b/src/main/java/com/android/tools/r8/graph/DexReference.java
index af7dc20..d51810e 100644
--- a/src/main/java/com/android/tools/r8/graph/DexReference.java
+++ b/src/main/java/com/android/tools/r8/graph/DexReference.java
@@ -13,16 +13,6 @@
*/
public abstract class DexReference extends IndexedDexItem {
- @Override
- public boolean isDexReference() {
- return true;
- }
-
- @Override
- public DexReference asDexReference() {
- return this;
- }
-
public boolean isDexType() {
return false;
}
diff --git a/src/main/java/com/android/tools/r8/ir/code/InvokeStatic.java b/src/main/java/com/android/tools/r8/ir/code/InvokeStatic.java
index c8f8b49..5d782c3 100644
--- a/src/main/java/com/android/tools/r8/ir/code/InvokeStatic.java
+++ b/src/main/java/com/android/tools/r8/ir/code/InvokeStatic.java
@@ -32,7 +32,7 @@
public InvokeStatic(DexMethod target, Value result, List<Value> arguments) {
this(target, result, arguments, false);
- assert target.asDexReference().asDexMethod().proto.parameters.size() == arguments.size();
+ assert target.proto.parameters.size() == arguments.size();
}
public InvokeStatic(DexMethod target, Value result, List<Value> arguments, boolean itf) {