Package sootup.interceptors
Class UnusedLocalEliminator
java.lang.Object
sootup.interceptors.UnusedLocalEliminator
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
interceptBody
(Body.BodyBuilder builder, View view) Collects all used Locals.
-
Constructor Details
-
UnusedLocalEliminator
public UnusedLocalEliminator()
-
-
Method Details
-
interceptBody
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 interfaceBodyInterceptor
- Parameters:
builder
- the BodyBuilder.
-