emacs-devel
[Top][All Lists]
Advanced

[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

Attachment: vector_access.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]