Package soot.jimple.toolkits.scalar
Class DefaultLocalCreation
- java.lang.Object
-
- soot.jimple.toolkits.scalar.LocalCreation
-
- soot.jimple.toolkits.scalar.DefaultLocalCreation
-
public class DefaultLocalCreation extends LocalCreation
provides an easy interface to handle new var-names. New names are automatically added to the chain, and the provided locals are guaranteed to have a unique name.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_PREFIX
if no prefix is given, this one's used-
Fields inherited from class soot.jimple.toolkits.scalar.LocalCreation
localChain, prefix
-
-
Constructor Summary
Constructors Constructor Description DefaultLocalCreation(Collection<Local> locals)
all actions are done on the given locals-chain.DefaultLocalCreation(Collection<Local> locals, String prefix)
whenevernewLocal(type)
will be called, the given prefix is used.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Local
newLocal(String prefix, Type type)
returns a new local with the given prefix and the given type.
the returned local will automatically added to the locals-chain.Local
newLocal(Type type)
returns a new local with the prefix given to the constructor (or the default-prefix if none has been given) and the given type.
The returned local will automatically added to the locals-chain.
The local will be of the form: prefixX (where the last X is a number, so the local name is unique).
-
-
-
Field Detail
-
DEFAULT_PREFIX
public static final String DEFAULT_PREFIX
if no prefix is given, this one's used- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultLocalCreation
public DefaultLocalCreation(Collection<Local> locals)
all actions are done on the given locals-chain. as prefix theDEFAULT-PREFIX
will be used.- Parameters:
locals
- the locals-chain of a Jimple-body
-
DefaultLocalCreation
public DefaultLocalCreation(Collection<Local> locals, String prefix)
whenevernewLocal(type)
will be called, the given prefix is used.- Parameters:
locals
- the locals-chain of a Jimple-bodyprefix
- prefix overrides the DEFAULT-PREFIX
-
-
Method Detail
-
newLocal
public Local newLocal(Type type)
Description copied from class:LocalCreation
returns a new local with the prefix given to the constructor (or the default-prefix if none has been given) and the given type.
The returned local will automatically added to the locals-chain.
The local will be of the form: prefixX (where the last X is a number, so the local name is unique).- Specified by:
newLocal
in classLocalCreation
- Parameters:
type
- the Type of the new local.- Returns:
- a new local with a unique name and the given type.
-
newLocal
public Local newLocal(String prefix, Type type)
Description copied from class:LocalCreation
returns a new local with the given prefix and the given type.
the returned local will automatically added to the locals-chain. The local will be of the form: prefixX (where the last X is a number, so the localname is unique).- Specified by:
newLocal
in classLocalCreation
- Parameters:
prefix
- the prefix for the now local.type
- the Type of the now local.- Returns:
- a local with the given prefix and the given type.
-
-