Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
made it so that to apply varget for statics we not only have to match the name
authormarkls <markls@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 21 Jan 2011 14:52:10 +0000 (14:52 +0000)
committermarkls <markls@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 21 Jan 2011 14:52:10 +0000 (14:52 +0000)
of the variable, but also the containing function.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9474 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/replace_globals.cocci

index da0e6ab..00a6ca5 100644 (file)
@@ -95,10 +95,11 @@ var
 // starting with the word static (exceptions?)
 @staticvardecl@
 type T;
-identifier var;
+identifier func, var;
 expression value;
 @@
-<...
+func(...) {
+...
 ( // default case
 static T
 - var
@@ -110,13 +111,16 @@ T
 + *var = SMPI_VARINIT_STATIC_AND_SET(var, T, value)
 ;
 )
-...>
+...
+}
 
 // 
 @rewritestaticaccess@
 type T;
-identifier staticvardecl.var;
+identifier staticvardecl.func, staticvardecl.var;
 @@
+func(...) {
+<...
 ( // declaration
 T
 var
@@ -126,3 +130,5 @@ var
 var
 +)
 )
+...>
+}