|
Jlm
|
When inspecting the graph for analysis it is necessary to identify different nodes/operations and structures. Depending on the direction, the two fundamental questions of interest are:
This requires resolving the type of operation a specific rvsdg::Input or rvsdg::Output belong to. Every rvsdg::Output is one of the following:
Likewise, every rvsdg::Input is one of the following:
Analysis code can determine which of the two is the case using rvsdg::Output::GetOwner and rvsdg::Input::GetOwner, respectively, and then branch deeper based on its results. For convenience, code can more directly match against the specific kinds of nodes using the following convenience functions:
Example:
Similarly, the following variants of the accessor functions assert that the nodes are of requested type and will throw an exception otherwise:
These are mostly suitable for unit tests rather, or for the rare circumstances that the type of node can be assumed to be known statically.