Package sootup.core.jimple.common.stmt
Class AbstractStmt
java.lang.Object
sootup.core.jimple.common.stmt.AbstractStmt
- All Implemented Interfaces:
EquivTo
,Stmt
,Acceptor<StmtVisitor>
- Direct Known Subclasses:
AbstractDefinitionStmt
,JBreakpointStmt
,JEnterMonitorStmt
,JExitMonitorStmt
,JGotoStmt
,JIfStmt
,JInvokeStmt
,JNopStmt
,JRetStmt
,JReturnStmt
,JReturnVoidStmt
,JSwitchStmt
,JThrowStmt
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionTransforms the statement to anInvokableStmt
if it is possible.boolean
boolean
This method must only be used for Stmts which contain an ArrayRef - possible with JAssignStmts.getDef()
Returns a list of Values defined in this Stmt.int
Returns the amount of unexceptional successors the Stmt needs to have in the StmtGraph.This method must only be used for Stmts which contain an FieldRef - possible with JAssignStmts.getUses()
Returns a list of Values used in this Stmt.Returns a list of Values, either used or defined or both in this Stmt.boolean
Checks if the statement is an invokable statement, this means it either contains an invoke expression or causes a static initializer callwithNewUse
(Value oldUse, Value newUse) Use newUse to replace the oldUse in oldStmt.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface sootup.core.jimple.basic.EquivTo
equivHashCode, equivTo, equivTo
Methods inherited from interface sootup.core.jimple.common.stmt.Stmt
branches, fallsThrough, toString
-
Field Details
-
positionInfo
-
-
Constructor Details
-
AbstractStmt
-
-
Method Details
-
getUses
Returns a list of Values used in this Stmt. Note that they are returned in usual evaluation order. -
getDef
Returns a list of Values defined in this Stmt. There are languages which allow multiple return types/assignments so we return a List -
getUsesAndDefs
Returns a list of Values, either used or defined or both in this Stmt.- Specified by:
getUsesAndDefs
in interfaceStmt
-
getExpectedSuccessorCount
public int getExpectedSuccessorCount()Returns the amount of unexceptional successors the Stmt needs to have in the StmtGraph.- Specified by:
getExpectedSuccessorCount
in interfaceStmt
-
containsArrayRef
public boolean containsArrayRef()- Specified by:
containsArrayRef
in interfaceStmt
-
getArrayRef
This method must only be used for Stmts which contain an ArrayRef - possible with JAssignStmts. check via containsArrayRef().- Specified by:
getArrayRef
in interfaceStmt
-
containsFieldRef
public boolean containsFieldRef()- Specified by:
containsFieldRef
in interfaceStmt
-
getFieldRef
This method must only be used for Stmts which contain an FieldRef - possible with JAssignStmts. check via containsFieldRef().- Specified by:
getFieldRef
in interfaceStmt
-
getPositionInfo
- Specified by:
getPositionInfo
in interfaceStmt
-
withNewUse
Use newUse to replace the oldUse in oldStmt.- Specified by:
withNewUse
in interfaceStmt
- Parameters:
oldUse
- a Value in the useList of oldStmt.newUse
- a Value is to replace oldUse- Returns:
- a new Stmt with newUse or the current Stmt if oldUse was not found/could not be replaced in the Stmt
-
isInvokableStmt
public boolean isInvokableStmt()Checks if the statement is an invokable statement, this means it either contains an invoke expression or causes a static initializer call- Specified by:
isInvokableStmt
in interfaceStmt
- Returns:
- true if the Object is an instance of
InvokableStmt
, otherwise false
-
asInvokableStmt
Transforms the statement to anInvokableStmt
if it is possible. if not it will throw an Exception. Before this method is usedisInvokableStmt()
should be called to prevent exceptions- Specified by:
asInvokableStmt
in interfaceStmt
- Returns:
- the typecast of this to InvokableStmt
-