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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTransforms the statement to anInvokableStmtif it is possible. if not it will throw an Exception.booleanbooleanThis method must only be used for Stmts which contain an ArrayRef - possible with JAssignStmts.getDef()Returns a list of Values defined in this Stmt.intReturns 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.booleanChecks if the statement is an invokable statement, this means it either contains an invoke expression or causes a static initializer callwithNewUse(@NonNull Value oldUse, @NonNull 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, waitMethods inherited from interface sootup.core.jimple.basic.EquivTo
equivHashCode, equivTo, equivToMethods inherited from interface sootup.core.jimple.common.stmt.Stmt
asJAssignStmt, asJBreakpointStmt, asJEnterMonitorStmt, asJExitMonitorStmt, asJGotoStmt, asJIdentityStmt, asJIfStmt, asJInvokeStmt, asJNopStmt, asJRetStmt, asJReturnStmt, asJReturnVoidStmt, asJSwitchStmt, asJThrowStmt, branches, fallsThrough, isJAssignStmt, isJBreakpointStmt, isJEnterMonitorStmt, isJExitMonitorStmt, isJGotoStmt, isJIdentityStmt, isJIfStmt, isJInvokeStmt, isJNopStmt, isJRetStmt, isJReturnStmt, isJReturnVoidStmt, isJSwitchStmt, isJThrowStmt, toJAssignStmt, toJBreakpointStmt, toJEnterMonitorStmt, toJExitMonitorStmt, toJGotoStmt, toJIdentityStmt, toJIfStmt, toJInvokeStmt, toJNopStmt, toJRetStmt, toJReturnStmt, toJReturnVoidStmt, toJSwitchStmt, toJThrowStmt, 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:
getUsesAndDefsin interfaceStmt
-
getExpectedSuccessorCount
public int getExpectedSuccessorCount()Returns the amount of unexceptional successors the Stmt needs to have in the StmtGraph.- Specified by:
getExpectedSuccessorCountin interfaceStmt
-
containsArrayRef
public boolean containsArrayRef()- Specified by:
containsArrayRefin interfaceStmt
-
getArrayRef
This method must only be used for Stmts which contain an ArrayRef - possible with JAssignStmts. check via containsArrayRef().- Specified by:
getArrayRefin interfaceStmt
-
containsFieldRef
public boolean containsFieldRef()- Specified by:
containsFieldRefin interfaceStmt
-
getFieldRef
This method must only be used for Stmts which contain an FieldRef - possible with JAssignStmts. check via containsFieldRef().- Specified by:
getFieldRefin interfaceStmt
-
getPositionInfo
- Specified by:
getPositionInfoin interfaceStmt
-
withNewUse
Use newUse to replace the oldUse in oldStmt.- Specified by:
withNewUsein 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:
isInvokableStmtin interfaceStmt- Returns:
- true if the Object is an instance of
InvokableStmt, otherwise false
-
asInvokableStmt
Transforms the statement to anInvokableStmtif it is possible. if not it will throw an Exception. Before this method is usedisInvokableStmt()should be called to prevent exceptions- Specified by:
asInvokableStmtin interfaceStmt- Returns:
- the typecast of this to InvokableStmt
-