libabigail
|
How changes are represented in libabigail's comparison engine.
The internal representation of the comparison engine is basically a graph of instances of diff node. We refer to these just as diff nodes. A diff node represents a change between two ABI artifacts represented by instances of types of the abigail::ir namespace. These two artifacts that are being compared are called the subjects of the diff.
The types of that IR are in the abigail::comparison namespace.
Comparing two instances of diff nodes amounts to comparing the subject of the diff. In other words, two diff nodes are equal if and only if their subjects are equal. Thus, two diff nodes can have different memory addresses and yet be equal.
A diff node can be serialized to an output stream to express, in a human-readable textual form, the different changes that exist between its two subjects. This is done by invoking the diff::report() method. That reporting is controlled by several parameters that are conceptually part of the context of the diff. That context is materialized by an instance of the diff_context type.
Please note that the role of the instance(s) of diff_context is boreader than just controlling the reporting of diff nodes. Basically, a diff node itself is created following behaviours that are controlled by a particular instance of diff_context. A diff node is created in a particular diff context, so to speak.