RFC coccinelle: add initial control flow documentation and extend tests
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest0 of 3 patches 0 repliesNew
Patches in v1 No applies recorded yet
None of the 3 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Cocci] [RFC 0/3] coccinelle: add initial control flow documentation and extend tests
Quoted 22 lines · Julia Lawall
Quoted 18 lines · Luis R. Rodriguez
This adds some initial control flow documentation, I wanted to add some basic control flow diagrams as well with self generated diagrams from Coccinelle however I had issues figuring out what to use with dot to make it fit within the margins. We can skip that, but I thought adding it would also help document support and example use case for that feature as well.
The tests/remove-code-in-branch1* was more collateral effort as I saw a removal of a statement from a branch that only had one statement left an empty brace. I hope we can discuss here what the expected outcome should be. I figured removing the empty code may be an optional optimization, however it was still unclear how to resolve this if that's desirable. Would it be up to Coccinelle or would that be an optional isomorphism ? I noticed no current isomorphisms seem to remove code like this so it was unclear what to do.
The following rule for instnace can deal with it.
Quoted 8 lines
Quoted 5 lines
@
remove_empty_branch@
expression E;
@@-if (E) {}
I don't think this is desirable as a general rule. E might contain function calls that perform side effects.
Ah, yes good point.
Luis