Class NativeCall
- java.lang.Object
-
- it.unive.lisa.program.cfg.statement.Statement
-
- it.unive.lisa.program.cfg.statement.Expression
-
- it.unive.lisa.program.cfg.statement.NaryExpression
-
- it.unive.lisa.program.cfg.statement.call.Call
-
- it.unive.lisa.program.cfg.statement.call.NativeCall
-
- All Implemented Interfaces:
ProgramPoint
,CanRemoveReceiver
,ResolvedCall
,CodeElement
,CodeNode<CFG,Statement,Edge>
,Node<CFG,Statement,Edge>
,java.lang.Comparable<Statement>
public class NativeCall extends Call implements CanRemoveReceiver, ResolvedCall
A call to one or moreNativeCFG
s 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 NativeCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, EvaluationOrder order, java.util.Collection<NativeCFG> targets, Expression... parameters)
Builds the native call, happening at the given location in the program.NativeCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, java.util.Collection<NativeCFG> targets, Expression... parameters)
Builds the native call, happening at the given location in the program.NativeCall(UnresolvedCall source, java.util.Collection<NativeCFG> targets)
Creates a native 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 boolean
equals(java.lang.Object obj)
<A extends AbstractState<A>>
AnalysisState<A>forwardSemanticsAux(InterproceduralAnalysis<A> interprocedural, AnalysisState<A> state, ExpressionSet[] params, StatementStore<A> expressions)
Computes the forward semantics of the expression, after the semantics of all sub-expressions have been computed.java.util.Collection<NativeCFG>
getTargetedConstructs()
Yields theNativeCFG
s that are targeted by this native call.java.util.Collection<CodeMember>
getTargets()
Yields the targets of theCall
.int
hashCode()
TruncatedParamsCall
removeFirstParameter()
Yields an instance ofTruncatedParamsCall
that wraps a copy of the receiver of this call up to the parameters, where the first one has been removed.java.lang.String
toString()
-
Methods inherited from class it.unive.lisa.program.cfg.statement.call.Call
getCallType, getFullTargetName, getParameters, getQualifier, getSource, getTargetName, parameterTypes, setSource
-
Methods inherited from class it.unive.lisa.program.cfg.statement.NaryExpression
accept, backwardSemantics, backwardSemanticsAux, forwardSemantics, getConstructName, getOrder, getStatementEvaluatedAfter, getStatementEvaluatedBefore, getSubExpressions, setOffset
-
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, getOffset, 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
-
NativeCall
public NativeCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, java.util.Collection<NativeCFG> targets, Expression... parameters)
Builds the native call, happening at the given location in the program. TheEvaluationOrder
of the parameter isLeftToRightEvaluation
. The static type of this call is the common supertype of the return types of all targets.- Parameters:
cfg
- the cfg that this expression belongs tolocation
- the location where this 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 qualified name of the static target of this calltargets
- the NativeCFGs that are targeted by this CFG callparameters
- the parameters of this call
-
NativeCall
public NativeCall(CFG cfg, CodeLocation location, Call.CallType callType, java.lang.String qualifier, java.lang.String targetName, EvaluationOrder order, java.util.Collection<NativeCFG> targets, Expression... parameters)
Builds the native call, happening at the given location in the program. The static type of this call is the common supertype of the return types of all targets.- Parameters:
cfg
- the cfg that this expression belongs tolocation
- the location where this 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 qualified name of the static target of this callorder
- the evaluation order of the sub-expressionstargets
- the NativeCFGs that are targeted by this CFG callparameters
- the parameters of this call
-
NativeCall
public NativeCall(UnresolvedCall source, java.util.Collection<NativeCFG> targets)
Creates a native call as the resolved version of the givensource
call, copying all its data.- Parameters:
source
- the unresolved call to copytargets
- theNativeCFG
s that the call has been resolved against
-
-
Method Detail
-
getTargetedConstructs
public java.util.Collection<NativeCFG> getTargetedConstructs()
Yields theNativeCFG
s that are targeted by this native call.- Returns:
- the target
NativeCFG
s
-
getTargets
public java.util.Collection<CodeMember> getTargets()
Description copied from interface:ResolvedCall
Yields the targets of theCall
.- Specified by:
getTargets
in interfaceResolvedCall
- Returns:
- the targets
-
forwardSemanticsAux
public <A extends AbstractState<A>> AnalysisState<A> forwardSemanticsAux(InterproceduralAnalysis<A> interprocedural, AnalysisState<A> state, ExpressionSet[] params, StatementStore<A> expressions) throws SemanticException
Description copied from class:NaryExpression
Computes the forward semantics of the expression, after the semantics of all sub-expressions have been computed. Meta variables from the sub-expressions will be forgotten after this call returns.- Specified by:
forwardSemanticsAux
in classNaryExpression
- Type Parameters:
A
- the type ofAbstractState
- Parameters:
interprocedural
- the interprocedural analysis of the program to analyzestate
- the state where the expression is to be evaluatedparams
- the symbolic expressions representing the computed values of the sub-expressions of this expressionexpressions
- the cache where analysis states of intermediate expressions are stored and that can be accessed to query for post-states of parameters expressions- Returns:
- the
AnalysisState
representing the abstract result of the execution of this expression - Throws:
SemanticException
- if something goes wrong during the computation
-
removeFirstParameter
public TruncatedParamsCall removeFirstParameter()
Description copied from interface:CanRemoveReceiver
Yields an instance ofTruncatedParamsCall
that wraps a copy of the receiver of this call up to the parameters, where the first one has been removed.- Specified by:
removeFirstParameter
in interfaceCanRemoveReceiver
- Returns:
- the call wrapping the copy of this one
-
-