6.2.5.5. Architecture-Dependencies¶
Analyse dependencies in IR and create a dependency graph (RFG) for it
Required inputs: IR
The automatic creation of the RFG is enabled if all the following conditions apply:
- An IR is configured in option /Project/ir
- Option /Project/rfg is left unconfigured (no existing RFG)
- The RFG is required by another active rule (e.g. any other Architecture rule, the SaveRFG rule, CycleDetection, DeadCodeDetection and most Metrics).
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 =
Print warning on duplicate link nameFalse
attribute_options.create_body_slocs : bool =
If set, generate Body.Start and Body.End attributes for Routine nodes.False
attribute_options.hash_linknames : bool =
To shorten link names, use hashing if this option is setFalse
attribute_options.interface_requires_pure_destructor : bool =
Element.Is_Interface: only if destructors are pure virtual?True
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 =
Prefix to be used to uniquely identify C/C++ views in cross-language RFGs.'CXX'
cross_language_options.csharp_view_prefix : str =
Prefix to be used to uniquely identify C# views in cross-language RFGs.'CS'
cross_language_options.introduce_language_clusters : bool =
Introduces an ancestor node for each language component that was merged into the new view.True
cross_language_options.merged_views
Mapping of views that should be combined into a new view in cross-language RFGs.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'} }
cross_language_options.remove_unmerged_views : bool =
Sets whether to remove all views that have not been combined with other views.False
cross_language_options.retain_original_views : bool =
Sets whether to retain views that have been combined with other views.True
cross_language_options.rust_view_prefix : str =
Prefix to be used to uniquely identify Rust views in cross-language RFGs.'Rust'
csharp_options¶
Language-specific options for C#.
csharp_options.bytecode_analysis : bool =
If set, the byte-code of binary references will be analyzed and included in the RFG.False
csharp_options.only_used_types : bool =
If set, only types defined in source code and their direct dependencies will be included in the RFG.False
edge_options¶
Options regarding the generated edges
edge_options.create_multiple_edges : bool =
If set, all source dependencies are reflected by edges (even if this means that there are multiple edges of the same edge descriptor type).FalseWarning: This cannot be set in a CI context (i.e. when using
axivion_ci).
edge_options.disabled_edge_types : set[str] =
Edge type names which should not be createdset()
macro_options¶
Options regarding the generated macro information
macro_options.annotate_declaration_facts_macro_invocations : bool =
Annotate causing Macro invocations as edge attributes in Declaration Facts.False
macro_options.redirect_routines_through_macro_invocations : bool =
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.False
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
will be generated.
- R ==(Macro_Invocation)==> M
- R ==(Static_Call)==> T
- R ==(Macro_Invocation)==> ACCESS_GLOBAL (Code Facts)
- R ==(Variable_Use)==> global (Code Facts)
If the option is activated, the edges
will be generated.
- R ==(Macro_Invocation)==> M
- M ==(Static_Call)==> T
- R ==(Macro_Invocation)==> ACCESS_GLOBAL (Code Facts)
- ACCESS_GLOBAL ==(Variable_Use)==> global (Code Facts)
macro_options.represent_macros : bool =
Whether macro information should be generatedFalse
macro_options.use_macro_invocation_nodes_in_code_facts : bool =
Select macro representation in Code Facts: Represent macro invocations (if True) or macro definitions (if False).True
macro_options.use_macro_invocation_nodes_in_declaration_facts : bool =
Select macro representation in Declaration Facts: Represent macro invocations (if True) or macro definitions (if False)False
node_options¶
Options regarding the generated nodes
node_options.create_file_entry_nodes : bool =
Whether to create .entry nodes for files if requiredTrue
node_options.create_module_entry_nodes : bool =
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 globalFalse.initroutine as their source node.
node_options.create_namespaces : bool =
If set, create Namespace nodes and Enclosing edges, otherwise do not create them.True
node_options.merge_odr : bool =
If set, classes/routines/enums with same link name AND sloc are merged into one RFG nodeFalse
node_options.merge_typedef_to_anonymous : bool =
If set, then typedef nodes to anonymous class/struct/union nodes are merged together and their edges and attributes are united.True
node_options.separate_statics : bool =
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 RFGFalse
view_options¶
Options regarding the generated views
view_options.create_cfg_view : bool =
Whether the CFG view should be createdFalse
view_options.create_declaration_entries_view : bool =
Whether to create Declaration Entries viewFalse
view_options.create_declaration_views : bool =
Whether to create declaration views (Declaration Facts)True
view_options.create_definition_views : bool =
Whether to create definition views (Code Facts)True
view_options.suppress_computed_views : bool =
Suppress generation of computed views (Environment, Call) and do not prepare Code Facts and Module views.False