Package pascal.taie.ir
Class IRBuildHelper
java.lang.Object
pascal.taie.ir.IRBuildHelper
Helper for building IR for a method from scratch.
Given a
JMethod
, this helper automatically creates this
variable (for instance method), parameters, and return variable (if method
return type is not void
) for the method.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionBuilds an IR with givenStmt
s.Builds an emtpy IR which contains only aReturn
statement.getParam
(int i) newTempVar
(Type type)
-
Constructor Details
-
IRBuildHelper
-
-
Method Details
-
getThisVar
- Returns:
this
variable of the IR being built.- Throws:
AssertionError
- if the method is not an instance method.
-
getParam
-
getReturnVar
- Returns:
- the return variable of the IR being built.
-
newTempVar
- Returns:
- a new temporary variable of given type.
-
newReturn
- Returns:
- a new return statement of the IR being built.
-
buildEmpty
Builds an emtpy IR which contains only aReturn
statement. -
build
Builds an IR with givenStmt
s. This method sets the indexes of givenStmt
s, so client code does not need to set the indexes.- Parameters:
stmts
- statements of the IR being built.
-