reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/polly/lib/External/isl/isl_list_templ.c
   31 isl_ctx *FN(LIST(EL),get_ctx)(__isl_keep LIST(EL) *list)
   31 isl_ctx *FN(LIST(EL),get_ctx)(__isl_keep LIST(EL) *list)
   36 __isl_give LIST(EL) *FN(LIST(EL),alloc)(isl_ctx *ctx, int n)
   36 __isl_give LIST(EL) *FN(LIST(EL),alloc)(isl_ctx *ctx, int n)
   38 	LIST(EL) *list;
   44 	list = isl_alloc(ctx, LIST(EL),
   45 			 sizeof(LIST(EL)) + (n - 1) * sizeof(struct EL *));
   45 			 sizeof(LIST(EL)) + (n - 1) * sizeof(struct EL *));
   57 __isl_give LIST(EL) *FN(LIST(EL),copy)(__isl_keep LIST(EL) *list)
   57 __isl_give LIST(EL) *FN(LIST(EL),copy)(__isl_keep LIST(EL) *list)
   57 __isl_give LIST(EL) *FN(LIST(EL),copy)(__isl_keep LIST(EL) *list)
   66 __isl_give LIST(EL) *FN(LIST(EL),dup)(__isl_keep LIST(EL) *list)
   66 __isl_give LIST(EL) *FN(LIST(EL),dup)(__isl_keep LIST(EL) *list)
   66 __isl_give LIST(EL) *FN(LIST(EL),dup)(__isl_keep LIST(EL) *list)
   69 	LIST(EL) *dup;
   74 	dup = FN(LIST(EL),alloc)(FN(LIST(EL),get_ctx)(list), list->n);
   74 	dup = FN(LIST(EL),alloc)(FN(LIST(EL),get_ctx)(list), list->n);
   78 		dup = FN(LIST(EL),add)(dup, FN(EL,copy)(list->p[i]));
   78 		dup = FN(LIST(EL),add)(dup, FN(EL,copy)(list->p[i]));
   82 __isl_give LIST(EL) *FN(LIST(EL),cow)(__isl_take LIST(EL) *list)
   82 __isl_give LIST(EL) *FN(LIST(EL),cow)(__isl_take LIST(EL) *list)
   82 __isl_give LIST(EL) *FN(LIST(EL),cow)(__isl_take LIST(EL) *list)
   90 	return FN(LIST(EL),dup)(list);
   99 static __isl_give LIST(EL) *FN(LIST(EL),grow)(__isl_take LIST(EL) *list, int n)
   99 static __isl_give LIST(EL) *FN(LIST(EL),grow)(__isl_take LIST(EL) *list, int n)
   99 static __isl_give LIST(EL) *FN(LIST(EL),grow)(__isl_take LIST(EL) *list, int n)
  103 	LIST(EL) *res;
  110 	ctx = FN(LIST(EL),get_ctx)(list);
  113 		res = isl_realloc(ctx, list, LIST(EL),
  114 			    sizeof(LIST(EL)) + (new_size - 1) * sizeof(EL *));
  114 			    sizeof(LIST(EL)) + (new_size - 1) * sizeof(EL *));
  116 			return FN(LIST(EL),free)(list);
  124 	res = FN(LIST(EL),alloc)(ctx, new_size);
  126 		return FN(LIST(EL),free)(list);
  129 		res = FN(LIST(EL),add)(res, FN(EL,copy)(list->p[i]));
  129 		res = FN(LIST(EL),add)(res, FN(EL,copy)(list->p[i]));
  131 	FN(LIST(EL),free)(list);
  137 static isl_stat FN(LIST(EL),check_index)(__isl_keep LIST(EL) *list, int index)
  137 static isl_stat FN(LIST(EL),check_index)(__isl_keep LIST(EL) *list, int index)
  142 		isl_die(FN(LIST(EL),get_ctx)(list), isl_error_invalid,
  147 __isl_give LIST(EL) *FN(LIST(EL),add)(__isl_take LIST(EL) *list,
  147 __isl_give LIST(EL) *FN(LIST(EL),add)(__isl_take LIST(EL) *list,
  147 __isl_give LIST(EL) *FN(LIST(EL),add)(__isl_take LIST(EL) *list,
  148 	__isl_take struct EL *el)
  150 	list = FN(LIST(EL),grow)(list, 1);
  157 	FN(EL,free)(el);
  158 	FN(LIST(EL),free)(list);
  164 __isl_give LIST(EL) *FN(LIST(EL),drop)(__isl_take LIST(EL) *list,
  164 __isl_give LIST(EL) *FN(LIST(EL),drop)(__isl_take LIST(EL) *list,
  164 __isl_give LIST(EL) *FN(LIST(EL),drop)(__isl_take LIST(EL) *list,
  173 			"index out of bounds", return FN(LIST(EL),free)(list));
  176 	list = FN(LIST(EL),cow)(list);
  180 		FN(EL,free)(list->p[first + i]);
  194 __isl_give LIST(EL) *FN(LIST(EL),insert)(__isl_take LIST(EL) *list,
  194 __isl_give LIST(EL) *FN(LIST(EL),insert)(__isl_take LIST(EL) *list,
  194 __isl_give LIST(EL) *FN(LIST(EL),insert)(__isl_take LIST(EL) *list,
  195 	unsigned pos, __isl_take struct EL *el)
  199 	LIST(EL) *res;
  203 	ctx = FN(LIST(EL),get_ctx)(list);
  216 	res = FN(LIST(EL),alloc)(ctx, list->n + 1);
  218 		res = FN(LIST(EL),add)(res, FN(EL,copy)(list->p[i]));
  218 		res = FN(LIST(EL),add)(res, FN(EL,copy)(list->p[i]));
  219 	res = FN(LIST(EL),add)(res, el);
  221 		res = FN(LIST(EL),add)(res, FN(EL,copy)(list->p[i]));
  221 		res = FN(LIST(EL),add)(res, FN(EL,copy)(list->p[i]));
  222 	FN(LIST(EL),free)(list);
  226 	FN(EL,free)(el);
  227 	FN(LIST(EL),free)(list);
  231 __isl_null LIST(EL) *FN(LIST(EL),free)(__isl_take LIST(EL) *list)
  231 __isl_null LIST(EL) *FN(LIST(EL),free)(__isl_take LIST(EL) *list)
  231 __isl_null LIST(EL) *FN(LIST(EL),free)(__isl_take LIST(EL) *list)
  243 		FN(EL,free)(list->p[i]);
  251 int FN(LIST(EL),size)(__isl_keep LIST(EL) *list)
  251 int FN(LIST(EL),size)(__isl_keep LIST(EL) *list)
  258 int FN(FN(LIST(EL),n),BASE)(__isl_keep LIST(EL) *list)
  258 int FN(FN(LIST(EL),n),BASE)(__isl_keep LIST(EL) *list)
  260 	return FN(LIST(EL),size)(list);
  265 static __isl_keep EL *FN(LIST(EL),peek)(__isl_keep LIST(EL) *list, int index)
  265 static __isl_keep EL *FN(LIST(EL),peek)(__isl_keep LIST(EL) *list, int index)
  265 static __isl_keep EL *FN(LIST(EL),peek)(__isl_keep LIST(EL) *list, int index)
  267 	if (FN(LIST(EL),check_index)(list, index) < 0)
  274 __isl_give EL *FN(LIST(EL),get_at)(__isl_keep LIST(EL) *list, int index)
  274 __isl_give EL *FN(LIST(EL),get_at)(__isl_keep LIST(EL) *list, int index)
  274 __isl_give EL *FN(LIST(EL),get_at)(__isl_keep LIST(EL) *list, int index)
  276 	return FN(EL,copy)(FN(LIST(EL),peek)(list, index));
  276 	return FN(EL,copy)(FN(LIST(EL),peek)(list, index));
  281 __isl_give EL *FN(FN(LIST(EL),get),BASE)(__isl_keep LIST(EL) *list, int index)
  281 __isl_give EL *FN(FN(LIST(EL),get),BASE)(__isl_keep LIST(EL) *list, int index)
  281 __isl_give EL *FN(FN(LIST(EL),get),BASE)(__isl_keep LIST(EL) *list, int index)
  283 	return FN(LIST(EL),get_at)(list, index);
  288 __isl_give LIST(EL) *FN(FN(LIST(EL),set),BASE)(__isl_take LIST(EL) *list,
  288 __isl_give LIST(EL) *FN(FN(LIST(EL),set),BASE)(__isl_take LIST(EL) *list,
  288 __isl_give LIST(EL) *FN(FN(LIST(EL),set),BASE)(__isl_take LIST(EL) *list,
  289 	int index, __isl_take EL *el)
  293 	if (FN(LIST(EL),check_index)(list, index) < 0)
  296 		FN(EL,free)(el);
  299 	list = FN(LIST(EL),cow)(list);
  302 	FN(EL,free)(list->p[index]);
  306 	FN(EL,free)(el);
  307 	FN(LIST(EL),free)(list);
  321 static __isl_give EL *FN(FN(LIST(EL),take),BASE)(__isl_keep LIST(EL) *list,
  321 static __isl_give EL *FN(FN(LIST(EL),take),BASE)(__isl_keep LIST(EL) *list,
  321 static __isl_give EL *FN(FN(LIST(EL),take),BASE)(__isl_keep LIST(EL) *list,
  324 	EL *el;
  326 	if (FN(LIST(EL),check_index)(list, index) < 0)
  329 		return FN(FN(LIST(EL),get),BASE)(list, index);
  339 static __isl_give LIST(EL) *FN(FN(LIST(EL),restore),BASE)(
  339 static __isl_give LIST(EL) *FN(FN(LIST(EL),restore),BASE)(
  340 	__isl_take LIST(EL) *list, int index, __isl_take EL *el)
  340 	__isl_take LIST(EL) *list, int index, __isl_take EL *el)
  342 	return FN(FN(LIST(EL),set),BASE)(list, index, el);
  347 __isl_give LIST(EL) *FN(LIST(EL),swap)(__isl_take LIST(EL) *list,
  347 __isl_give LIST(EL) *FN(LIST(EL),swap)(__isl_take LIST(EL) *list,
  347 __isl_give LIST(EL) *FN(LIST(EL),swap)(__isl_take LIST(EL) *list,
  350 	EL *el1, *el2;
  354 	el1 = FN(FN(LIST(EL),take),BASE)(list, pos1);
  355 	el2 = FN(FN(LIST(EL),take),BASE)(list, pos2);
  356 	list = FN(FN(LIST(EL),restore),BASE)(list, pos1, el2);
  357 	list = FN(FN(LIST(EL),restore),BASE)(list, pos2, el1);
  363 __isl_give LIST(EL) *FN(LIST(EL),reverse)(__isl_take LIST(EL) *list)
  363 __isl_give LIST(EL) *FN(LIST(EL),reverse)(__isl_take LIST(EL) *list)
  363 __isl_give LIST(EL) *FN(LIST(EL),reverse)(__isl_take LIST(EL) *list)
  367 	n = FN(LIST(EL),size)(list);
  369 		list = FN(LIST(EL),swap)(list, i, n - 1 - i);
  373 isl_stat FN(LIST(EL),foreach)(__isl_keep LIST(EL) *list,
  373 isl_stat FN(LIST(EL),foreach)(__isl_keep LIST(EL) *list,
  374 	isl_stat (*fn)(__isl_take EL *el, void *user), void *user)
  382 		EL *el = FN(EL,copy)(list->p[i]);
  382 		EL *el = FN(EL,copy)(list->p[i]);
  395 __isl_give LIST(EL) *FN(LIST(EL),map)(__isl_keep LIST(EL) *list,
  395 __isl_give LIST(EL) *FN(LIST(EL),map)(__isl_keep LIST(EL) *list,
  395 __isl_give LIST(EL) *FN(LIST(EL),map)(__isl_keep LIST(EL) *list,
  396 	__isl_give EL *(*fn)(__isl_take EL *el, void *user), void *user)
  396 	__isl_give EL *(*fn)(__isl_take EL *el, void *user), void *user)
  405 		EL *el = FN(FN(LIST(EL),take),BASE)(list, i);
  405 		EL *el = FN(FN(LIST(EL),take),BASE)(list, i);
  407 			return FN(LIST(EL),free)(list);
  409 		list = FN(FN(LIST(EL),restore),BASE)(list, i, el);
  420 S(LIST(EL),sort_data) {
  421 	int (*cmp)(__isl_keep EL *a, __isl_keep EL *b, void *user);
  421 	int (*cmp)(__isl_keep EL *a, __isl_keep EL *b, void *user);
  428 static int FN(LIST(EL),cmp)(const void *a, const void *b, void *user)
  430 	S(LIST(EL),sort_data) *data = user;
  431 	EL * const *el1 = a;
  432 	EL * const *el2 = b;
  440 __isl_give LIST(EL) *FN(LIST(EL),sort)(__isl_take LIST(EL) *list,
  440 __isl_give LIST(EL) *FN(LIST(EL),sort)(__isl_take LIST(EL) *list,
  440 __isl_give LIST(EL) *FN(LIST(EL),sort)(__isl_take LIST(EL) *list,
  441 	int (*cmp)(__isl_keep EL *a, __isl_keep EL *b, void *user), void *user)
  441 	int (*cmp)(__isl_keep EL *a, __isl_keep EL *b, void *user), void *user)
  443 	S(LIST(EL),sort_data) data = { cmp, user };
  449 	list = FN(LIST(EL),cow)(list);
  454 			&FN(LIST(EL),cmp), &data) < 0)
  455 		return FN(LIST(EL),free)(list);
  465 S(LIST(EL),foreach_scc_data) {
  466 	LIST(EL) *list;
  467 	isl_bool (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user);
  467 	isl_bool (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user);
  475 static isl_bool FN(LIST(EL),follows)(int i, int j, void *user)
  477 	S(LIST(EL),foreach_scc_data) *data = user;
  486 static isl_stat FN(LIST(EL),call_on_scc)(__isl_keep LIST(EL) *list, int *pos,
  486 static isl_stat FN(LIST(EL),call_on_scc)(__isl_keep LIST(EL) *list, int *pos,
  487 	int n, isl_stat (*fn)(__isl_take LIST(EL) *scc, void *user), void *user)
  491 	LIST(EL) *slice;
  493 	ctx = FN(LIST(EL),get_ctx)(list);
  494 	slice = FN(LIST(EL),alloc)(ctx, n);
  496 		EL *el;
  498 		el = FN(EL,copy)(list->p[pos[i]]);
  499 		slice = FN(LIST(EL),add)(slice, el);
  517 isl_stat FN(LIST(EL),foreach_scc)(__isl_keep LIST(EL) *list,
  517 isl_stat FN(LIST(EL),foreach_scc)(__isl_keep LIST(EL) *list,
  518 	isl_bool (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user),
  518 	isl_bool (*follows)(__isl_keep EL *a, __isl_keep EL *b, void *user),
  520 	isl_stat (*fn)(__isl_take LIST(EL) *scc, void *user), void *fn_user)
  522 	S(LIST(EL),foreach_scc_data) data = { list, follows, follows_user };
  532 		return fn(FN(LIST(EL),copy)(list), fn_user);
  534 	ctx = FN(LIST(EL),get_ctx)(list);
  536 	g = isl_tarjan_graph_init(ctx, n, &FN(LIST(EL),follows), &data);
  553 			return fn(FN(LIST(EL),copy)(list), fn_user);
  555 		if (FN(LIST(EL),call_on_scc)(list, g->order + first, i - first,
  566 __isl_give LIST(EL) *FN(FN(LIST(EL),from),BASE)(__isl_take EL *el)
  566 __isl_give LIST(EL) *FN(FN(LIST(EL),from),BASE)(__isl_take EL *el)
  566 __isl_give LIST(EL) *FN(FN(LIST(EL),from),BASE)(__isl_take EL *el)
  569 	LIST(EL) *list;
  573 	ctx = FN(EL,get_ctx)(el);
  574 	list = FN(LIST(EL),alloc)(ctx, 1);
  577 	list = FN(LIST(EL),add)(list, el);
  580 	FN(EL,free)(el);
  588 static __isl_give LIST(EL) *FN(LIST(EL),concat_inplace)(
  588 static __isl_give LIST(EL) *FN(LIST(EL),concat_inplace)(
  589 	__isl_take LIST(EL) *list1, __isl_take LIST(EL) *list2)
  589 	__isl_take LIST(EL) *list1, __isl_take LIST(EL) *list2)
  594 		list1 = FN(LIST(EL),add)(list1, FN(EL,copy)(list2->p[i]));
  594 		list1 = FN(LIST(EL),add)(list1, FN(EL,copy)(list2->p[i]));
  595 	FN(LIST(EL),free)(list2);
  604 __isl_give LIST(EL) *FN(LIST(EL),concat)(__isl_take LIST(EL) *list1,
  604 __isl_give LIST(EL) *FN(LIST(EL),concat)(__isl_take LIST(EL) *list1,
  604 __isl_give LIST(EL) *FN(LIST(EL),concat)(__isl_take LIST(EL) *list1,
  605 	__isl_take LIST(EL) *list2)
  609 	LIST(EL) *res;
  615 		return FN(LIST(EL),concat_inplace)(list1, list2);
  617 	ctx = FN(LIST(EL),get_ctx)(list1);
  618 	res = FN(LIST(EL),alloc)(ctx, list1->n + list2->n);
  620 		res = FN(LIST(EL),add)(res, FN(EL,copy)(list1->p[i]));
  620 		res = FN(LIST(EL),add)(res, FN(EL,copy)(list1->p[i]));
  622 		res = FN(LIST(EL),add)(res, FN(EL,copy)(list2->p[i]));
  622 		res = FN(LIST(EL),add)(res, FN(EL,copy)(list2->p[i]));
  624 	FN(LIST(EL),free)(list1);
  625 	FN(LIST(EL),free)(list2);
  628 	FN(LIST(EL),free)(list1);
  629 	FN(LIST(EL),free)(list2);
  634 	__isl_take isl_printer *p, __isl_keep LIST(EL) *list)
  653 void FN(LIST(EL),dump)(__isl_keep LIST(EL) *list)
  653 void FN(LIST(EL),dump)(__isl_keep LIST(EL) *list)
  660 	printer = isl_printer_to_file(FN(LIST(EL),get_ctx)(list), stderr);