Module fct

Declares methods that can be invoked on a function (instance of the 'fct' class)

Functions

fct:analyze_groups () Run grouping analysis on a function
fct:analyze_groups_extend (mode) Run extended grouping analysis on a function
fct:blocks () Iterates over blocks of a function
fct:get_CC () Returns the connected components (CC) of a function
fct:get_CFG_file_path () Prints the control flow graph (CFG) of a function to a DOT file
fct:get_DDG () Returns the DDG (Data Dependency Graph) of a function
fct:get_DDG_file_path () Prints the data dependency graph (DDG) of a function to a DOT file (paths are merged) For each path of the function, prints the corresponding DDG to a DOT file
fct:get_RecMII () Returns the RecMII of a function RecMII is minimum initiation interval due to inter-iterations data dependencies
fct:get_asmfile () Returns the asmfile containing a function
fct:get_compiler_short () Returns the short compiler name used to compile a function
fct:get_compiler_version () Returns the version of the compiler used to compile a function
fct:get_decl_line () Returns the source line where the function was declared
fct:get_demname () Returns the demangled name of a function if available
fct:get_dir () Returns the directory where the file was located
fct:get_entriesb () Gets function entry blocks
fct:get_entriesi () Gets function entry instructions
fct:get_entry () Returns the first (entry) block of a function
fct:get_exitsb () Gets function exit blocks
fct:get_exitsi () Gets function exit instructions
fct:get_first_block () Alias to fct:get_entry
fct:get_first_insn () Returns the first instruction of a function
fct:get_id () Returns the global MAQAO identifier (ID) of a function
fct:get_language () Returns the language used to write a function
fct:get_nCCs () Return the number of connected components
fct:get_name () Returns the name of a function
fct:get_nb_cc () Returns the number of connected components (CC) of a function
fct:get_nblocks () Returns the number of blocks in a function (excluding virtual blocks, not exposed in LUA structures)
fct:get_ninsns () Returns the number of instructions in a function
fct:get_nloops () Returns the number of loops in a function
fct:get_original_function () Returns the original function (if CC of a real function)
fct:get_parameters () Returns the functions parameters from debug data into table Parameters are sub-tables with the following structure
  • name : Name of the parameter
  • type : type of the parameter
  • location:
    • reg: name of the register if the parameter is in a register
    • address: memory address of the parameter if it is in memory
    • offset: offset in the stack of the parameter
    • -> note: only filled fields are defined
fct:get_predecessors () Returns a table of predecessor (callers) functions (in the CG) Warning: Each predecessor function will be referenced as many times as it is source of an edge to 'function'
fct:get_producer () Returns the producer string located in debug data
fct:get_project () Returns the project containing a function
fct:get_ranges () Returns function ranges (a range is a set of consecutive instructions)
fct:get_return_var () Returns the returned variable of a function from debug data
fct:get_src_file_name () Returns the name of the source file containing a function
fct:get_src_file_path () Returns the full path (directory + name) of the source file containing a function
fct:get_src_lines () Returns minimum and maximum source lines defining a function
fct:get_successors () Returns a table of successor (callees) functions (in the CG) Warning: Each successor function will be referenced as many times as it is destination of an edge from 'function'
fct:has_debug_data () Checks whether a function has debug data (allowing to call corresponding getters as get_language...)
fct:innermost_loops () Iterates over innermost loops of a function
fct:loops () Iterates over all loops of a function
fct:predecessors () Iterates over predecessors (callers) of a function
fct:successors () Iterates over successors (callees) of a function
fct:tostring () Print "Function: " (meta-method)


Functions

fct:analyze_groups ()
Run grouping analysis on a function
fct:analyze_groups_extend (mode)
Run extended grouping analysis on a function

Parameters

  • mode: A constant in {SSE_OFF, SSE_ON, AVX_ON, VECT_ON}
fct:blocks ()
Iterates over blocks of a function

Return value:

next block
fct:get_CC ()
Returns the connected components (CC) of a function

Return value:

a table of CC (table of blocks)
fct:get_CFG_file_path ()
Prints the control flow graph (CFG) of a function to a DOT file

Return value:

path to the output file
fct:get_DDG ()
Returns the DDG (Data Dependency Graph) of a function

Return value:

DDG (graph)
fct:get_DDG_file_path ()
Prints the data dependency graph (DDG) of a function to a DOT file (paths are merged) For each path of the function, prints the corresponding DDG to a DOT file

Return value:

path to the output file
fct:get_RecMII ()
Returns the RecMII of a function RecMII is minimum initiation interval due to inter-iterations data dependencies

Return value:

RecMII (number)
fct:get_asmfile ()
Returns the asmfile containing a function

Return value:

asmfile
fct:get_compiler_short ()
Returns the short compiler name used to compile a function

Return value:

compiler string
fct:get_compiler_version ()
Returns the version of the compiler used to compile a function

Return value:

compiler version string
fct:get_decl_line ()
Returns the source line where the function was declared

Return value:

an integer
fct:get_demname ()
Returns the demangled name of a function if available

Return value:

name (string)
fct:get_dir ()
Returns the directory where the file was located

Return value:

directory
fct:get_entriesb ()
Gets function entry blocks

Return value:

a table f entry blocks
fct:get_entriesi ()
Gets function entry instructions

Return value:

a table f entry instructions (first instruction of each entry block)
fct:get_entry ()
Returns the first (entry) block of a function

Return value:

entry block
fct:get_exitsb ()
Gets function exit blocks

Return value:

a table f exit blocks
fct:get_exitsi ()
Gets function exit instructions

Return value:

a table f exit instructions (last instruction of each exit block)
fct:get_first_block ()
Alias to fct:get_entry
fct:get_first_insn ()
Returns the first instruction of a function

Return value:

an instruction
fct:get_id ()
Returns the global MAQAO identifier (ID) of a function

Return value:

ID (integer)
fct:get_language ()
Returns the language used to write a function

Return value:

language (Consts.LANG_*)
fct:get_nCCs ()
Return the number of connected components

Return value:

an integer
fct:get_name ()
Returns the name of a function

Return value:

name (string)
fct:get_nb_cc ()
Returns the number of connected components (CC) of a function

Return value:

number of CCs
fct:get_nblocks ()
Returns the number of blocks in a function (excluding virtual blocks, not exposed in LUA structures)

Return value:

number of blocks
fct:get_ninsns ()
Returns the number of instructions in a function

Return value:

number of instructions
fct:get_nloops ()
Returns the number of loops in a function

Return value:

number of loops
fct:get_original_function ()
Returns the original function (if CC of a real function)

Return value:

a function
fct:get_parameters ()
Returns the functions parameters from debug data into table Parameters are sub-tables with the following structure
  • name : Name of the parameter
  • type : type of the parameter
  • location:
    • reg: name of the register if the parameter is in a register
    • address: memory address of the parameter if it is in memory
    • offset: offset in the stack of the parameter
    • -> note: only filled fields are defined

Return value:

a table with parameters
fct:get_predecessors ()
Returns a table of predecessor (callers) functions (in the CG) Warning: Each predecessor function will be referenced as many times as it is source of an edge to 'function'

Return value:

functions table
fct:get_producer ()
Returns the producer string located in debug data

Return value:

producer string
fct:get_project ()
Returns the project containing a function

Return value:

project
fct:get_ranges ()
Returns function ranges (a range is a set of consecutive instructions)

Return value:

a table of ranges. Each range is a table with the following structure:
  • start: start adress of the range
  • stop: stop address of the range
  • start_insn: start instruction of the range
  • stop_insn: stop instruction of the range
fct:get_return_var ()
Returns the returned variable of a function from debug data

Return value:

the type of the returned variable or nil
fct:get_src_file_name ()
Returns the name of the source file containing a function

Return value:

file name (string)
fct:get_src_file_path ()
Returns the full path (directory + name) of the source file containing a function

Return value:

file path (string)
fct:get_src_lines ()
Returns minimum and maximum source lines defining a function

Return value:

min, max (ex: 18,24 if function ranges from lines 18 to 24)
fct:get_successors ()
Returns a table of successor (callees) functions (in the CG) Warning: Each successor function will be referenced as many times as it is destination of an edge from 'function'

Return value:

functions table
fct:has_debug_data ()
Checks whether a function has debug data (allowing to call corresponding getters as get_language...)

Return value:

boolean
fct:innermost_loops ()
Iterates over innermost loops of a function

Return value:

next innermost loop
fct:loops ()
Iterates over all loops of a function

Return value:

next loop
fct:predecessors ()
Iterates over predecessors (callers) of a function

Return value:

previous function

See also:

fct:successors ()
Iterates over successors (callees) of a function

Return value:

next function

See also:

fct:tostring ()
Print "Function: " (meta-method)

Valid XHTML 1.0!