Skip to content

Commit

Permalink
Fix build errors from last upstream merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Nov 25, 2023
1 parent 9237618 commit cf4aa22
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 70 deletions.
32 changes: 32 additions & 0 deletions src/main/java/com/android/tools/r8/graph/DexEncodedField.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import com.android.tools.r8.utils.structural.StructuralItem;
import com.android.tools.r8.utils.structural.StructuralMapping;
import com.android.tools.r8.utils.structural.StructuralSpecification;

import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Function;

Expand Down Expand Up @@ -358,6 +360,36 @@ public boolean getOrComputeIsInlinableByJavaC(DexItemFactory dexItemFactory) {
return true;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

DexEncodedField that = (DexEncodedField) o;

if (deprecated != that.deprecated) return false;
if (isInlinableByJavaC != that.isInlinableByJavaC) return false;
if (!Objects.equals(accessFlags, that.accessFlags)) return false;
if (!Objects.equals(staticValue, that.staticValue)) return false;
if (!Objects.equals(genericSignature, that.genericSignature))
return false;
if (!Objects.equals(optimizationInfo, that.optimizationInfo))
return false;
return Objects.equals(kotlinMemberInfo, that.kotlinMemberInfo);
}

@Override
public int hashCode() {
int result = accessFlags != null ? accessFlags.hashCode() : 0;
result = 31 * result + (staticValue != null ? staticValue.hashCode() : 0);
result = 31 * result + (deprecated ? 1 : 0);
result = 31 * result + (genericSignature != null ? genericSignature.hashCode() : 0);
result = 31 * result + (optimizationInfo != null ? optimizationInfo.hashCode() : 0);
result = 31 * result + (kotlinMemberInfo != null ? kotlinMemberInfo.hashCode() : 0);
result = 31 * result + (isInlinableByJavaC ? 1 : 0);
return result;
}

public static class Builder {

private DexField field;
Expand Down
48 changes: 48 additions & 0 deletions src/main/java/com/android/tools/r8/graph/DexEncodedMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Consumer;
Expand Down Expand Up @@ -1341,6 +1342,53 @@ public DexEncodedMethod rewrittenWithLens(
return newMethod;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

DexEncodedMethod that = (DexEncodedMethod) o;

if (deprecated != that.deprecated) return false;
if (obsolete != that.obsolete) return false;
if (!Objects.equals(accessFlags, that.accessFlags)) return false;
if (!Objects.equals(parameterAnnotationsList, that.parameterAnnotationsList))
return false;
if (!Objects.equals(code, that.code)) return false;
if (compilationState != that.compilationState) return false;
if (!Objects.equals(optimizationInfo, that.optimizationInfo))
return false;
if (!Objects.equals(classFileVersion, that.classFileVersion))
return false;
if (!Objects.equals(apiLevelForCode, that.apiLevelForCode))
return false;
if (!Objects.equals(kotlinMemberInfo, that.kotlinMemberInfo))
return false;
if (!Objects.equals(genericSignature, that.genericSignature))
return false;
if (!Objects.equals(isLibraryMethodOverride, that.isLibraryMethodOverride))
return false;
return Objects.equals(parameterInfo, that.parameterInfo);
}

@Override
public int hashCode() {
int result = accessFlags != null ? accessFlags.hashCode() : 0;
result = 31 * result + (deprecated ? 1 : 0);
result = 31 * result + (parameterAnnotationsList != null ? parameterAnnotationsList.hashCode() : 0);
result = 31 * result + (code != null ? code.hashCode() : 0);
result = 31 * result + (compilationState != null ? compilationState.hashCode() : 0);
result = 31 * result + (optimizationInfo != null ? optimizationInfo.hashCode() : 0);
result = 31 * result + (classFileVersion != null ? classFileVersion.hashCode() : 0);
result = 31 * result + (apiLevelForCode != null ? apiLevelForCode.hashCode() : 0);
result = 31 * result + (kotlinMemberInfo != null ? kotlinMemberInfo.hashCode() : 0);
result = 31 * result + (genericSignature != null ? genericSignature.hashCode() : 0);
result = 31 * result + (isLibraryMethodOverride != null ? isLibraryMethodOverride.hashCode() : 0);
result = 31 * result + (parameterInfo != null ? parameterInfo.hashCode() : 0);
result = 31 * result + (obsolete ? 1 : 0);
return result;
}

public static Builder syntheticBuilder() {
return new Builder(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ public DexProgramClass programDefinitionFor(DexType type) {
return programOrClasspathClass == null ? null : programOrClasspathClass.asProgramClass();
}

@Override
public DexLibraryClass libraryDefinitionFor(DexType type) {
return libraryClasses.get(type);
}

@Override
public Builder builder() {
return new Builder(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public TrivialCatchBlockMerger(AppView<?> appView) {
}

@Override
protected String getTimingId() {
protected String getRewriterId() {
return "DuplicateCatchBlockMerger";
}

Expand Down
Loading

0 comments on commit cf4aa22

Please sign in to comment.