Are all patches created equal?
Are all patches created equal?
Posted Jul 24, 2011 20:48 UTC (Sun) by civodul (guest, #58311)In reply to: Are all patches created equal? by jnareb
Parent article: Are all patches created equal?
Unfortunately I don't know of any tool that would create a semantic patch from a unidiff patch (the opposite of Coccinelle.)
Obviously a C parser is needed to turn source code into a canonical form (roughly, its AST). It may be possible to write a plug-in to abuse GCC to that end (see GCC-XML). Then some sort of tree diff on alpha-renamed ASTs would do it. However, I don't know what algorithms exist to compute the differences between two trees.