mate_common.models.cpg_types.mate module

class mate_common.models.cpg_types.mate.EdgeJSON(value)

Bases: enum.Enum

JSON attributes for edges.

EDGE_KIND = 'edge_kind'
OPERAND_NUMBER = 'operand_number'
class mate_common.models.cpg_types.mate.EdgeKind(value)

Bases: enum.Enum

An enumeration.

ALLOCATES = 'Allocates'
ARGUMENT_TO_DWARF_ARGUMENT = 'ArgumentToDWARFArgument'
BLOCK_TO_CONTROL_DEPENDENT_BLOCK = 'BlockToControlDependentBlock'
BLOCK_TO_ENTRY_INSTRUCTION = 'BlockToEntryInstruction'
BLOCK_TO_PARENT_FUNCTION = 'BlockToParentFunction'
BLOCK_TO_SUCCESSOR_BLOCK = 'BlockToSuccessorBlock'
BLOCK_TO_TERMINATOR_INSTRUCTION = 'BlockToTerminatorInstruction'
CALLGRAPH = 'Callgraph'
CALL_RETURN_TO_CALLER = 'CallReturnToCaller'
CALL_TO_FUNCTION = 'CallToFunction'
CALL_TO_PARAM_BINDING = 'CallToParamBinding'
CLOBBER_INSTRUCTION_TO_VALUE_LOAD = 'ClobberInstructionToValueLoad'
CONTAINS = 'Contains'
CONTROL_DATAFLOW_SIGNATURE = 'ControlDataflowSignature'
CREATES_VAR = 'CreatesVar'
DATAFLOW_SIGNATURE = 'DataflowSignature'
DATAFLOW_SIGNATURE_FOR_CALLSITE = 'DataflowSignatureForCallSite'
DATAFLOW_SIGNATURE_FOR_FUNCTION = 'DataflowSignatureForFunction'
DEFINITION_TO_VALUE_LOAD = 'DefinitionToValueLoad'
DIRECT_DATAFLOW_SIGNATURE = 'DirectDataflowSignature'
DWARF_TYPE_TO_BASE_TYPE = 'DWARFTypeToBaseType'
DWARF_TYPE_TO_MEMBER_TYPE = 'DWARFTypeToMemberType'
DWARF_TYPE_TO_PARAM_TYPE = 'DWARFTypeToParamType'
DWARF_TYPE_TO_PARENT_TYPE = 'DWARFTypeToParentType'
DWARF_TYPE_TO_RECURSIVE_TYPE = 'DWARFTypeToRecursiveType'
DWARF_TYPE_TO_RETURN_TYPE = 'DWARFTypeToReturnType'
DWARF_TYPE_TO_TEMPLATE_PARAM_TYPE = 'DWARFTypeToTemplateParamType'
FUNCTION_ENTRY_TO_CONTROL_DEPENDENT_BLOCK = 'FunctionEntryToControlDependentBlock'
FUNCTION_ENTRY_TO_CONTROL_DEPENDENT_INSTRUCTION = 'FunctionEntryToControlDependentInstruction'
FUNCTION_TO_ARGUMENT = 'FunctionToArgument'
FUNCTION_TO_ENTRY_BLOCK = 'FunctionToEntryBlock'
FUNCTION_TO_LOCAL_VARIABLE = 'FunctionToLocalVariable'
FUNCTION_TO_PLT_STUB = 'FunctionToPLTStub'
GLOBAL_TO_INITIALIZER = 'GlobalToInitializer'
HAS_DWARF_TYPE = 'HasDWARFType'
HAS_LLVM_TYPE = 'HasLLVMType'
INDIRECT_DATAFLOW_SIGNATURE = 'IndirectDataflowSignature'
INSTRUCTION_TO_PARENT_BLOCK = 'InstructionToParentBlock'
INSTRUCTION_TO_SUCCESSOR_INSTRUCTION = 'InstructionToSuccessorInstruction'
LOAD_MEMORY = 'LoadMemory'
LOAD_POINTER_TO_VALUE = 'LoadPointerToValue'
LOCAL_VARIABLE_TO_DWARF_LOCAL_VARIABLE = 'LocalVariableToDWARFLocalVariable'
MAY_ALIAS = 'MayAlias'
MI_BLOCK_TO_ASM_BLOCK = 'MIBlockToASMBlock'
MI_BLOCK_TO_IR_BLOCK = 'MIBlockToIRBlock'
MI_FUNCTION_TO_DWARF_ARGUMENT = 'MIFunctionToDWARFArgument'
MI_FUNCTION_TO_DWARF_LOCAL_VARIABLE = 'MIFunctionToDWARFLocalVariable'
MI_FUNCTION_TO_IR_FUNCTION = 'MIFunctionToIRFunction'
MI_FUNCTION_TO_VTABLE = 'MIFunctionToVTable'
MODULE_TO_TRANSLATION_UNIT = 'ModuleToTranslationUnit'
MUST_ALIAS = 'MustAlias'
OPERAND_TO_PARAM_BINDING = 'OperandToParamBinding'
PARAM_BINDING_TO_ARG = 'ParamBindingToArg'
PLT_STUB_TO_VTABLE = 'PLTStubToVTable'
POINTS_TO = 'PointsTo'
RETURN_INSTRUCTION_TO_CALL_RETURN = 'ReturnInstructionToCallReturn'
RETURN_VALUE_TO_CALL_RETURN = 'ReturnValueToCallReturn'
SAME_CALL = 'SameCall'
STORE_MEMORY = 'StoreMemory'
SUBREGION = 'Subregion'
TERMINATOR_INSTRUCTION_TO_CONTROL_DEPENDENT_INSTRUCTION = 'TerminatorInstructionToControlDependentInstruction'
VALUE_DEFINITION_TO_USE = 'ValueDefinitionToUse'
VALUE_TO_STORE_POINTER = 'ValueToStorePointer'
class mate_common.models.cpg_types.mate.Endpoints(sources, targets)

Bases: tuple

Parameters
sources: Set[mate_common.models.cpg_types.mate.NodeKind]

Alias for field number 0

targets: Set[mate_common.models.cpg_types.mate.NodeKind]

Alias for field number 1

class mate_common.models.cpg_types.mate.MATEComponent(value)

Bases: enum.Enum

An enumeration of known node-generating components of MATE.

ASPIRIN = 'Aspirin'
AST_GRAPH_WRITER = 'ASTGraphWriter'
HEADACHE = 'Headache'
SIGNATURE = 'Signature'
WEDLOCK = 'Wedlock'
class mate_common.models.cpg_types.mate.NodeJSON(value)

Bases: enum.Enum

JSON attributes of nodes.

ABI_TYPE_ALIGNMENT = 'abi_type_alignment'
ADDRESS_TAKEN = 'address_taken'
ALIAS_SET_IDENTIFIER = 'alias_set_identifier'
ALIGNMENT = 'alignment'
ALLOCATION_CONTEXT = 'allocation_context'
ALLOCATION_SIZE_BITS = 'allocation_size_bits'
ALLOCATION_SIZE_BYTES = 'allocation_size_bytes'
ALLOCATION_TYPE = 'allocation_type'
ALLOC_SIZE_IN_BITS = 'alloc_size_in_bits'
ARG = 'arg'
ARGUMENT_NUMBER = 'argument_number'
ARG_OP_NUMBER = 'arg_op_number'
ARTIFICIAL = 'artificial'
ASM = 'asm'
CALLEE_CONTEXT = 'callee_context'
CALLER_CONTEXT = 'caller_context'
CAN_FALLTHROUGH = 'can_fallthrough'
CAN_TRAP = 'can_trap'
CLASS_NAME = 'class_name'
CONSTANT_DATA_SUBCLASS = 'constant_data_subclass'
CONSTANT_INT_VALUE = 'constant_int_value'
CONTAINS_UNDEF = 'contains_undef'
CONTEXT = 'context'
DATA_LAYOUT = 'data_layout'
DEALLOCATOR = 'deallocator'
DEFINITION = 'definition'
DEFINITION_LOCATION = 'definition_location'
DEMANGLED_NAME = 'demangled_name'
DWARF_LOCATION = 'dwarf_location'
DWARF_SCOPE = 'dwarf_scope'
DWARF_TYPE = 'dwarf_type'
ENDS_IN_RETURN = 'ends_in_return'
EPILOGUES = 'epilogues'
FILENAME = 'filename'
FLAGS = 'flags'
FRAME_INFO = 'frame_info'
FROM_VARIADIC_TEMPLATE = 'from_variadic_template'
FUNC_OFFSET = 'func_offset'
FUNC_REFERENCE = 'func_reference'
HAS_INITIALIZER = 'has_initializer'
HAS_INLINE_ASM = 'has_inline_asm'
INSTRS = 'instrs'
INTRINSIC = 'intrinsic'
IS_ALL_ONES_VALUE = 'is_all_ones_value'
IS_CONSTANT = 'is_constant'
IS_DECLARATION = 'is_declaration'
IS_DIRECT = 'is_direct'
IS_EPILOGUE_INSERTION_BLOCK = 'is_epilogue_insertion_block'
IS_MANGLED = 'is_mangled'
IS_NAN = 'is_nan'
IS_NORMAL_FP = 'is_normal_fp'
IS_NULL_VALUE = 'is_null_value'
IS_ONE_VALUE = 'is_one_value'
IS_PROLOGUE_INSERTION_BLOCK = 'is_prologue_insertion_block'
IS_ZERO_VALUE = 'is_zero_value'
KIND = 'kind'
LABEL = 'label'
LINKAGE_NAME = 'linkage_name'
LLVM_TYPE = 'llvm_type'
LOCAL_TO_UNIT = 'local_to_unit'
LOCATION = 'location'
MEMBERS = 'members'
MIGHT_BE_NULL = 'might_be_null'
MNEMONIC = 'mnemonic'
MODULE_NAME = 'module_name'
MOD_REF_BEHAVIOR = 'mod_ref_behavior'
NAME = 'name'
NODE_KIND = 'node_kind'
NUMBER = 'number'
OFFSET = 'offset'
OPCODE = 'opcode'
OPERAND = 'operand'
ORIGINAL_NAME = 'original_name'
PARAMETER = 'parameter'
PARAMETER_INDEX = 'parameter_index'
POSITION = 'position'
PREDS = 'preds'
PRETTY_STRING = 'pretty_string'
PRODUCER = 'producer'
PROLOGUES = 'prologues'
RTTI_VA = 'rtti_va'
SECTION = 'section'
SIZE = 'size'
SIZE_IN_BITS = 'size_in_bits'
SOURCE = 'source'
SOURCE_CODE = 'source_code'
SOURCE_FILE = 'source_file'
SOURCE_LANGUAGE = 'source_language'
SOURCE_LOCATION = 'source_location'
SOURCE_SCOPE = 'source_scope'
SSA_NAME = 'ssa_name'
STORE_SIZE_IN_BITS = 'store_size_in_bits'
STRING_VALUE = 'string_value'
SUCCS = 'succs'
SYMBOL = 'symbol'
SYMBOLS = 'symbols'
TAGS = 'tags'
TARGET_TRIPLE = 'target_triple'
TEMPLATE_INDEX = 'template_index'
THREAD_LOCAL = 'thread_local'
TYPE = 'type'
TYPE_ID = 'type_id'
UNPAIRED = 'unpaired'
UNROLLED_DWARF_TYPE = 'unrolled_dwarf_type'
USED_MEMORY = 'used_memory'
USED_REGISTERS = 'used_registers'
VA = 'va'
VARIADIC_INDEX = 'variadic_index'
VA_END = 'va_end'
VA_START = 'va_start'
class mate_common.models.cpg_types.mate.NodeKind(value)

Bases: enum.Enum

Valid values for the node_kind attribute.

These must match the map in ASTGraphWriter.

ALLOCA = 'Alloca'
ARGUMENT = 'Argument'
ARRAY_TYPE = 'ArrayType'
ASM_BLOCK = 'ASMBlock'
ASM_GLOBAL_VARIABLE = 'ASMGlobalVariable'
ASM_INST = 'ASMInst'
BASIC_TYPE = 'BasicType'
BLOCK = 'Block'
CALL = 'Call'
CALL_RETURN = 'CallReturn'
CLASS_TYPE = 'ClassType'
COMPOSITE_CACHED_TYPE = 'CompositeCachedType'
COMPOSITE_TYPE = 'CompositeType'
CONSTANT = 'Constant'
CONSTANT_FP = 'ConstantFP'
CONSTANT_INT = 'ConstantInt'
CONSTANT_STRING = 'ConstantString'
CONSTANT_UNDEF = 'ConstantUndef'
DATAFLOW_SIGNATURE = 'DataflowSignature'
DERIVED_TYPE = 'DerivedType'
DWARF_ARGUMENT = 'DWARFArgument'
DWARF_LOCAL_VARIABLE = 'DWARFLocalVariable'
DWARF_TYPE = 'DWARFType'
ENUM_TYPE = 'EnumType'
FUNCTION = 'Function'
GLOBAL_VARIABLE = 'GlobalVariable'
INPUT_SIGNATURE = 'InputSignature'
INSTRUCTION = 'Instruction'
INVOKE = 'Invoke'
LLVM_TYPE = 'LLVMType'
LOAD = 'Load'
LOCAL_VARIABLE = 'LocalVariable'
MACHINE_BASIC_BLOCK = 'MachineBasicBlock'
MACHINE_FUNCTION = 'MachineFunction'
MACHINE_INSTR = 'MachineInstr'
MEMCPY = 'Memcpy'
MEMORY_LOCATION = 'MemoryLocation'
MEMSET = 'Memset'
MODULE = 'Module'
OUTPUT_SIGNATURE = 'OutputSignature'
PARAM_BINDING = 'ParamBinding'
PLT_STUB = 'PLTStub'
RESUME = 'Resume'
RET = 'Ret'
STORE = 'Store'
STRUCTURE_TYPE = 'StructureType'
SUBROUTINE_TYPE = 'SubroutineType'
TRANSLATION_UNIT = 'TranslationUnit'
UNCLASSIFIED_NODE = 'UnclassifiedNode'
UNION_TYPE = 'UnionType'
VARIABLE = 'Variable'
VTABLE = 'VTable'
class mate_common.models.cpg_types.mate.Relationship(value)

Bases: enum.Enum

An enumeration.

MANY_TO_MANY = 'many-to-many'
MANY_TO_ONE = 'many-to-one'
ONE_TO_MANY = 'one-to-many'
ONE_TO_ONE = 'one-to-one'