We have been careful to keep the isl_schedule alive whenever the user
is holding on to an isl_band, but if the user only has a reference
to an isl_band_list inside the schedule, then the schedule can still
disappear. We therefore hand out duplicates of internal lists.
These duplicates contain copies of the isl_bands and these outside
references keep the schedule alive.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
#include <isl_band_private.h>
#include <isl_schedule_private.h>
+#include <isl_list_private.h>
isl_ctx *isl_band_get_ctx(__isl_keep isl_band *band)
{
if (!band->children)
isl_die(isl_band_get_ctx(band), isl_error_invalid,
"band has no children", return NULL);
- return isl_band_list_copy(band->children);
+ return isl_band_list_dup(band->children);
}
int isl_band_n_member(__isl_keep isl_band *band)
#include <isl_qsort.h>
#include <isl_schedule_private.h>
#include <isl_band_private.h>
+#include <isl_list_private.h>
/*
* The scheduling algorithm implemented in this file was inspired by
return NULL;
if (!schedule->band_forest)
schedule->band_forest = construct_forest(schedule);
- return isl_band_list_copy(schedule->band_forest);
+ return isl_band_list_dup(schedule->band_forest);
}
static __isl_give isl_printer *print_band_list(__isl_take isl_printer *p,