Enable OvershadowingSubclassFields checker

- Overshadowing fields of superclass can causes confusion and errors
and is probably a good thing to avoid it.

Change-Id: If73e4694ba57bf048495650b047f1943c9a5e3b1
diff --git a/build.gradle b/build.gradle
index e50073d..6dadb5c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -18,7 +18,8 @@
     '-Xep:ClassCanBeStatic:WARN',
     '-Xep:OperatorPrecedence:WARN',
     '-Xep:RemoveUnusedImports:WARN',
-    '-Xep:MissingOverride:WARN']
+    '-Xep:MissingOverride:WARN',
+    '-Xep:OvershadowingSubclassFields:WARN']
 
 apply from: 'copyAdditionalJctfCommonFiles.gradle'
 
diff --git a/src/main/java/com/android/tools/r8/ir/optimize/Outliner.java b/src/main/java/com/android/tools/r8/ir/optimize/Outliner.java
index 9385f11..74afdcd 100644
--- a/src/main/java/com/android/tools/r8/ir/optimize/Outliner.java
+++ b/src/main/java/com/android/tools/r8/ir/optimize/Outliner.java
@@ -685,7 +685,6 @@
     private final ListIterator<BasicBlock> blocksIterator;
     private final List<Integer> toRemove;
     int argumentsMapIndex;
-    Value returnValue;
 
     OutlineRewriter(
         DexEncodedMethod method, IRCode code,
@@ -702,7 +701,7 @@
         DexMethod m = generatedOutlines.get(outline);
         assert m != null;
         List<Value> in = new ArrayList<>();
-        returnValue = null;
+        Value returnValue = null;
         argumentsMapIndex = 0;
         Position position = Position.none();
         { // Scope for 'instructions'.
diff --git a/src/main/java/com/android/tools/r8/shaking/protolite/ProtoLitePruner.java b/src/main/java/com/android/tools/r8/shaking/protolite/ProtoLitePruner.java
index 7773e11..ced15f5 100644
--- a/src/main/java/com/android/tools/r8/shaking/protolite/ProtoLitePruner.java
+++ b/src/main/java/com/android/tools/r8/shaking/protolite/ProtoLitePruner.java
@@ -53,8 +53,6 @@
  */
 public class ProtoLitePruner extends ProtoLiteBase {
 
-  private final AppInfoWithLiveness appInfo;
-
   private final DexType visitorType;
 
   private final DexType methodEnumType;
@@ -77,7 +75,6 @@
 
   public ProtoLitePruner(AppInfoWithLiveness appInfo) {
     super(appInfo);
-    this.appInfo = appInfo;
     DexItemFactory factory = appInfo.dexItemFactory;
     this.visitorType = factory.createType("Lcom/google/protobuf/GeneratedMessageLite$Visitor;");
     this.methodEnumType = factory
@@ -318,7 +315,7 @@
       throw new CompilationError("dynamicMethod in protoLite without switch.");
     }
     Switch switchInstr = matchingInstr.asSwitch();
-    EnumSwitchInfo info = SwitchUtils.analyzeSwitchOverEnum(switchInstr, appInfo);
+    EnumSwitchInfo info = SwitchUtils.analyzeSwitchOverEnum(switchInstr, appInfo.withLiveness());
     if (info == null || info.enumClass != methodEnumType) {
       throw new CompilationError("Malformed switch in dynamicMethod of proto lite.");
     }
@@ -471,7 +468,7 @@
               // We have to rewrite these as a precaution, as they might be dead due to
               // tree shaking ignoring them.
               DexField field = getterToField(invokedMethod, 5);
-              if (appInfo.liveFields.contains(field)) {
+              if (appInfo.withLiveness().liveFields.contains(field)) {
                 // Effectively inline the code that is normally inside these methods.
                 Value thisReference = invokeMethod.getReceiver();
                 Value newResult = code.createValue(MoveType.SINGLE);
@@ -658,7 +655,7 @@
   }
 
   private boolean isDeadProtoField(DexField field) {
-    return isProtoField(field) && !appInfo.liveFields.contains(field);
+    return isProtoField(field) && !appInfo.withLiveness().liveFields.contains(field);
   }
 
   private boolean isDeadProtoGetter(DexMethod method) {