abstract class RecoverForXCompilationUnit[CompilationUnitType <: AstNode] extends RecursiveTask[Unit]
Performs type recovery from the root of a compilation unit level
- CompilationUnitType
the AstNode type used to represent a compilation unit of the language.
- Alphabetic
- By Inheritance
- RecoverForXCompilationUnit
- RecursiveTask
- ForkJoinTask
- Serializable
- Future
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new RecoverForXCompilationUnit(cpg: Cpg, cu: CompilationUnitType, builder: DiffGraphBuilder, globalTable: SymbolTable[GlobalKey], addedNodes: Set[(Long, String)])
- cpg
the graph.
- cu
a compilation unit, e.g. file, procedure, type, etc.
- builder
the graph builder
- globalTable
the global symbol table.
- addedNodes
new node tracking set.
Abstract Value Members
- abstract def isConstructor(c: Call): Boolean
A heuristic method to determine if a call is a constructor or not.
A heuristic method to determine if a call is a constructor or not.
- Attributes
- protected
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def assignTypesToCall(x: Call, types: Set[String]): Set[String]
Given a LHS call, will retrieve its symbol to the given types.
Given a LHS call, will retrieve its symbol to the given types.
- Attributes
- protected
- def assignments: Traversal[Assignment]
- Attributes
- protected
- def associateInterproceduralTypes(i: Identifier, fieldFullName: String, fieldName: String, globalTypes: Set[String], baseTypes: Set[String]): Set[String]
- Attributes
- protected
- def associateInterproceduralTypes(i: Identifier, base: Identifier, fi: FieldIdentifier, fieldName: String, baseTypes: Set[String]): Set[String]
Similar to associateTypes but used in the case where there is some kind of field load.
Similar to associateTypes but used in the case where there is some kind of field load.
- Attributes
- protected
- def associateTypes(symbol: LocalVar, fa: FieldAccess, types: Set[String]): Set[String]
Associates the types with the identifier.
Associates the types with the identifier. This may sometimes be an identifier that should be considered a field which this method uses isField(i) to determine.
- Attributes
- protected
- def associateTypes(i: Identifier, types: Set[String]): Set[String]
Associates the types with the identifier.
Associates the types with the identifier. This may sometimes be an identifier that should be considered a field which this method uses isField(i) to determine.
- Attributes
- protected
- def cancel(arg0: Boolean): Boolean
- Definition Classes
- ForkJoinTask → Future
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def compareAndSetForkJoinTaskTag(arg0: Short, arg1: Short): Boolean
- Definition Classes
- ForkJoinTask
- def complete(arg0: Unit): Unit
- Definition Classes
- ForkJoinTask
- def completeExceptionally(arg0: Throwable): Unit
- Definition Classes
- ForkJoinTask
- def compute(): Unit
- Definition Classes
- RecoverForXCompilationUnit → RecursiveTask
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def exec(): Boolean
- Attributes
- protected[concurrent]
- Definition Classes
- RecursiveTask → ForkJoinTask
- final def fork(): ForkJoinTask[Unit]
- Definition Classes
- ForkJoinTask
- final def get(arg0: Long, arg1: TimeUnit): Unit
- Definition Classes
- ForkJoinTask → Future
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @throws(classOf[java.util.concurrent.ExecutionException]) @throws(classOf[java.util.concurrent.TimeoutException])
- final def get(): Unit
- Definition Classes
- ForkJoinTask → Future
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @throws(classOf[java.util.concurrent.ExecutionException])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def getException(): Throwable
- Definition Classes
- ForkJoinTask
- def getFieldBaseType(baseName: String, fieldName: String): Set[String]
- Attributes
- protected
- def getFieldBaseType(base: Identifier, fi: FieldIdentifier): Set[String]
- Attributes
- protected
- def getFieldName(fa: FieldAccess, prefix: String = "", suffix: String = ""): String
Extracts a string representation of the name of the field within this field access.
Extracts a string representation of the name of the field within this field access.
- Attributes
- protected
- def getFieldParents(fa: FieldAccess): Set[String]
Returns the appropriate field parent scope.
Returns the appropriate field parent scope.
- Attributes
- protected
- final def getForkJoinTaskTag(): Short
- Definition Classes
- ForkJoinTask
- def getIndexAccessTypes(ia: Call): Set[String]
Will attempt to retrieve index access types otherwise will return dummy value.
Will attempt to retrieve index access types otherwise will return dummy value.
- Attributes
- protected
- def getLiteralType(l: Literal): Set[String]
Not all frontends populate
typeFullNamefor literals so we allow this to be overridden.Not all frontends populate
typeFullNamefor literals so we allow this to be overridden.- Attributes
- protected
- final def getRawResult(): Unit
- Definition Classes
- RecursiveTask → ForkJoinTask
- def getSymbolFromCall(c: Call): (LocalKey, Set[GlobalKey])
Tries to identify the underlying symbol from the call operation as it is used on the LHS of an assignment.
Tries to identify the underlying symbol from the call operation as it is used on the LHS of an assignment. The second element is a list of any associated global keys if applicable.
- Attributes
- protected
- def getTypesFromCall(c: Call): Set[String]
Given a call operation, will attempt to retrieve types from it.
Given a call operation, will attempt to retrieve types from it.
- Attributes
- protected
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def importNodes(cu: AstNode): Traversal[AstNode]
- returns
the import nodes of this compilation unit.
- Attributes
- protected
- def indexAccessToCollectionVar(c: Call): Option[CollectionVar]
Generates an identifier for collection/index-access operations in the symbol table.
Generates an identifier for collection/index-access operations in the symbol table.
- Attributes
- protected
- final def invoke(): Unit
- Definition Classes
- ForkJoinTask
- final def isCancelled(): Boolean
- Definition Classes
- ForkJoinTask → Future
- final def isCompletedAbnormally(): Boolean
- Definition Classes
- ForkJoinTask
- final def isCompletedNormally(): Boolean
- Definition Classes
- ForkJoinTask
- final def isDone(): Boolean
- Definition Classes
- ForkJoinTask → Future
- def isField(i: Identifier): Boolean
A heuristic method to determine if an identifier may be a field or not.
A heuristic method to determine if an identifier may be a field or not. The result means that it would be stored in the global symbol table. By default this checks if the identifier name matches a member name.
- Attributes
- protected
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def join(): Unit
- Definition Classes
- ForkJoinTask
- val logger: Logger
- Attributes
- protected
- def members: Traversal[Member]
- Attributes
- protected
- def methodReturnValues(methodFullNames: Seq[String]): Set[String]
Will attempt to find the return values of a method if in the CPG, otherwise will give a dummy value.
Will attempt to find the return values of a method if in the CPG, otherwise will give a dummy value.
- Attributes
- protected
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def postVisitImports(): Unit
The initial import setting is over-approximated, so this step checks the CPG for any matches and prunes against these findings.
The initial import setting is over-approximated, so this step checks the CPG for any matches and prunes against these findings. If there are no findings, it will leave the table as is. The latter is significant for external types or methods.
- Attributes
- protected
- def prepopulateSymbolTable(): Unit
Provides an entrypoint to add known symbols and their possible types.
Provides an entrypoint to add known symbols and their possible types.
- Attributes
- protected
- final def quietlyComplete(): Unit
- Definition Classes
- ForkJoinTask
- final def quietlyInvoke(): Unit
- Definition Classes
- ForkJoinTask
- final def quietlyJoin(): Unit
- Definition Classes
- ForkJoinTask
- def reinitialize(): Unit
- Definition Classes
- ForkJoinTask
- def setCallMethodFullNameFromBase(c: Call): Set[String]
Will build a call full path using the call base node.
Will build a call full path using the call base node. This method assumes the base node is in the symbol table.
- Attributes
- protected
- final def setForkJoinTaskTag(arg0: Short): Short
- Definition Classes
- ForkJoinTask
- final def setRawResult(arg0: Unit): Unit
- Attributes
- protected[concurrent]
- Definition Classes
- RecursiveTask → ForkJoinTask
- def setTypeInformation(): Unit
Using an entry from the symbol table, will queue the CPG modification to persist the recovered type information.
Using an entry from the symbol table, will queue the CPG modification to persist the recovered type information.
- Attributes
- protected
- val symbolTable: SymbolTable[LocalKey]
Stores type information for local structures that live within this compilation unit, e.g.
Stores type information for local structures that live within this compilation unit, e.g. local variables.
- Attributes
- protected
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tryUnfork(): Boolean
- Definition Classes
- ForkJoinTask
- def visitAssignments(a: Assignment): Set[String]
Using assignment and import information (in the global symbol table), will propagate these types in the symbol table.
Using assignment and import information (in the global symbol table), will propagate these types in the symbol table.
- a
assignment call pointer.
- Attributes
- protected
- def visitCall(call: Call): Unit
For each call that contains the returnValue directive, attempt to replace the return value by the dynamic
For each call that contains the returnValue directive, attempt to replace the return value by the dynamic
- Attributes
- protected
- def visitCallAssignedToBlock(c: Call, b: Block): Set[String]
Visits a call operation being assigned to the result of some operation.
Visits a call operation being assigned to the result of some operation.
- Attributes
- protected
- def visitCallAssignedToCall(x: Call, y: Call): Set[String]
Visits a call assigned to the return value of a call.
Visits a call assigned to the return value of a call. This is often when there are operators involved.
- Attributes
- protected
- def visitCallAssignedToIdentifier(c: Call, i: Identifier): Set[String]
Visits a call assigned to an identifier.
Visits a call assigned to an identifier. This is often when there are operators involved.
- Attributes
- protected
- def visitCallAssignedToLiteral(c: Call, l: Literal): Set[String]
- Attributes
- protected
- def visitCallAssignedToMethodRef(c: Call, m: MethodRef): Set[String]
Handles a call operation assigned to a method/function pointer.
Handles a call operation assigned to a method/function pointer.
- Attributes
- protected
- def visitIdentifierAssignedToBlock(i: Identifier, b: Block): Set[String]
Visits an identifier being assigned to the result of some operation.
Visits an identifier being assigned to the result of some operation.
- Attributes
- protected
- def visitIdentifierAssignedToCall(i: Identifier, c: Call): Set[String]
Visits an identifier being assigned to a call.
Visits an identifier being assigned to a call. This call could be an operation, function invocation, or constructor invocation.
- Attributes
- protected
- def visitIdentifierAssignedToCallRetVal(i: Identifier, c: Call): Set[String]
Visits an identifier being assigned to a call's return value.
Visits an identifier being assigned to a call's return value.
- Attributes
- protected
- def visitIdentifierAssignedToConstructor(i: Identifier, c: Call): Set[String]
Visits an identifier being assigned to a constructor and attempts to speculate the constructor path.
Visits an identifier being assigned to a constructor and attempts to speculate the constructor path.
- Attributes
- protected
- def visitIdentifierAssignedToFieldLoad(i: Identifier, fa: FieldAccess): Set[String]
Will handle an identifier being assigned to a field value.
Will handle an identifier being assigned to a field value.
- Attributes
- protected
- def visitIdentifierAssignedToIdentifier(x: Identifier, y: Identifier): Set[String]
Visits an identifier being assigned to the value held by another identifier.
Visits an identifier being assigned to the value held by another identifier. This is a weak copy.
- Attributes
- protected
- def visitIdentifierAssignedToIndexAcess(i: Identifier, c: Call): Set[String]
Visits an identifier being assigned to the result of an index access operation.
Visits an identifier being assigned to the result of an index access operation.
- Attributes
- protected
- def visitIdentifierAssignedToLiteral(i: Identifier, l: Literal): Set[String]
Will handle literal value assignments.
Will handle literal value assignments. Override if special handling is required.
- Attributes
- protected
- def visitIdentifierAssignedToMethodRef(i: Identifier, m: MethodRef): Set[String]
Will handle an identifier holding a function pointer.
Will handle an identifier holding a function pointer.
- Attributes
- protected
- def visitIdentifierAssignedToOperator(i: Identifier, c: Call, operation: String): Set[String]
Visits an identifier being assigned to an operator call.
Visits an identifier being assigned to an operator call.
- Attributes
- protected
- def visitIdentifierAssignedToTypeRef(i: Identifier, t: TypeRef): Set[String]
Will handle an identifier holding a type pointer.
Will handle an identifier holding a type pointer.
- Attributes
- protected
- def visitImport(i: Import): Unit
Visits an import and stores references in the symbol table as both an identifier and call.
Visits an import and stores references in the symbol table as both an identifier and call.
- Attributes
- protected
- def visitImport(i: Call): Unit
Refers to the declared import information.
Refers to the declared import information. This is for legacy import notation.
- i
the call that imports entities into this scope.
- Attributes
- protected
- def visitImports(procedureDeclarations: Traversal[AstNode]): Unit
Using import information and internally defined procedures, will generate a mapping between how functions and types are aliased and called and themselves.
Using import information and internally defined procedures, will generate a mapping between how functions and types are aliased and called and themselves.
- procedureDeclarations
imports to types or functions and internally defined methods themselves.
- Attributes
- protected
- def visitParameter(param: MethodParameterIn): Unit
- Attributes
- protected
- def visitStatementsInBlock(b: Block): Set[String]
Process each statement but only assign the type of the last statement to the identifier
Process each statement but only assign the type of the last statement to the identifier
- Attributes
- protected
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated