ScEpTIC.llvmir_parser package
Subpackages
- ScEpTIC.llvmir_parser.instructions_parser package
- Submodules
- ScEpTIC.llvmir_parser.instructions_parser.aggregate_operations module
- ScEpTIC.llvmir_parser.instructions_parser.binary_operations module
- ScEpTIC.llvmir_parser.instructions_parser.conversion_operations module
- ScEpTIC.llvmir_parser.instructions_parser.memory_operations module
- ScEpTIC.llvmir_parser.instructions_parser.other_operations module
is_call_instruction()is_other_operation()is_valid_cond()parse_call_instruction()parse_calling_convention()parse_cmp_operation()parse_cond_type_operands()parse_other_operation()parse_phi_operation()parse_return_parameter_attr()parse_select_operation()parse_tail_specific_attr()parse_va_arg_instruction()
- ScEpTIC.llvmir_parser.instructions_parser.terminator_instructions module
is_branch_instruction()is_conditional_branch_instruction()is_ret_instruction()is_switch_instruction()is_terminator_instruction()is_unconditional_branch_instruction()is_unreachable_instruction()parse_branch_instruction()parse_conditional_branch_instruction()parse_ret_instruction()parse_switch_instruction()parse_terminator_instruction()parse_unconditional_branch_instruction()parse_unreachable_instruction()
- ScEpTIC.llvmir_parser.instructions_parser.vector_operations module
- Module contents
- ScEpTIC.llvmir_parser.sections_parser package
- Submodules
- ScEpTIC.llvmir_parser.sections_parser.attributes_groups module
- ScEpTIC.llvmir_parser.sections_parser.custom_types module
- ScEpTIC.llvmir_parser.sections_parser.function module
extract_type_and_attributes()get_function_attributes_group()handle_llvm_dbg()is_function_declaration()is_function_definition()is_label()is_llvm_dbg()parse_function_arguments()parse_function_body()parse_function_declaration()parse_function_declarations_section()parse_function_definition()parse_function_definition_section()parse_label()parse_return_type()
- ScEpTIC.llvmir_parser.sections_parser.global_vars module
is_global_var_def()is_valid_initial_val()parse_align_attribute()parse_array_def()parse_array_initial_val()parse_base_type()parse_comdat_attribute()parse_global_var()parse_global_vars_section()parse_main_attributes()parse_section_attribute()parse_struct_initial_val()parse_type()parse_type_and_initial_val()
- ScEpTIC.llvmir_parser.sections_parser.headers module
- ScEpTIC.llvmir_parser.sections_parser.metadata module
- Module contents
Submodules
ScEpTIC.llvmir_parser.sections_divider module
- ScEpTIC.llvmir_parser.sections_divider.divide_into_sections(text, force_extraction=False)
Divides code into sections
- Document structure (in order):
Headers (source file name, target datalayout, target triple)
Custom Types (Struct and Union) Definitions
Global Variables Definitions
Function Definitions
Function’s Attributes Definitions
Debug Informations
- ScEpTIC.llvmir_parser.sections_divider.extract_function_body(text)
Extracts and returns the function body. Returns also the number of the latest parsed line.
- ScEpTIC.llvmir_parser.sections_divider.function_def_elements_extractor(text)
Extract the function_definition section (both definition and body). Acts like simple_elements_extractor, but only extracts function defs.
- ScEpTIC.llvmir_parser.sections_divider.get_elements_lines(text, verification_function)
Returns the line number of the elements on which verification_function returns true.
- ScEpTIC.llvmir_parser.sections_divider.remove_lines(text, lines)
Removes lines that have already been parsed.
- ScEpTIC.llvmir_parser.sections_divider.simple_elements_extractor(text, verification_function)
Extract the section composed by simple elements of the same type. An element is simple if its contained inside a single line of code. The type of the elements is given by the verification_function. It returns als the lines that have not been parsed.
ScEpTIC.llvmir_parser.token_generator module
- ScEpTIC.llvmir_parser.token_generator.collapse_switch_statement(text)
Properly treats the switch statement. Is is over multiple lines, so it collapses them into a single one. To recognise the paramenters on the new line, SWITCH_NEW_LINE_MARKER is used.
- ScEpTIC.llvmir_parser.token_generator.get_symbols_from_file(file)
Returns a list of lines. Each line is represented as a list of different recognizable tokens
- ScEpTIC.llvmir_parser.token_generator.get_symbols_from_line(line)
Return a list of symbols
- ScEpTIC.llvmir_parser.token_generator.remove_comment_from_line(line)
Removes comments from a line
- ScEpTIC.llvmir_parser.token_generator.remove_unrelevant_spaces(line)
Removes all unrelevant spaces from the line.
Module contents
- ScEpTIC.llvmir_parser.parse_file(file, set_logging_level=None, log_section_content=False)
Parses a .ll file and returns the AST