Package it.unive.lisa.program.cfg
Class NativeCFG
- java.lang.Object
-
- it.unive.lisa.program.cfg.NativeCFG
-
- All Implemented Interfaces:
CodeMember
public class NativeCFG extends java.lang.Object implements CodeMember
A native cfg, representing a cfg that is usually provided by the runtime of the programming language. This types of cfg are not really subjects of the analysis, but they are nevertheless required for obtaining meaningful results.
NativeCFGs do not contain code, but they can be rewritten to aNativeCallproviding their semantics throughrewrite(Statement, Expression...).
Note that this class does not implementObject.equals(Object)norObject.hashCode()since all constructs are unique.
-
-
Constructor Summary
Constructors Constructor Description NativeCFG(CFGDescriptor descriptor, java.lang.Class<? extends NativeCall> construct)Builds the native control flow graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CFGDescriptorgetDescriptor()Yields theCFGDescriptorcontaining the signature of this code member.NativeCallrewrite(Statement original, Expression... params)Produces aNativeCallproviding the semantics of this native cfg.
-
-
-
Constructor Detail
-
NativeCFG
public NativeCFG(CFGDescriptor descriptor, java.lang.Class<? extends NativeCall> construct)
Builds the native control flow graph.- Parameters:
descriptor- the descriptor of this cfgconstruct- the class of theNativeCallthat provides the semantics of this native cfg; the class of the construct must also be a subtype ofPluggableStatement- Throws:
java.lang.IllegalArgumentException- if the class of the construct does not implementPluggableStatement
-
-
Method Detail
-
getDescriptor
public CFGDescriptor getDescriptor()
Description copied from interface:CodeMemberYields theCFGDescriptorcontaining the signature of this code member.- Specified by:
getDescriptorin interfaceCodeMember- Returns:
- the descriptor of this code member
-
rewrite
public NativeCall rewrite(Statement original, Expression... params) throws CallResolutionException
Produces aNativeCallproviding the semantics of this native cfg. Such native call can be used when a call to this native cfg is found within the program to analyze.- Parameters:
original- theStatementthat must be rewritten as a call to this native cfgparams- the parameters of the call to this cfg- Returns:
- a
NativeCallproviding the semantics of this native cfg, that can be used instead of calling this cfg - Throws:
CallResolutionException- if something goes wrong while creating the native call
-
-