From e43446cc0c50defbf6bfcc051514b5ac4979b69e Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 11 Feb 2018 11:20:15 +0100 Subject: [PATCH] GENmodel, GENinstance, change layout, #1/4, klag-4.cocci for coccinelle --- klag-4.cocci | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 klag-4.cocci diff --git a/klag-4.cocci b/klag-4.cocci new file mode 100644 index 000000000..4627e10b4 --- /dev/null +++ b/klag-4.cocci @@ -0,0 +1,25 @@ +// functionalise access to certain struct GENmodel and struct GENinstance slots + +// (compile "ulimit -s 20000; git grep -l -e 'nextModel\\|nextInstance\\|instances\\|modPtr' -- '*.c' | xargs -P8 -n1 spatch --defined XSPICE --sp-file klag-4.cocci --in-place && git commit -am 'GENmodel, GENinstance, change layout, #1/4, coccinelle semantic patch'") + +// (compile "spatch --sp-file klag-4.cocci src/spicelib/devices/isrc/isrcload.c --defined XSPICE") +// (compile "spatch --sp-file klag-4.cocci src/frontend/spiceif.c") +// (compile "spatch --sp-file klag-4.cocci src/spicelib/devices/bsimsoi/b4soild.c") +// (compile "spatch --sp-file klag-4.cocci src/spicelib/devices/cpl/*.c") +// (compile "spatch --sp-file klag-4.cocci src/spicelib/devices/cpl/*.c") + + +@anyid@ +identifier el =~ "(nextModel|nextInstance|instances|modPtr)$"; +identifier p; +@@ + +p->el + + +@functionalise_nextThing@ +identifier anyid.el !~ "(INP|GEN)(nextModel|nextInstance|instances|modPtr)$"; +identifier p; +@@ +- p->el ++ el(p)