6.5.4.1. Views¶
C#/.NET RFGs contain
a
Code Factsview,an
Assemblyview,an
Assembly Referenceview,an
Entriesview,a
Callview, andan
Includeview.
Analyses might enrich the RFG with further views (e.g. a Dead / Alive view).
Code Facts View¶
The Code Facts view of a C#/.NET RFG contains nodes for types and their
children as well as edges between them and
Custom_Attribute edges from all assemblies in the RFG. They are structured
by
Namespace nodes.
Assembly View¶
The Assembly view of a C#/.NET RFG has the following structure:
On the top level there is one node of type
Assemblyfor each assembly used in the RFG.Each
Assemblycontains a namespace hierarchy containing all types that are defined within the assembly, and their children.All edges between types and their children as well as
Custom_Attributeedges are represented in theAssemblyview.
Both referenced assemblies as well as given source assemblies (from referenced projects
and the main project itself) are represented in the Assembly view.
Caution
If no source assembly information has been provided at the creation of the IR from
which the RFG is generated, the types not assigned to an assembly are collected in a
’default’
Assembly named ?.
Entries View¶
The entry view of a C#/.NET RFG is similar to the one created for C or C++ projects: it
contains entry points of programs (like the Main function of executables), and
also entities which should be considered ’initially alive’ by analyses like the dead
code analysis. For a library project, all methods having the access modifier
public or protected or protected internal from assemblies that
are not actually referenced by another assembly in the project are contained in this
view by default.
Call View¶
The Call view of a C#/.NET RFG is similar to the one created for C or C++
projects: Its nodes represent routines. Edges between nodes A and B
represent that A calls B or that the address of B is taken in
A. The view is useful for detecting call cycles in the program.
Assembly Reference View¶
The Assembly Reference view is used to represent dependencies between reference assemblies as well as source assemblies. It contains the following elements as follows:
For each source or reference assembly represented in the RFG, a
Assemblynode is contained in the view; these nodes are the same as the top-level nodes of theAssemblyview.A “default”
Assembly(named?). It might contain unresolved references, special types like thedynamictype, or all types from source code if no source assembly information has been provided.For each pair A, B of assemblies such that A references B (by using one of its types and/or type members etc.), there exists an edge A→B of type
Assembly_Referencein the view.Nothing else is contained in the
Assembly Referenceview.
Include View¶
The Include view of a C#/.NET RFG is similar to the one created for C or C++
projects: Its nodes represent directories and files whose content form the source code
basis of the analyzed project.