Re: [PATCH v2 0/4] Makefile/coccicheck: fix bugs and speed it up
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-03-06 17:53:42
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-03-06 17:53:42
On Sat, Mar 06 2021, René Scharfe. wrote:
Am 06.03.21 um 18:27 schrieb Ævar Arnfjörð Bjarmason:quoted
Do these sorts of rules really benefit that much from the type v.s. expression? If yes we'll obviously need to support it, but if (and I haven't looked closely) we can equally rewrite them with "expression" (or it would be good enough) we could be quite a bit faster by default...Type information is essential for many (most?) semantic patches. Untyped replacements could be done more easily using sed or similar.
We have 65 individual hunks in *.cocci by my count $((/ (cat *.cocci | grep -c ^@@) 2)), but only 9 of those use the "type T" construct, which AFAICT is the only thing affected. There's still plenty of reason to use spatch without headers being included, it's still doing a full parse and knows that something's a function, and otherwise cares about C syntax etc. Anyway, I'm not saying you don't need it, just that AFAICT it's a small minority of the rules that require the includes.