diff --git a/TODOLIST b/TODOLIST index 7868552ba621fb34e309b663e0f169b65841dc52..223495703cd95ed697fb7613f8945c10ee98cf6c 100644 --- a/TODOLIST +++ b/TODOLIST @@ -10,7 +10,7 @@ Si on utilise pas les pragmas -> passer dans toutes les fonctions : Oui Reconnaitre les noms de fonctions et filtrer dans la gate : Oui -Ne pas mettre deux fois la meme fonction via les pragmas : Non +Ne pas mettre deux fois la meme fonction via les pragmas : Oui Pas de pragma dans les fonctions : Oui diff --git a/functions/pragma.c b/functions/pragma.c index 3d716af3d82a6a6c684d7b42f7c4dc735c72e7c2..164607ee19934471db8feeeb1d1fec02ec1415df 100644 --- a/functions/pragma.c +++ b/functions/pragma.c @@ -5,7 +5,7 @@ vec<const char*> pragma_func_names_temp; static void my_pragma_action(cpp_reader *ARG_UNUSED(dummy)) { - printf("****** Pragam detected: ******\n"); + printf("****** Pragma detected: ******\n"); enum cpp_ttype token; tree x; const char* elt; diff --git a/plugin.cpp b/plugin.cpp index 06c12cb2721a225073ee9265dd96d710c2a060ca..19dd67a14bedf800bd208ddfb5e45d493057b3fa 100755 --- a/plugin.cpp +++ b/plugin.cpp @@ -73,9 +73,20 @@ class split_count_pass : public gimple_opt_pass /* Gate function (shall we apply this pass?) */ bool gate (function * fun) { + bool func_to_be_analyzed = true; + printf("=> plugin: split_count_pass... \n"); printf("=> plugin: gate... \n"); - return true; + if((pragma_func_names.length() == 0)){ + printf("\nNOT USING PRAGMAS - ANALYSING ALL FUNCS\n\n"); + return true; + } + + const char *elt; + for(int ix = 0; pragma_func_names.iterate (ix, &elt); ix++) + func_to_be_analyzed = (strcmp(elt,function_name(fun))==0) && func_to_be_analyzed; + printf("USING PRAGMAS - FUNC IS : %s", function_name(fun)); + return func_to_be_analyzed; } @@ -122,16 +133,7 @@ class cleanup_pass : public gimple_opt_pass bool func_to_be_analyzed = true; printf("=> plugin: cleanup_pass... \n"); printf("=> plugin: gate... \n"); - if((pragma_func_names.length() == 0)){ - printf("\nNOT USING PRAGMAS - ANALYSING ALL FUNCS\n\n"); - return true; - } - - const char *elt; - for(int ix = 0; pragma_func_names.iterate (ix, &elt); ix++) - func_to_be_analyzed = (strcmp(elt,function_name(fun))==0) && func_to_be_analyzed; - printf("USING PRAGMAS - FUNC IS : %s", function_name(fun)); - return func_to_be_analyzed; + return true; }