mate_query.cpg.models.core.edge module

Core edge models and functions.

At runtime, the models here are accessed via attributes on a CPG, not directly.

class mate_query.cpg.models.core.edge.BaseEdge

Bases: mate_query.cpg.models.core.base.Base

Node: ClassVar[BaseNode]
cpg: ClassVar[CPG]
kind = Column('kind', Enum('FunctionToEntryBlock', 'BlockToParentFunction', 'BlockToSuccessorBlock', 'BlockToEntryInstruction', 'BlockToTerminatorInstruction', 'InstructionToParentBlock', 'InstructionToSuccessorInstruction', 'ValueDefinitionToUse', 'LoadPointerToValue', 'ValueToStorePointer', 'BlockToControlDependentBlock', 'TerminatorInstructionToControlDependentInstruction', 'FunctionEntryToControlDependentBlock', 'FunctionEntryToControlDependentInstruction', 'ClobberInstructionToValueLoad', 'DefinitionToValueLoad', 'CallToFunction', 'Callgraph', 'Allocates', 'CreatesVar', 'MayAlias', 'MustAlias', 'Subregion', 'Contains', 'PointsTo', 'LoadMemory', 'StoreMemory', 'FunctionToArgument', 'FunctionToLocalVariable', 'CallToParamBinding', 'OperandToParamBinding', 'ParamBindingToArg', 'ReturnInstructionToCallReturn', 'ReturnValueToCallReturn', 'CallReturnToCaller', 'SameCall', 'GlobalToInitializer', 'ModuleToTranslationUnit', 'HasLLVMType', 'HasDWARFType', 'DWARFTypeToBaseType', 'DWARFTypeToMemberType', 'DWARFTypeToRecursiveType', 'DWARFTypeToTemplateParamType', 'DWARFTypeToReturnType', 'DWARFTypeToParamType', 'DWARFTypeToParentType', 'MIBlockToIRBlock', 'MIBlockToASMBlock', 'MIFunctionToIRFunction', 'MIFunctionToDWARFArgument', 'MIFunctionToDWARFLocalVariable', 'MIFunctionToVTable', 'LocalVariableToDWARFLocalVariable', 'ArgumentToDWARFArgument', 'FunctionToPLTStub', 'PLTStubToVTable', 'DataflowSignature', 'DirectDataflowSignature', 'IndirectDataflowSignature', 'ControlDataflowSignature', 'DataflowSignatureForCallSite', 'DataflowSignatureForFunction', name='edgekind'), table=None, nullable=False)
property source: sqlalchemy.sql.schema.Column
property source_node: sqlalchemy.orm.relationships.RelationshipProperty
property target: sqlalchemy.sql.schema.Column
property target_node: sqlalchemy.orm.relationships.RelationshipProperty
class mate_query.cpg.models.core.edge.Edge(uuid: str, kind: EdgeKind, source: str, target: str, attributes: Dict[str, Any] = {})

Bases: mate_query.cpg.models.core.edge.BaseEdge

Parameters
  • uuid (str) –

  • kind (EdgeKind) –

  • source (str) –

  • target (str) –

  • attributes (Dict[str, Any]) –

Node: ClassVar[BaseNode]
cpg: ClassVar[CPG]
mate_query.cpg.models.core.edge.edge_foreign_key_constraints(node_table: Table) Tuple[ForeignKeyConstraint, ...]
Parameters

node_table (Table) –

Return type

Tuple[ForeignKeyConstraint, …]

mate_query.cpg.models.core.edge.edge_kind_column() sqlalchemy.sql.schema.Column
Return type

sqlalchemy.sql.schema.Column

mate_query.cpg.models.core.edge.source_column(_node_uuid_column: Optional[Column] = None) Column
Parameters

_node_uuid_column (Optional[Column]) –

Return type

Column

mate_query.cpg.models.core.edge.target_column(_node_uuid_column: Optional[Column] = None) Column
Parameters

_node_uuid_column (Optional[Column]) –

Return type

Column