Class UnusedLocalEliminator

java.lang.Object
sootup.interceptors.UnusedLocalEliminator
All Implemented Interfaces:
BodyInterceptor

public class UnusedLocalEliminator extends Object implements BodyInterceptor
The UnusedLocalEliminator removes any unused locals from the method. TODO: ms: it basically collects all locals and assigns the collection of Locals to the Body... i.e. its use replaces the need of a validator and the manual assignment of the Locals to the body.
Author:
Marcus Nachtigall
  • Constructor Details

    • UnusedLocalEliminator

      public UnusedLocalEliminator()
  • Method Details

    • interceptBody

      public void interceptBody(@Nonnull Body.BodyBuilder builder, @Nonnull View view)
      Collects all used Locals.

      Removes unused local variables from the List of Stmts of the given Body. Complexity is linear with respect to the statements.

      Specified by:
      interceptBody in interface BodyInterceptor
      Parameters:
      builder - the BodyBuilder.