From 30a682480d5284e124538015a2bbb287337baaad Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 8 Sep 2008 19:19:59 +0200 Subject: [PATCH] pass the number of parameters to functions reading polyhedra --- include/cloog/domain.h | 8 +++++--- source/loop.c | 2 +- source/polylib/domain.c | 17 ++++++++++------- source/program.c | 4 ++-- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/include/cloog/domain.h b/include/cloog/domain.h index 3f27d03..80a26bb 100644 --- a/include/cloog/domain.h +++ b/include/cloog/domain.h @@ -99,9 +99,11 @@ void cloog_scattering_list_free(CloogScatteringList *); /*+**************************************************************************** * Reading function * ******************************************************************************/ -CloogDomain * cloog_domain_read(FILE *foo, CloogOptions *options); -CloogDomain * cloog_domain_union_read(FILE *foo, CloogOptions *options); -CloogScatteringList * cloog_scattering_list_read(FILE *foo, CloogOptions *options); +CloogDomain * cloog_domain_read(FILE *foo, int nb_par, CloogOptions *options); +CloogDomain * cloog_domain_union_read(FILE *foo, int nb_par, + CloogOptions *options); +CloogScatteringList * cloog_scattering_list_read(FILE * foo, + int nb_parameters, CloogOptions *options); /****************************************************************************** diff --git a/source/loop.c b/source/loop.c index d0b517f..87144e9 100644 --- a/source/loop.c +++ b/source/loop.c @@ -286,7 +286,7 @@ CloogLoop * cloog_loop_read(FILE * foo, int number, int nb_parameters, exit(1) ; } /* domain. */ - loop->domain = cloog_domain_union_read(foo, options); + loop->domain = cloog_domain_union_read(foo, nb_parameters, options); if (loop->domain != NULL) nb_iterators = cloog_domain_dimension(loop->domain) - nb_parameters ; else diff --git a/source/polylib/domain.c b/source/polylib/domain.c index 963c4d8..bc6c9dc 100644 --- a/source/polylib/domain.c +++ b/source/polylib/domain.c @@ -654,7 +654,8 @@ void cloog_scattering_list_free(CloogScatteringList * list) * information. * - October 18th 2001: first version. */ -CloogDomain * cloog_domain_read(FILE * foo, CloogOptions *options) +CloogDomain * cloog_domain_read(FILE * foo, int nb_parameters, + CloogOptions *options) { CloogMatrix * matrix ; CloogDomain * domain ; @@ -674,7 +675,8 @@ CloogDomain * cloog_domain_read(FILE * foo, CloogOptions *options) * - October 29th 2005: (debug) removal of a leak counting "correction" that * was just false since ages. */ -CloogDomain * cloog_domain_union_read(FILE * foo, CloogOptions *options) +CloogDomain * cloog_domain_union_read(FILE * foo, int nb_parameters, + CloogOptions *options) { int i, nb_components ; char s[MAX_STRING] ; CloogDomain * domain, * temp, * old ; @@ -686,11 +688,11 @@ CloogDomain * cloog_domain_union_read(FILE * foo, CloogOptions *options) if (nb_components > 0) { /* 1. first part of the polyhedra union, */ - domain = cloog_domain_read(foo, options); + domain = cloog_domain_read(foo, nb_parameters, options); /* 2. and the nexts. */ for (i=1;i 0) { list = (CloogScatteringList *)malloc(sizeof(CloogScatteringList)) ; - list->domain = cloog_domain_read(foo, options); + list->domain = cloog_domain_read(foo, nb_parameters, options); list->next = NULL ; now = list ; for (i=1;idomain = cloog_domain_read(foo, options); + next->domain = cloog_domain_read(foo, nb_parameters, options); next->next = NULL ; now->next = next ; now = now->next ; diff --git a/source/program.c b/source/program.c index 2b788bb..13d5eeb 100644 --- a/source/program.c +++ b/source/program.c @@ -530,7 +530,7 @@ CloogProgram * cloog_program_read(FILE * file, CloogOptions * options) p->language = language ; /* We then read the context data. */ - p->context = cloog_domain_read(file, options); + p->context = cloog_domain_read(file, 0, options); nb_parameters = cloog_domain_dimension(p->context) ; /* First part of the CloogNames structure: reading of the parameter names. */ @@ -572,7 +572,7 @@ CloogProgram * cloog_program_read(FILE * file, CloogOptions * options) iterators = cloog_names_read_strings(file,nb_iterators,NULL,FIRST_ITERATOR); /* Reading and putting the scattering data in program structure. */ - scatteringl = cloog_scattering_list_read(file, options); + scatteringl = cloog_scattering_list_read(file, nb_parameters, options); if (scatteringl != NULL) { if (cloog_scattering_list_lazy_same(scatteringl)) -- 2.11.4.GIT