Sélectionner une révision Git
Bifurcation depuis
Alexandre MORIGNOT / PlayBot
Le projet source a une visibilité limitée.
-
Alexandre Morignot a rédigéAlexandre Morignot a rédigé
plugin.cpp 21,99 Kio
#include <gcc-plugin.h>
#include <plugin-version.h>
#include <tree.h>
#include <basic-block.h>
#include <diagnostic.h>
#include <gimple.h>
#include <tree-pass.h>
#include <context.h>
#include <function.h>
#include <gimple-iterator.h>
#include <c-family/c-pragma.h>
#include <vec.h>
#include <bitmap.h>
#include <queue>
// ========== VARIABLES GLOBALES ========== //
int plugin_is_GPL_compatible;
// Mode debug (affichage des informations de débogage)
bool debug_mode = true;
/* Enumération des codes des opérations collectives MPI potentielles à vérifier */
enum mpi_collective_code
{
#define DEFMPICOLLECTIVES(CODE, NAME) CODE,
#include "MPI_collectives.def"
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
#undef DEFMPICOLLECTIVES
};
/* Tableau de noms des opérations collectives MPI potentielles à vérifier */
#define DEFMPICOLLECTIVES(CODE, NAME) NAME,
const char *const mpi_collective_name[] = {
#include "MPI_collectives.def"
};
#undef DEFMPICOLLECTIVES
// Vecteur contenant la liste des fonctions à vérifier issue de la directive #pragma ProjetCA mpicoll_check
vec<tree> *fun_vec;
// ========== //
// ========== PRAGMA ========== //
// Affichage du vecteur (variable globale) des fonctions à vérifier
static void print_fun_vec()
{
tree x;
printf("fun_vec contains %i element(s):", fun_vec->length());
for (int i = 0; fun_vec->iterate(i, &x); i++)
printf(" %s,", IDENTIFIER_POINTER(x));
printf("\n");
}
// Traitement de la directive #pragma ProjetCA mpicoll_check
static void handle_pragma_mpicoll_check(cpp_reader *)
{
location_t loc;
enum cpp_ttype token;
tree x;
bool close_paren_needed_p = false;
// Erreur si la directive est placée au sein d'une fonction
if (cfun)
{
error_at(cfun->function_start_locus, "%<#pragma ProjetCA mpicoll_check%> is not allowed inside functions");
return;
}