Coverage Report

Created: 2018-07-17 09:43

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/polly/lib/External/isl/isl_multi_union_pw_aff_explicit_domain.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2017      Sven Verdoolaege
3
 *
4
 * Use of this software is governed by the MIT license
5
 *
6
 * Written by Sven Verdoolaege.
7
 */
8
9
/* Initialize the explicit domain of "mupa".
10
 *
11
 * The explicit domain is initialized to a universe parameter set.
12
 * It may later be specialized with constraints on the parameter or
13
 * specific domain instances.
14
 */
15
static __isl_give isl_multi_union_pw_aff *
16
isl_multi_union_pw_aff_init_explicit_domain(
17
  __isl_take isl_multi_union_pw_aff *mupa)
18
4.18k
{
19
4.18k
  isl_space *space;
20
4.18k
21
4.18k
  if (isl_multi_union_pw_aff_check_has_explicit_domain(mupa) < 0)
22
0
    return isl_multi_union_pw_aff_free(mupa);
23
4.18k
  space = isl_space_params(isl_multi_union_pw_aff_get_space(mupa));
24
4.18k
  mupa->u.dom = isl_union_set_from_set(isl_set_universe(space));
25
4.18k
  if (!mupa->u.dom)
26
0
    return isl_multi_union_pw_aff_free(mupa);
27
4.18k
  return mupa;
28
4.18k
}
29
30
/* Drop the "n" dimensions of type "type" starting at position "pos"
31
 * of the explicit domain of "mupa".
32
 */
33
static __isl_give isl_multi_union_pw_aff *
34
isl_multi_union_pw_aff_drop_explicit_domain_dims(
35
  __isl_take isl_multi_union_pw_aff *mupa,
36
  enum isl_dim_type type, unsigned pos, unsigned n)
37
0
{
38
0
  if (isl_multi_union_pw_aff_check_has_explicit_domain(mupa) < 0)
39
0
    return isl_multi_union_pw_aff_free(mupa);
40
0
  if (type != isl_dim_param)
41
0
    isl_die(isl_multi_union_pw_aff_get_ctx(mupa), isl_error_invalid,
42
0
      "can only drop parameters",
43
0
      return isl_multi_union_pw_aff_free(mupa));
44
0
  mupa = isl_multi_union_pw_aff_cow(mupa);
45
0
  if (!mupa)
46
0
    return NULL;
47
0
  mupa->u.dom = isl_union_set_project_out(mupa->u.dom, type, pos, n);
48
0
  if (!mupa->u.dom)
49
0
    return isl_multi_union_pw_aff_free(mupa);
50
0
  return mupa;
51
0
}