6.2.5.5. Architecture-Dependencies

Analyse dependencies in IR and create a dependency graph (RFG) for it

Required inputs: IR

This rule allows configuring the automatic creation of an RFG from the IR.

The automatic creation of the RFG is enabled if all the following conditions apply:

Possible Messages

This rule has no predefined messages.

Options

The following places define options that affect this rule: Analysis-GlobalOptions

attribute_options

Options regarding the generated attributes
 

attribute_options.check_for_duplicates : bool = False

Print warning on duplicate link name
 

attribute_options.create_body_slocs : bool = False

If set, generate Body.Start and Body.End attributes for Routine nodes.
 

attribute_options.hash_linknames : bool = False

To shorten link names, use hashing if this option is set
 

attribute_options.interface_requires_pure_destructor : bool = True

Element.Is_Interface: only if destructors are pure virtual?
 

cross_language_options

Options regarding the configuration of combined RFGs containing multiple languages. These options take effect iff an IR (C or C++) and either a C# or Rust input are available.
 

cross_language_options.c_cpp_view_prefix : str = 'CXX'

Prefix to be used to uniquely identify C/C++ views in cross-language RFGs.
 

cross_language_options.csharp_view_prefix : str = 'CS'

Prefix to be used to uniquely identify C# views in cross-language RFGs.
 

cross_language_options.introduce_language_clusters : bool = True

Introduces an ancestor node for each language component that was merged into the new view.
 

cross_language_options.merged_views

Type: dict[str, set[str]]

Default:

{
   'Call': {'CS Call', 'CXX Call', 'Rust Call'},
   'Code Facts': {'CS Code Facts', 'CXX Code Facts', 'Rust Code Facts'},
   'Entries': {'CS Entries', 'CXX Entries', 'Rust Entries'},
   'Hierarchy': {'CS Code Facts', 'CXX Module', 'Rust Code Facts'}
}
Mapping of views that should be combined into a new view in cross-language RFGs.
 

cross_language_options.remove_unmerged_views : bool = False

Sets whether to remove all views that have not been combined with other views.
 

cross_language_options.retain_original_views : bool = True

Sets whether to retain views that have been combined with other views.
 

cross_language_options.rust_view_prefix : str = 'Rust'

Prefix to be used to uniquely identify Rust views in cross-language RFGs.
 

csharp_options

Language-specific options for C#.
 

csharp_options.bytecode_analysis : bool = False

If set, the byte-code of binary references will be analyzed and included in the RFG.
 

csharp_options.only_used_types : bool = False

If set, only types defined in source code and their direct dependencies will be included in the RFG.
 

edge_options

Options regarding the generated edges
 

edge_options.create_multiple_edges : bool = False

If set, all source dependencies are reflected by edges (even if this means that there are multiple edges of the same edge descriptor type).

Warning: This cannot be set in a CI context (i.e. when using axivion_ci).

 

edge_options.disabled_edge_types : set[str] = set()

Edge type names which should not be created
 

macro_options

Options regarding the generated macro information
 

macro_options.annotate_declaration_facts_macro_invocations : bool = False

Annotate causing Macro invocations as edge attributes in Declaration Facts.
 

macro_options.redirect_routines_through_macro_invocations : bool = False

If active, redirect outgoing edges from a routine R to a target T through an intermediate access macro M that expands to the name of the target.
For example, consider the following code:
#define M T
void T(int x) {}

#define ACCESS_GLOBAL (global);
char global;

void R()
{
    M(1);
    (int) ACCESS_GLOBAL;
}
        

If the option is not activated, the edges

  • R ==(Macro_Invocation)==> M
  • R ==(Static_Call)==> T
  • R ==(Macro_Invocation)==> ACCESS_GLOBAL (Code Facts)
  • R ==(Variable_Use)==> global (Code Facts)
will be generated.

If the option is activated, the edges

  • R ==(Macro_Invocation)==> M
  • M ==(Static_Call)==> T
  • R ==(Macro_Invocation)==> ACCESS_GLOBAL (Code Facts)
  • ACCESS_GLOBAL ==(Variable_Use)==> global (Code Facts)
will be generated.

 

macro_options.represent_macros : bool = False

Whether macro information should be generated
 

macro_options.use_macro_invocation_nodes_in_code_facts : bool = True

Select macro representation in Code Facts: Represent macro invocations (if True) or macro definitions (if False).
 

macro_options.use_macro_invocation_nodes_in_declaration_facts : bool = False

Select macro representation in Declaration Facts: Represent macro invocations (if True) or macro definitions (if False)
 

node_options

Options regarding the generated nodes
 

node_options.create_file_entry_nodes : bool = True

Whether to create .entry nodes for files if required
 

node_options.create_module_entry_nodes : bool = False

Whether to create .entry nodes for modules if required. These artificial routine nodes serve then as source for dependencies originating from e.g. initializations of variables, which normally would have the global .init routine as their source node.
 

node_options.create_namespaces : bool = True

If set, create Namespace nodes and Enclosing edges, otherwise do not create them.
 

node_options.merge_odr : bool = False

If set, classes/routines/enums with same link name AND sloc are merged into one RFG node
 

node_options.merge_typedef_to_anonymous : bool = True

If set, then typedef nodes to anonymous class/struct/union nodes are merged together and their edges and attributes are united.
 

node_options.separate_statics : bool = False

If set, follow normal language semantics and create individual RFG objects for each instance of a static variable that appeared in a header file; if unset, merge these header-statics to reduce the size of the RFG
 

view_options

Options regarding the generated views
 

view_options.create_cfg_view : bool = False

Whether the CFG view should be created
 

view_options.create_declaration_entries_view : bool = False

Whether to create Declaration Entries view
 

view_options.create_declaration_views : bool = True

Whether to create declaration views (Declaration Facts)
 

view_options.create_definition_views : bool = True

Whether to create definition views (Code Facts)
 

view_options.suppress_computed_views : bool = False

Suppress generation of computed views (Environment, Call) and do not prepare Code Facts and Module views.