Skip to content
Extraits de code Groupes Projets
Valider a81ce0e8 rédigé par Théotime DONNENFELD's avatar Théotime DONNENFELD
Parcourir les fichiers

Tableau des fonctions a analyser bien récupérer dans la gate, reste à gérer le...

Tableau des fonctions a analyser bien récupérer dans la gate, reste à gérer le stockage de ce tableau et la comparaison pour chaque gate
parent 46c574b6
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#include "pragma.h"
vec<const char*> pragma_func_names;
vec<const char*> pragma_func_names_temp;
static void my_pragma_action(cpp_reader *ARG_UNUSED(dummy))
{
printf("****** Pragam detected: ******\n");
......@@ -8,11 +11,11 @@ static void my_pragma_action(cpp_reader *ARG_UNUSED(dummy))
const char* elt;
token = pragma_lex (&x);
bool close_paren_needed_p = false;
bool correct_pragma_names = true;
bool is_in_array=false;
if (cfun){
printf("!!Pragma placed inside function!!\n");
correct_pragma_names = false;
return;
}
......@@ -31,13 +34,7 @@ static void my_pragma_action(cpp_reader *ARG_UNUSED(dummy))
args = tree_cons (NULL_TREE, x, args);
printf("Arg found : %s\n", IDENTIFIER_POINTER(x));
is_in_array = false;
for (int ix = 0; pragma_func_names.iterate (ix, &elt); ix++){
if(strcmp(elt,IDENTIFIER_POINTER(x))){
is_in_array = true;
}
}
if(is_in_array)
pragma_func_names_temp.safe_push(IDENTIFIER_POINTER(x));
token = pragma_lex (&x);
//Cleans COMAS
......@@ -56,7 +53,7 @@ static void my_pragma_action(cpp_reader *ARG_UNUSED(dummy))
}
else{
printf("Missing closed parenthesis\n");
correct_pragma_names = false;
return;
}
}
......@@ -70,11 +67,11 @@ static void my_pragma_action(cpp_reader *ARG_UNUSED(dummy))
if (token != CPP_EOF)
{
printf("Error : arg read but EOL not reached");
correct_pragma_names = false;
return;
}
while(pragma_func_names_temp.length() != 0 && correct_pragma_names){
while(pragma_func_names_temp.length() != 0){
pragma_func_names.safe_push(pragma_func_names_temp.pop());
}
......@@ -84,7 +81,7 @@ static void my_pragma_action(cpp_reader *ARG_UNUSED(dummy))
static void register_my_pragma(void *event_data, void *data)
{
c_register_pragma ("instrumente", "function", my_pragma_action);
c_register_pragma ("ProjetCA", "mpicoll_check", my_pragma_action);
}
#ifndef __PRAGMADD__H
#define __PRAGMADD__H
vec<const char*> pragma_func_names;
vec<const char*> pragma_func_names_temp;
static void register_my_pragma(void *event_data, void *data);
static void my_pragma_action(cpp_reader *ARG_UNUSED(dummy));
......
......@@ -121,6 +121,12 @@ class cleanup_pass : public gimple_opt_pass
{
printf("=> plugin: cleanup_pass... \n");
printf("=> plugin: gate... \n");
printf("List of functions to be checked :\n");
while(pragma_func_names.length() != 0){
printf("- %s\n",pragma_func_names.pop());
}
return true;
}
......@@ -131,6 +137,7 @@ class cleanup_pass : public gimple_opt_pass
{
printf("=> plugin: cleanup_pass... \n");
printf("=> plugin: execute...\n");
printf("... in function %s\n\n", function_name(fun));
edit_all_aux_value(fun,(int*)NULL);
return 0;
......
......@@ -5,17 +5,17 @@
#include <stdio.h>
#include "pragma_test.h"
#pragma instrumente function mock1
#pragma instrumente function mock2
#pragma instrumente function mock3,mock5
#pragma instrumente function (mock4,mock6)
#pragma instrumente function CANARD
#pragma instrumente function mock1
#pragma instrumente function (coincoin
#pragma ProjetCA mpicoll_check mock1
#pragma ProjetCA mpicoll_check mock2
#pragma ProjetCA mpicoll_check mock3,mock5
#pragma ProjetCA mpicoll_check (mock4,mock6)
#pragma ProjetCA mpicoll_check CANARD
#pragma ProjetCA mpicoll_check mock1
#pragma ProjetCA mpicoll_check (coincoin
void mock1() {
printf("mock1\n");
#pragma instrumente function MOCK1
#pragma ProjetCA mpicoll_check MOCK1
}
void mock2() {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter