[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Trying coccinelle
From: |
Dmitry Antipov |
Subject: |
Trying coccinelle |
Date: |
Mon, 18 Jun 2012 20:44:34 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 |
Some time ago it was noticed
(http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00371.html)
that coccinelle tool (http://coccinelle.lip6.fr) might be useful for get rid of
the GCPROs;
but it seems that this tool opens a lot of other opportunities. For example,
attached patch was
generated with the very simple "semantic patch":
@expression@
identifier I1, I2;
expression E1, E2;
@@
(
- XVECTOR (I1)->contents[I2++] = E1
+ ASET (I1, I2, E1), I2++
|
- XVECTOR (I1)->contents[E1] = E2
+ ASET (I1, E1, E2)
|
-XVECTOR (I1)->contents[E1]
+AREF (I1, E1)
)
and following minimal manual intervention, so I suspect that more useful
cleanups may be done
with this tool.
Dmitry
vector_access.patch
Description: Text document
- Trying coccinelle,
Dmitry Antipov <=
- Re: Trying coccinelle, Aurélien Aptel, 2012/06/18
- Re: Trying coccinelle, Stefan Monnier, 2012/06/18
- Re: Trying coccinelle, Dmitry Antipov, 2012/06/19
- Re: Trying coccinelle, Stefan Monnier, 2012/06/19
- Re: Trying coccinelle, Dmitry Antipov, 2012/06/22
- Re: Trying coccinelle, Miles Bader, 2012/06/22
- Re: Trying coccinelle, martin rudalics, 2012/06/22
- Re: Trying coccinelle, Stefan Monnier, 2012/06/22
- Re: Trying coccinelle, Dmitry Antipov, 2012/06/24
- Re: Trying coccinelle, Stefan Monnier, 2012/06/24