6.5.2.3. Edges (Dependencies)¶
Edges in the RFG represent dependencies between the entities that are represented by nodes.
Note
The descriptions define a direction and the type of source and target nodes of an edge. However, in a lifted view, the source and target nodes of a lifted edge may also be nodes that hierarchically contain the entities the basic edge is situated between.
Attributes¶
Edges in C RFGs can have the following attributes:
- Source.File, Source.Path, Source.Line, Source.Column
These four attributes characterize the source location of the relation.
Note
If the same relation occurs multiple times, the source location of an arbitrary occurrence is used as representation.
Address¶

Possible Source and Target Nodes
Only subtypes of this edge appear in views.
Description
An
Address edge represents the fact that the address of an
entity is taken by another entity. The source of a
Address
edge is the entity that takes the address, the target is the entity whose address is
taken.
Cast_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Description
A
Cast_Of_Type edge e → T represents
that within entity e a cast with target type t occurs.
Declare¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
A
Declare edge e₁→ e₂ with entities
e₁, e₂ of the same type denote that e₁ represents a
declaration of an entity e whose definition is represented by e₂.
Dynamic_Call¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
Description
A
Dynamic_Call edge represents a call via function
pointer.
Note
Dynamic_Call edges are inserted by a pointer
analysis which has to be run in addition to the front end pass. This analysis may be
not available depending on the structure and size of your analyzed system.
Enclosing¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
A
Enclosing states that an entity is declared within
another entity. The
Enclosing edge is directed from the
contained entity towards the containing entity. See Section Member for an
example structure.
Note
The
Enclosing edges indicate the hierarchical
containment of
Member and
Constant within
Type.
Enumerator_Use¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
An
Enumerator_Use edge e→ c (with
c being a constant) represents the fact that entity e might use the
value (of) c.
Note
Code Example
enum Enumeration { Enumerator };
void f(void) {
enum Enumeration e = Enumerator;
}
Example: Accessing an enumerator in function f.¶
Include¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
Description
A
Include edge f₁→ f₂ (with f₁, f₂
nodes representing files) states that f₂ is included in f₁.
Local_Var_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Description
A
Local_Var_Of_Type edge e → T
states that an entity e contains one or more local variables of type t.
Note
Code Example
struct T
{
int m;
};
void f(void)
{
struct T x;
}
Example: A local variable in function f has type T.¶
Macro_Invocation¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
A
Macro_Invocation represents the invocation of a
macro.
Note
Code Example
#define SomeMacro(x,y) (((x)>(y))?(x):(y))
void invoker1 (void)
{
SomeMacro(21,21);
}
int f(void) { return 42; }
void invoker2 (void)
{
SomeMacro(f(),f());
}
int G = 84;
void invoker3 (void)
{
SomeMacro(G, G);
}
Example: A macro SomeMacro and its invocation from within some invoking routines.¶
Member_Address¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
A
Member_Address edge e→ m (with
m being a member) represents the fact that the address of m is taken
within entity e.
Note
Code Example
struct T
{
int m;
};
void f(void) {
struct T x;
int *p;
p = &(x.m); /* direction: g -> m */
}
Example: Taking the address of the member m of struct T in function f.¶
Member_Set¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
A
Member_Set edge e→ m (with
m being a member) represents the fact that entity e might overwrite the
value of member m.
Note
Code Example
struct T
{
int m;
};
void f(void) {
struct T x;
x.m = 2; /* direction: f -> m */
}
Example: Setting a member of struct T.¶
Member_Use¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
A
Member_Use edge e→ m (with
m being a member) represents the fact that entity e might read the value
of member m.
Note
Code Example
struct T
{
int m;
};
void f(void) {
struct T x;
int y = x.m; /* direction: f -> m */
}
Example: Accessing a member of struct T in function f.¶
Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
A
Of_Type edge e → T states that an
entity e (e.g. a variable) is of type t.
Parameter_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Description
A
Parameter_Of_Type edge e → T
states that the signature of an entity e mentions a type t as type of a
formal parameter.
Note
Code Example
struct T
{
int m;
};
void f(struct T p) /* direction: f -> T */
{}
Example: Function f has a parameter of type T.¶
Reference¶

Possible Source and Target Nodes
Only subtypes of this edge appear in views.
Description
A
Reference edge represents the setting, using, or
address-taking of an
Object or
Memberby a
Routine. The edge is directed
from the routine to the object/member. Similarly, address-taking of
Routines is represented by
References
between the routines.
Return_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Description
A
Return_Type edge e → T states that
the signature of an entity e mentions a type t as return type.
Note
Code Example
struct T
{
int m;
};
struct T f() /* direction: f -> T */
{
struct T result;
return result;
}
Example: Function f has return type T.¶
Routine_Address¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
A
Routine_Address edge e→ r
(with r being a routine) represents the fact that the address of r is
taken within entity e.
Note
Code Example
void g() {}
void f(void) {
&g; /* direction: f -> g */
}
Example: Taking the address of the function g in function f.¶
Set¶

Possible Source and Target Nodes
Only subtypes of this edge appear in views.
Description
A
Set edge represents a setting access to an object or member
by another entity.
Signature¶

Possible Source and Target Nodes
Only subtypes of this edge appear in views.
Description
A
Signature edge indicates that a type occurs in a
signature of another entity (e.g. a routine). The direction of a
Signature edge is from the entity to the type mentioned in its signature.
Note
The meaning of signature here includes return type and parameter types and excludes thrown exceptions. In this sense, it does not reflect the language semantics of which information belongs to a signature and which does not.
Note
Modifiers to a base type like pointers ( *), references (in C++: &),
arrays ( []), const, volatile etc. are ignored by a type
node.
Sizeof_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → T of type
Sizeof_Of_Type represents the fact that entity e contains a
sizeof expression using type T as operand.
Source_Dependency¶

Possible Source and Target Nodes
Only subtypes of this edge appear in views.
Description
A
Source_Dependency edge is a dependency between
two entities that is directly apparent from the source code.
Static_Call¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
A
Static_Call edge is an explicit call directly visible
in source code (not including calls by pointer and virtual calls). The source of the
edge is the caller and the target is the callee.
Note
Code Example
void g(void) {
g(); // recursive call
}
void h(void) {
}
void f(void) {
g(); // f calls g
h();
}
Example: Calls from routine f to routines g and h.¶
Type_Synonym_To¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Description
A
Type_Synonym_To edge
t₁→ t₂ states that a type t₁ is a typedef or type alias (and
therefore a synonym) of type t₂.
Note
Modifiers to a base type like pointers ( *), references (in C++: &),
arrays ( []), const, volatile etc. are ignored.
Use¶

Possible Source and Target Nodes
Only subtypes of this edge appear in views.
Description
A
Use edge represents that the value of an entity is read by
another entity.
Variable_Address¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
A
Variable_Address edge e→ v
represents the fact that the address of a global variable v is taken by an
entity e.
Note
Code Example
int G;
void f(void) {
int *p;
p = &G; /* direction: f -> G*/
}
Example: Taking the address of the global variable G in function f.¶
Variable_Set¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
A
Variable_Set edge e→ v (with
v being a variable) represents the fact that entity e might overwrite
the value of variable v.
Note
Code Example
int G;
void f(void)
{
G = 1;
}
Example: Setting the global variable G in function f.¶
Variable_Use¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
A
Variable_Use edge e→ v (with
v being a variable) represents the fact that entity e might read the
value of variable v.
Note
Code Example
int G;
void f(void)
{
int x = G;
}
Example: Reading the global variable G in function f.¶