Class OpenCall
- java.lang.Object
-
- All Implemented Interfaces:
ProgramPoint
,ResolvedCall
,MetaVariableCreator
,CodeElement
,CodeNode<CFG,Statement,Edge>
,Node<CFG,Statement,Edge>
,java.lang.Comparable<Statement>
public class OpenCall extends CallWithResult
A call to a CFG that is not under analysis.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class it.unive.lisa.program.cfg.statement.call.Call
Call.CallType
-
-
Constructor Summary
Constructors Constructor Description OpenCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, EvaluationOrder order, Expression... parameters)
Builds the open call, happening at the given location in the program.OpenCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, EvaluationOrder order, Type staticType, Expression... parameters)
Builds the open call, happening at the given location in the program.OpenCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, Expression... parameters)
Builds the open call, happening at the given location in the program.OpenCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, Type staticType, Expression... parameters)
Builds the open call, happening at the given location in the program.OpenCall(UnresolvedCall source)
Creates an open call as the resolved version of the givensource
call, copying all its data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
compareCallAux(Call o)
Auxiliary method forStatement.compareTo(Statement)
that can safely assume that the two calls happen at the sameCodeLocation
, are instances of the same class, have the same parameters according to their implementation ofStatement.compareTo(Statement)
, and have all fields defined in theCall
class equal according to theirComparable.compareTo(Object)
.<A extends AbstractState<A>>
AnalysisState<A>compute(AnalysisState<A> entryState, InterproceduralAnalysis<A> interprocedural, StatementStore<A> expressions, ExpressionSet[] parameters)
Computes an analysis state that abstracts the result of this call whenparameters
are used as actual parameters, and the state when the call is executed isentryState
.Identifier
getMetaVariable()
Yields the meta variable that is introduced during the evaluation of the semantics of this object to store information about the value produced by this object.java.util.Collection<CodeMember>
getTargets()
Yields the targets of theCall
.java.lang.String
toString()
-
Methods inherited from class it.unive.lisa.program.cfg.statement.call.CallWithResult
backwardSemanticsAux, forwardSemanticsAux
-
Methods inherited from class it.unive.lisa.program.cfg.statement.call.Call
compareSameClassAndParams, equals, getCallType, getFullTargetName, getParameters, getQualifier, getSource, getTargetName, hashCode, parameterTypes, setSource
-
Methods inherited from class it.unive.lisa.program.cfg.statement.NaryExpression
accept, backwardSemantics, compareSameClass, forwardSemantics, getConstructName, getOrder, getStatementEvaluatedAfter, getStatementEvaluatedBefore, getSubExpressions
-
Methods inherited from class it.unive.lisa.program.cfg.statement.Expression
getMetaVariables, getParentStatement, getRootStatement, getStaticType, setParentStatement
-
Methods inherited from class it.unive.lisa.program.cfg.statement.Statement
compareTo, getCFG, getEvaluationPredecessor, getEvaluationSuccessor, getLocation, stopsExecution, throwsError
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.program.cfg.ProgramPoint
getProgram
-
-
-
-
Constructor Detail
-
OpenCall
public OpenCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, Expression... parameters)
Builds the open call, happening at the given location in the program.- Parameters:
cfg
- the cfg that this expression belongs tolocation
- the location where the expression is defined within the programcallType
- the call type of this callqualifier
- the optional qualifier of the call (can be null or empty - seeCall.getFullTargetName()
for more info)targetName
- the name of the target of this open callparameters
- the parameters of this call
-
OpenCall
public OpenCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, EvaluationOrder order, Expression... parameters)
Builds the open call, happening at the given location in the program.- Parameters:
cfg
- the cfg that this expression belongs tolocation
- the location where the expression is defined within the programcallType
- the call type of this callqualifier
- the optional qualifier of the call (can be null or empty - seeCall.getFullTargetName()
for more info)targetName
- the name of the target of this open callorder
- the evaluation order of the sub-expressionsparameters
- the parameters of this call
-
OpenCall
public OpenCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, Type staticType, Expression... parameters)
Builds the open call, happening at the given location in the program. TheEvaluationOrder
of the parameter isLeftToRightEvaluation
.- Parameters:
cfg
- the cfg that this expression belongs tolocation
- the location where the expression is defined within the programcallType
- the call type of this callqualifier
- the optional qualifier of the call (can be null or empty - seeCall.getFullTargetName()
for more info)targetName
- the name of the target of this open callparameters
- the parameters of this callstaticType
- the static type of this call
-
OpenCall
public OpenCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, EvaluationOrder order, Type staticType, Expression... parameters)
Builds the open call, happening at the given location in the program.- Parameters:
cfg
- the cfg that this expression belongs tolocation
- the location where the expression is defined within the programcallType
- the call type of this callqualifier
- the optional qualifier of the call (can be null or empty - seeCall.getFullTargetName()
for more info)targetName
- the name of the target of this open callorder
- the evaluation order of the sub-expressionsparameters
- the parameters of this callstaticType
- the static type of this call
-
OpenCall
public OpenCall(UnresolvedCall source)
Creates an open call as the resolved version of the givensource
call, copying all its data.- Parameters:
source
- the unresolved call to copy
-
-
Method Detail
-
compareCallAux
protected int compareCallAux(Call o)
Description copied from class:Call
Auxiliary method forStatement.compareTo(Statement)
that can safely assume that the two calls happen at the sameCodeLocation
, are instances of the same class, have the same parameters according to their implementation ofStatement.compareTo(Statement)
, and have all fields defined in theCall
class equal according to theirComparable.compareTo(Object)
. This method is thus responsible for only comparing the implementation-specific fields.- Specified by:
compareCallAux
in classCall
- Parameters:
o
- the other call- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
-
getMetaVariable
public final Identifier getMetaVariable()
Description copied from interface:MetaVariableCreator
Yields the meta variable that is introduced during the evaluation of the semantics of this object to store information about the value produced by this object. Since the meta variable simulates a value pushed on the stack, it should be forgotten after it is consumed.- Returns:
- the meta variable introduced by this object
-
compute
public <A extends AbstractState<A>> AnalysisState<A> compute(AnalysisState<A> entryState, InterproceduralAnalysis<A> interprocedural, StatementStore<A> expressions, ExpressionSet[] parameters) throws SemanticException
Description copied from class:CallWithResult
Computes an analysis state that abstracts the result of this call whenparameters
are used as actual parameters, and the state when the call is executed isentryState
.- Specified by:
compute
in classCallWithResult
- Type Parameters:
A
- the type ofAbstractState
- Parameters:
entryState
- the abstract analysis state when the call is reachedinterprocedural
- the interprocedural analysis of the program to analyzeexpressions
- the cache where analysis states of intermediate expressions must be storedparameters
- the expressions representing the actual parameters of the call- Returns:
- an abstract analysis state representing the abstract result of
the cfg call. The
AnalysisState.getComputedExpressions()
will contain anIdentifier
pointing to the meta variable containing the abstraction of the returned value, if any - Throws:
SemanticException
- if something goes wrong during the computation
-
getTargets
public java.util.Collection<CodeMember> getTargets()
Description copied from interface:ResolvedCall
Yields the targets of theCall
.- Returns:
- the targets
-
-