I have a control flow graph representing a single procedure of my intermediate language code. Nodes and Edges are annotated via vertex/edge properties and contain instructions resp branch information.
Now I want to perform data flow analysis on this graph and feed that graph into each data flow analysis module. Each module should be able to annotate the CFG with its own data.
Problems I need to solve:
- I don’t know upfront how many annotations are introduced by the data flow analysis modules (because I will implement additional analysis modules in the future)
- I don’t know anything about the type of annotation introduced by a specific data flow analysis module
- Each data flow analysis module should exist independently from the other modules, i.e. module A shouldn’t be concerned about the annotations introduced by module B
Do you see any chance to realize all of the above requirements?
Any comments or advises are highly appreciated
Update:
To be more specific, I basically want to decouple my annotations from the Graph type. When using the usual vertex/edge properties the Graph type itself is always “polluted” (and is therefore dependent on the vertex/edge property types) by the contained property types.
See the “Using Property Maps” chapter of the documentation of the boost graph library. Especially the “Constructing an Exterior Property Map” section. If that doesn’t answer your question, could you clarify what is missing?