Skip to content
Extraits de code Groupes Projets
Valider e13cc588 rédigé par Thomas DILASSER's avatar Thomas DILASSER
Parcourir les fichiers

add a print function and function name in execute

parent d8101475
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Pipeline #1127 annulé
...@@ -15,3 +15,16 @@ void edit_all_aux_value(function * fun,int *i) ...@@ -15,3 +15,16 @@ void edit_all_aux_value(function * fun,int *i)
bb->aux = i; bb->aux = i;
} }
} }
void print_bb_aux(function * fun)
{
basic_block bb;
FOR_ALL_BB_FN(bb,fun)
{
if (bb->aux !=NULL && *((int *)bb->aux)>=0)
{
printf("bb aux value here : %i\n",*((int *)bb->aux));
}
}
}
...@@ -3,5 +3,6 @@ ...@@ -3,5 +3,6 @@
void edit_aux_value(basic_block bb, int *i); void edit_aux_value(basic_block bb, int *i);
void edit_all_aux_value(function * fun,int *i); void edit_all_aux_value(function * fun,int *i);
void print_bb_aux(function * fun);
#endif #endif
...@@ -71,7 +71,7 @@ class my_pass : public gimple_opt_pass ...@@ -71,7 +71,7 @@ class my_pass : public gimple_opt_pass
/* Gate function (shall we apply this pass?) */ /* Gate function (shall we apply this pass?) */
bool gate (function * fun) bool gate (function * fun)
{ {
printf("plugin: gate... \n"); printf("=> plugin: gate... \n");
return true; return true;
} }
...@@ -80,7 +80,8 @@ class my_pass : public gimple_opt_pass ...@@ -80,7 +80,8 @@ class my_pass : public gimple_opt_pass
/* Execute function */ /* Execute function */
unsigned int execute (function *fun) unsigned int execute (function *fun)
{ {
printf("plugin: execute...\n"); printf("=> plugin: execute...\n");
printf("... in function %s\n", function_name(fun));
edit_all_aux_value(fun,(int*)NULL); edit_all_aux_value(fun,(int*)NULL);
return 0; return 0;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter