Bug Summary

File:tools/polly/lib/External/isl/isl_schedule_read.c
Warning:line 452, column 2
Value stored to 'key' is never read

Annotated Source Code

1#include <string.h>
2
3#include <isl/schedule.h>
4#include <isl/stream.h>
5#include <isl_schedule_private.h>
6#include <isl_schedule_tree.h>
7
8/* An enumeration of the various keys that may appear in a YAML mapping
9 * of a schedule.
10 */
11enum isl_schedule_key {
12 isl_schedule_key_error = -1,
13 isl_schedule_key_child,
14 isl_schedule_key_coincident,
15 isl_schedule_key_context,
16 isl_schedule_key_contraction,
17 isl_schedule_key_domain,
18 isl_schedule_key_expansion,
19 isl_schedule_key_extension,
20 isl_schedule_key_filter,
21 isl_schedule_key_guard,
22 isl_schedule_key_leaf,
23 isl_schedule_key_mark,
24 isl_schedule_key_options,
25 isl_schedule_key_permutable,
26 isl_schedule_key_schedule,
27 isl_schedule_key_sequence,
28 isl_schedule_key_set
29};
30
31/* Extract a mapping key from the token "tok".
32 * Return isl_schedule_key_error on error, i.e., if "tok" does not
33 * correspond to any known key.
34 */
35static enum isl_schedule_key extract_key(__isl_keep isl_stream *s,
36 struct isl_token *tok)
37{
38 int type;
39 char *name;
40 enum isl_schedule_key key;
41 isl_ctx *ctx;
42
43 ctx = isl_stream_get_ctx(s);
44 type = isl_token_get_type(tok);
45 if (type != ISL_TOKEN_IDENT && type != ISL_TOKEN_STRING) {
46 isl_stream_error(s, tok, "expecting key");
47 return isl_schedule_key_error;
48 }
49 name = isl_token_get_str(ctx, tok);
50 if (!strcmp(name, "child")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("child") && (
__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("child"), (!((size_t)(const void *)((name) + 1) - (size_t)(
const void *)(name) == 1) || __s1_len >= 4) && (!(
(size_t)(const void *)(("child") + 1) - (size_t)(const void *
)("child") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name
, "child") : (__builtin_constant_p (name) && ((size_t
)(const void *)((name) + 1) - (size_t)(const void *)(name) ==
1) && (__s1_len = __builtin_strlen (name), __s1_len <
4) ? (__builtin_constant_p ("child") && ((size_t)(const
void *)(("child") + 1) - (size_t)(const void *)("child") == 1
) ? __builtin_strcmp (name, "child") : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
("child"); int __result = (((const unsigned char *) (const char
*) (name))[0] - __s2[0]); if (__s1_len > 0 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
name))[1] - __s2[1]); if (__s1_len > 1 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
name))[2] - __s2[2]); if (__s1_len > 2 && __result
== 0) __result = (((const unsigned char *) (const char *) (name
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
"child") && ((size_t)(const void *)(("child") + 1) - (
size_t)(const void *)("child") == 1) && (__s2_len = __builtin_strlen
("child"), __s2_len < 4) ? (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) ? __builtin_strcmp (name, "child") : -(__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("child"))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("child"))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("child"))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("child"))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp
(name, "child")))); })
)
51 key = isl_schedule_key_child;
52 else if (!strcmp(name, "coincident")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("coincident") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("coincident"), (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s1_len >= 4) && (
!((size_t)(const void *)(("coincident") + 1) - (size_t)(const
void *)("coincident") == 1) || __s2_len >= 4)) ? __builtin_strcmp
(name, "coincident") : (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) && (__s1_len = __builtin_strlen (name), __s1_len
< 4) ? (__builtin_constant_p ("coincident") && ((
size_t)(const void *)(("coincident") + 1) - (size_t)(const void
*)("coincident") == 1) ? __builtin_strcmp (name, "coincident"
) : (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("coincident"); int __result = (((const
unsigned char *) (const char *) (name))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) (name))[1] - __s2[1]); if (__s1_len >
1 && __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s1_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; }))) : (
__builtin_constant_p ("coincident") && ((size_t)(const
void *)(("coincident") + 1) - (size_t)(const void *)("coincident"
) == 1) && (__s2_len = __builtin_strlen ("coincident"
), __s2_len < 4) ? (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) ? __builtin_strcmp (name, "coincident") : -(__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("coincident"))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("coincident"))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("coincident"))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("coincident"))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp
(name, "coincident")))); })
)
53 key = isl_schedule_key_coincident;
54 else if (!strcmp(name, "context")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("context") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("context"), (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s1_len >= 4) && (
!((size_t)(const void *)(("context") + 1) - (size_t)(const void
*)("context") == 1) || __s2_len >= 4)) ? __builtin_strcmp
(name, "context") : (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) && (__s1_len = __builtin_strlen (name), __s1_len
< 4) ? (__builtin_constant_p ("context") && ((size_t
)(const void *)(("context") + 1) - (size_t)(const void *)("context"
) == 1) ? __builtin_strcmp (name, "context") : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("context"); int __result = (((const unsigned char *
) (const char *) (name))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
("context") && ((size_t)(const void *)(("context") +
1) - (size_t)(const void *)("context") == 1) && (__s2_len
= __builtin_strlen ("context"), __s2_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp (name, "context"
) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("context"))[0] - __s2[0]); if (__s2_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("context"))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("context"))[2] - __s2[2]); if (__s2_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("context"))[3] - __s2[3]); } } __result
; }))) : __builtin_strcmp (name, "context")))); })
)
55 key = isl_schedule_key_context;
56 else if (!strcmp(name, "contraction")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("contraction") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("contraction"), (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s1_len >= 4) && (
!((size_t)(const void *)(("contraction") + 1) - (size_t)(const
void *)("contraction") == 1) || __s2_len >= 4)) ? __builtin_strcmp
(name, "contraction") : (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) && (__s1_len = __builtin_strlen (name), __s1_len
< 4) ? (__builtin_constant_p ("contraction") && (
(size_t)(const void *)(("contraction") + 1) - (size_t)(const void
*)("contraction") == 1) ? __builtin_strcmp (name, "contraction"
) : (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("contraction"); int __result = (((const
unsigned char *) (const char *) (name))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) (name))[1] - __s2[1]); if (__s1_len >
1 && __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s1_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; }))) : (
__builtin_constant_p ("contraction") && ((size_t)(const
void *)(("contraction") + 1) - (size_t)(const void *)("contraction"
) == 1) && (__s2_len = __builtin_strlen ("contraction"
), __s2_len < 4) ? (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) ? __builtin_strcmp (name, "contraction") : -(__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("contraction"))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("contraction"))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("contraction"))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("contraction"))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp
(name, "contraction")))); })
)
57 key = isl_schedule_key_contraction;
58 else if (!strcmp(name, "domain")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("domain") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("domain"), (!((size_t)(const void *)((name) + 1) - (size_t)
(const void *)(name) == 1) || __s1_len >= 4) && (!
((size_t)(const void *)(("domain") + 1) - (size_t)(const void
*)("domain") == 1) || __s2_len >= 4)) ? __builtin_strcmp (
name, "domain") : (__builtin_constant_p (name) && ((size_t
)(const void *)((name) + 1) - (size_t)(const void *)(name) ==
1) && (__s1_len = __builtin_strlen (name), __s1_len <
4) ? (__builtin_constant_p ("domain") && ((size_t)(const
void *)(("domain") + 1) - (size_t)(const void *)("domain") ==
1) ? __builtin_strcmp (name, "domain") : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
("domain"); int __result = (((const unsigned char *) (const char
*) (name))[0] - __s2[0]); if (__s1_len > 0 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
name))[1] - __s2[1]); if (__s1_len > 1 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
name))[2] - __s2[2]); if (__s1_len > 2 && __result
== 0) __result = (((const unsigned char *) (const char *) (name
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
"domain") && ((size_t)(const void *)(("domain") + 1) -
(size_t)(const void *)("domain") == 1) && (__s2_len =
__builtin_strlen ("domain"), __s2_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp (name, "domain"
) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("domain"))[0] - __s2[0]); if (__s2_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("domain"))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("domain"))[2] - __s2[2]); if (__s2_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("domain"))[3] - __s2[3]); } } __result
; }))) : __builtin_strcmp (name, "domain")))); })
)
59 key = isl_schedule_key_domain;
60 else if (!strcmp(name, "expansion")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("expansion") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("expansion"), (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s1_len >= 4) && (
!((size_t)(const void *)(("expansion") + 1) - (size_t)(const void
*)("expansion") == 1) || __s2_len >= 4)) ? __builtin_strcmp
(name, "expansion") : (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) && (__s1_len = __builtin_strlen (name), __s1_len
< 4) ? (__builtin_constant_p ("expansion") && ((size_t
)(const void *)(("expansion") + 1) - (size_t)(const void *)("expansion"
) == 1) ? __builtin_strcmp (name, "expansion") : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("expansion"); int __result = (((const unsigned char
*) (const char *) (name))[0] - __s2[0]); if (__s1_len > 0
&& __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[1] - __s2[1]); if (__s1_len > 1
&& __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s1_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; }))) : (
__builtin_constant_p ("expansion") && ((size_t)(const
void *)(("expansion") + 1) - (size_t)(const void *)("expansion"
) == 1) && (__s2_len = __builtin_strlen ("expansion")
, __s2_len < 4) ? (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) ? __builtin_strcmp (name, "expansion") : -(__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("expansion"))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("expansion"))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("expansion"))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("expansion"))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp
(name, "expansion")))); })
)
61 key = isl_schedule_key_expansion;
62 else if (!strcmp(name, "extension")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("extension") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("extension"), (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s1_len >= 4) && (
!((size_t)(const void *)(("extension") + 1) - (size_t)(const void
*)("extension") == 1) || __s2_len >= 4)) ? __builtin_strcmp
(name, "extension") : (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) && (__s1_len = __builtin_strlen (name), __s1_len
< 4) ? (__builtin_constant_p ("extension") && ((size_t
)(const void *)(("extension") + 1) - (size_t)(const void *)("extension"
) == 1) ? __builtin_strcmp (name, "extension") : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("extension"); int __result = (((const unsigned char
*) (const char *) (name))[0] - __s2[0]); if (__s1_len > 0
&& __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[1] - __s2[1]); if (__s1_len > 1
&& __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s1_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; }))) : (
__builtin_constant_p ("extension") && ((size_t)(const
void *)(("extension") + 1) - (size_t)(const void *)("extension"
) == 1) && (__s2_len = __builtin_strlen ("extension")
, __s2_len < 4) ? (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) ? __builtin_strcmp (name, "extension") : -(__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("extension"))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("extension"))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("extension"))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("extension"))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp
(name, "extension")))); })
)
63 key = isl_schedule_key_extension;
64 else if (!strcmp(name, "filter")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("filter") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("filter"), (!((size_t)(const void *)((name) + 1) - (size_t)
(const void *)(name) == 1) || __s1_len >= 4) && (!
((size_t)(const void *)(("filter") + 1) - (size_t)(const void
*)("filter") == 1) || __s2_len >= 4)) ? __builtin_strcmp (
name, "filter") : (__builtin_constant_p (name) && ((size_t
)(const void *)((name) + 1) - (size_t)(const void *)(name) ==
1) && (__s1_len = __builtin_strlen (name), __s1_len <
4) ? (__builtin_constant_p ("filter") && ((size_t)(const
void *)(("filter") + 1) - (size_t)(const void *)("filter") ==
1) ? __builtin_strcmp (name, "filter") : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
("filter"); int __result = (((const unsigned char *) (const char
*) (name))[0] - __s2[0]); if (__s1_len > 0 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
name))[1] - __s2[1]); if (__s1_len > 1 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
name))[2] - __s2[2]); if (__s1_len > 2 && __result
== 0) __result = (((const unsigned char *) (const char *) (name
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
"filter") && ((size_t)(const void *)(("filter") + 1) -
(size_t)(const void *)("filter") == 1) && (__s2_len =
__builtin_strlen ("filter"), __s2_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp (name, "filter"
) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("filter"))[0] - __s2[0]); if (__s2_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("filter"))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("filter"))[2] - __s2[2]); if (__s2_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("filter"))[3] - __s2[3]); } } __result
; }))) : __builtin_strcmp (name, "filter")))); })
)
65 key = isl_schedule_key_filter;
66 else if (!strcmp(name, "guard")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("guard") && (
__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("guard"), (!((size_t)(const void *)((name) + 1) - (size_t)(
const void *)(name) == 1) || __s1_len >= 4) && (!(
(size_t)(const void *)(("guard") + 1) - (size_t)(const void *
)("guard") == 1) || __s2_len >= 4)) ? __builtin_strcmp (name
, "guard") : (__builtin_constant_p (name) && ((size_t
)(const void *)((name) + 1) - (size_t)(const void *)(name) ==
1) && (__s1_len = __builtin_strlen (name), __s1_len <
4) ? (__builtin_constant_p ("guard") && ((size_t)(const
void *)(("guard") + 1) - (size_t)(const void *)("guard") == 1
) ? __builtin_strcmp (name, "guard") : (__extension__ ({ const
unsigned char *__s2 = (const unsigned char *) (const char *)
("guard"); int __result = (((const unsigned char *) (const char
*) (name))[0] - __s2[0]); if (__s1_len > 0 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
name))[1] - __s2[1]); if (__s1_len > 1 && __result
== 0) { __result = (((const unsigned char *) (const char *) (
name))[2] - __s2[2]); if (__s1_len > 2 && __result
== 0) __result = (((const unsigned char *) (const char *) (name
))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
"guard") && ((size_t)(const void *)(("guard") + 1) - (
size_t)(const void *)("guard") == 1) && (__s2_len = __builtin_strlen
("guard"), __s2_len < 4) ? (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) ? __builtin_strcmp (name, "guard") : -(__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("guard"))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("guard"))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("guard"))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("guard"))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp
(name, "guard")))); })
)
67 key = isl_schedule_key_guard;
68 else if (!strcmp(name, "leaf")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("leaf") && (
__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("leaf"), (!((size_t)(const void *)((name) + 1) - (size_t)(const
void *)(name) == 1) || __s1_len >= 4) && (!((size_t
)(const void *)(("leaf") + 1) - (size_t)(const void *)("leaf"
) == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "leaf"
) : (__builtin_constant_p (name) && ((size_t)(const void
*)((name) + 1) - (size_t)(const void *)(name) == 1) &&
(__s1_len = __builtin_strlen (name), __s1_len < 4) ? (__builtin_constant_p
("leaf") && ((size_t)(const void *)(("leaf") + 1) - (
size_t)(const void *)("leaf") == 1) ? __builtin_strcmp (name,
"leaf") : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("leaf"); int __result = (((
const unsigned char *) (const char *) (name))[0] - __s2[0]); if
(__s1_len > 0 && __result == 0) { __result = (((const
unsigned char *) (const char *) (name))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (name))[2] - __s2[2]); if (__s1_len >
2 && __result == 0) __result = (((const unsigned char
*) (const char *) (name))[3] - __s2[3]); } } __result; }))) :
(__builtin_constant_p ("leaf") && ((size_t)(const void
*)(("leaf") + 1) - (size_t)(const void *)("leaf") == 1) &&
(__s2_len = __builtin_strlen ("leaf"), __s2_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp (name, "leaf")
: -(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("leaf"))[0] - __s2[0]); if (__s2_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("leaf"))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("leaf"))[2] - __s2[2]); if (__s2_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("leaf"))[3] - __s2[3]); } } __result
; }))) : __builtin_strcmp (name, "leaf")))); })
)
69 key = isl_schedule_key_leaf;
70 else if (!strcmp(name, "mark")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("mark") && (
__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("mark"), (!((size_t)(const void *)((name) + 1) - (size_t)(const
void *)(name) == 1) || __s1_len >= 4) && (!((size_t
)(const void *)(("mark") + 1) - (size_t)(const void *)("mark"
) == 1) || __s2_len >= 4)) ? __builtin_strcmp (name, "mark"
) : (__builtin_constant_p (name) && ((size_t)(const void
*)((name) + 1) - (size_t)(const void *)(name) == 1) &&
(__s1_len = __builtin_strlen (name), __s1_len < 4) ? (__builtin_constant_p
("mark") && ((size_t)(const void *)(("mark") + 1) - (
size_t)(const void *)("mark") == 1) ? __builtin_strcmp (name,
"mark") : (__extension__ ({ const unsigned char *__s2 = (const
unsigned char *) (const char *) ("mark"); int __result = (((
const unsigned char *) (const char *) (name))[0] - __s2[0]); if
(__s1_len > 0 && __result == 0) { __result = (((const
unsigned char *) (const char *) (name))[1] - __s2[1]); if (__s1_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) (name))[2] - __s2[2]); if (__s1_len >
2 && __result == 0) __result = (((const unsigned char
*) (const char *) (name))[3] - __s2[3]); } } __result; }))) :
(__builtin_constant_p ("mark") && ((size_t)(const void
*)(("mark") + 1) - (size_t)(const void *)("mark") == 1) &&
(__s2_len = __builtin_strlen ("mark"), __s2_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp (name, "mark")
: -(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("mark"))[0] - __s2[0]); if (__s2_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("mark"))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("mark"))[2] - __s2[2]); if (__s2_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("mark"))[3] - __s2[3]); } } __result
; }))) : __builtin_strcmp (name, "mark")))); })
)
71 key = isl_schedule_key_mark;
72 else if (!strcmp(name, "options")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("options") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("options"), (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s1_len >= 4) && (
!((size_t)(const void *)(("options") + 1) - (size_t)(const void
*)("options") == 1) || __s2_len >= 4)) ? __builtin_strcmp
(name, "options") : (__builtin_constant_p (name) && (
(size_t)(const void *)((name) + 1) - (size_t)(const void *)(name
) == 1) && (__s1_len = __builtin_strlen (name), __s1_len
< 4) ? (__builtin_constant_p ("options") && ((size_t
)(const void *)(("options") + 1) - (size_t)(const void *)("options"
) == 1) ? __builtin_strcmp (name, "options") : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("options"); int __result = (((const unsigned char *
) (const char *) (name))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
("options") && ((size_t)(const void *)(("options") +
1) - (size_t)(const void *)("options") == 1) && (__s2_len
= __builtin_strlen ("options"), __s2_len < 4) ? (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) ? __builtin_strcmp (name, "options"
) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) (name); int __result = (((const unsigned
char *) (const char *) ("options"))[0] - __s2[0]); if (__s2_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("options"))[1] - __s2[1]); if (__s2_len
> 1 && __result == 0) { __result = (((const unsigned
char *) (const char *) ("options"))[2] - __s2[2]); if (__s2_len
> 2 && __result == 0) __result = (((const unsigned
char *) (const char *) ("options"))[3] - __s2[3]); } } __result
; }))) : __builtin_strcmp (name, "options")))); })
)
73 key = isl_schedule_key_options;
74 else if (!strcmp(name, "schedule")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("schedule") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("schedule"), (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s1_len >= 4) && (
!((size_t)(const void *)(("schedule") + 1) - (size_t)(const void
*)("schedule") == 1) || __s2_len >= 4)) ? __builtin_strcmp
(name, "schedule") : (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) && (__s1_len = __builtin_strlen (name), __s1_len
< 4) ? (__builtin_constant_p ("schedule") && ((size_t
)(const void *)(("schedule") + 1) - (size_t)(const void *)("schedule"
) == 1) ? __builtin_strcmp (name, "schedule") : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("schedule"); int __result = (((const unsigned char *
) (const char *) (name))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
("schedule") && ((size_t)(const void *)(("schedule")
+ 1) - (size_t)(const void *)("schedule") == 1) && (
__s2_len = __builtin_strlen ("schedule"), __s2_len < 4) ? (
__builtin_constant_p (name) && ((size_t)(const void *
)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp
(name, "schedule") : -(__extension__ ({ const unsigned char *
__s2 = (const unsigned char *) (const char *) (name); int __result
= (((const unsigned char *) (const char *) ("schedule"))[0] -
__s2[0]); if (__s2_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("schedule"))[1] -
__s2[1]); if (__s2_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("schedule"))[2] -
__s2[2]); if (__s2_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) ("schedule"))[3] -
__s2[3]); } } __result; }))) : __builtin_strcmp (name, "schedule"
)))); })
)
75 key = isl_schedule_key_schedule;
76 else if (!strcmp(name, "sequence")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("sequence") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("sequence"), (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s1_len >= 4) && (
!((size_t)(const void *)(("sequence") + 1) - (size_t)(const void
*)("sequence") == 1) || __s2_len >= 4)) ? __builtin_strcmp
(name, "sequence") : (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) && (__s1_len = __builtin_strlen (name), __s1_len
< 4) ? (__builtin_constant_p ("sequence") && ((size_t
)(const void *)(("sequence") + 1) - (size_t)(const void *)("sequence"
) == 1) ? __builtin_strcmp (name, "sequence") : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("sequence"); int __result = (((const unsigned char *
) (const char *) (name))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
("sequence") && ((size_t)(const void *)(("sequence")
+ 1) - (size_t)(const void *)("sequence") == 1) && (
__s2_len = __builtin_strlen ("sequence"), __s2_len < 4) ? (
__builtin_constant_p (name) && ((size_t)(const void *
)((name) + 1) - (size_t)(const void *)(name) == 1) ? __builtin_strcmp
(name, "sequence") : -(__extension__ ({ const unsigned char *
__s2 = (const unsigned char *) (const char *) (name); int __result
= (((const unsigned char *) (const char *) ("sequence"))[0] -
__s2[0]); if (__s2_len > 0 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("sequence"))[1] -
__s2[1]); if (__s2_len > 1 && __result == 0) { __result
= (((const unsigned char *) (const char *) ("sequence"))[2] -
__s2[2]); if (__s2_len > 2 && __result == 0) __result
= (((const unsigned char *) (const char *) ("sequence"))[3] -
__s2[3]); } } __result; }))) : __builtin_strcmp (name, "sequence"
)))); })
)
77 key = isl_schedule_key_sequence;
78 else if (!strcmp(name, "set")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("set") && (__s1_len
= __builtin_strlen (name), __s2_len = __builtin_strlen ("set"
), (!((size_t)(const void *)((name) + 1) - (size_t)(const void
*)(name) == 1) || __s1_len >= 4) && (!((size_t)(const
void *)(("set") + 1) - (size_t)(const void *)("set") == 1) ||
__s2_len >= 4)) ? __builtin_strcmp (name, "set") : (__builtin_constant_p
(name) && ((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) && (__s1_len = __builtin_strlen
(name), __s1_len < 4) ? (__builtin_constant_p ("set") &&
((size_t)(const void *)(("set") + 1) - (size_t)(const void *
)("set") == 1) ? __builtin_strcmp (name, "set") : (__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) ("set"); int __result = (((const unsigned char *) (const
char *) (name))[0] - __s2[0]); if (__s1_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[1] - __s2[1]); if (__s1_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) (name))[2] - __s2[2]); if (__s1_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) (name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p
("set") && ((size_t)(const void *)(("set") + 1) - (size_t
)(const void *)("set") == 1) && (__s2_len = __builtin_strlen
("set"), __s2_len < 4) ? (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) ? __builtin_strcmp (name, "set") : -(__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("set"))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("set"))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("set"))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("set"))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp
(name, "set")))); })
)
79 key = isl_schedule_key_set;
80 else if (!strcmp(name, "permutable")__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p
(name) && __builtin_constant_p ("permutable") &&
(__s1_len = __builtin_strlen (name), __s2_len = __builtin_strlen
("permutable"), (!((size_t)(const void *)((name) + 1) - (size_t
)(const void *)(name) == 1) || __s1_len >= 4) && (
!((size_t)(const void *)(("permutable") + 1) - (size_t)(const
void *)("permutable") == 1) || __s2_len >= 4)) ? __builtin_strcmp
(name, "permutable") : (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) && (__s1_len = __builtin_strlen (name), __s1_len
< 4) ? (__builtin_constant_p ("permutable") && ((
size_t)(const void *)(("permutable") + 1) - (size_t)(const void
*)("permutable") == 1) ? __builtin_strcmp (name, "permutable"
) : (__extension__ ({ const unsigned char *__s2 = (const unsigned
char *) (const char *) ("permutable"); int __result = (((const
unsigned char *) (const char *) (name))[0] - __s2[0]); if (__s1_len
> 0 && __result == 0) { __result = (((const unsigned
char *) (const char *) (name))[1] - __s2[1]); if (__s1_len >
1 && __result == 0) { __result = (((const unsigned char
*) (const char *) (name))[2] - __s2[2]); if (__s1_len > 2
&& __result == 0) __result = (((const unsigned char *
) (const char *) (name))[3] - __s2[3]); } } __result; }))) : (
__builtin_constant_p ("permutable") && ((size_t)(const
void *)(("permutable") + 1) - (size_t)(const void *)("permutable"
) == 1) && (__s2_len = __builtin_strlen ("permutable"
), __s2_len < 4) ? (__builtin_constant_p (name) &&
((size_t)(const void *)((name) + 1) - (size_t)(const void *)
(name) == 1) ? __builtin_strcmp (name, "permutable") : -(__extension__
({ const unsigned char *__s2 = (const unsigned char *) (const
char *) (name); int __result = (((const unsigned char *) (const
char *) ("permutable"))[0] - __s2[0]); if (__s2_len > 0 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("permutable"))[1] - __s2[1]); if (__s2_len > 1 &&
__result == 0) { __result = (((const unsigned char *) (const
char *) ("permutable"))[2] - __s2[2]); if (__s2_len > 2 &&
__result == 0) __result = (((const unsigned char *) (const char
*) ("permutable"))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp
(name, "permutable")))); })
)
81 key = isl_schedule_key_permutable;
82 else
83 isl_die(ctx, isl_error_invalid, "unknown key",do { isl_handle_error(ctx, isl_error_invalid, "unknown key", "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 84); key = isl_schedule_key_error; } while (0)
84 key = isl_schedule_key_error)do { isl_handle_error(ctx, isl_error_invalid, "unknown key", "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 84); key = isl_schedule_key_error; } while (0)
;
85 free(name);
86 return key;
87}
88
89/* Read a key from "s" and return the corresponding enum.
90 * Return isl_schedule_key_error on error, i.e., if the first token
91 * on the stream does not correspond to any known key.
92 */
93static enum isl_schedule_key get_key(__isl_keep isl_stream *s)
94{
95 struct isl_token *tok;
96 enum isl_schedule_key key;
97
98 tok = isl_stream_next_token(s);
99 key = extract_key(s, tok);
100 isl_token_free(tok);
101
102 return key;
103}
104
105static __isl_give isl_schedule_tree *isl_stream_read_schedule_tree(
106 __isl_keep isl_stream *s);
107
108/* Read a subtree with context root node from "s".
109 */
110static __isl_give isl_schedule_tree *read_context(__isl_keep isl_stream *s)
111{
112 isl_set *context = NULL((void*)0);
113 isl_schedule_tree *tree;
114 isl_ctx *ctx;
115 struct isl_token *tok;
116 enum isl_schedule_key key;
117 char *str;
118 int more;
119
120 ctx = isl_stream_get_ctx(s);
121
122 key = get_key(s);
123
124 if (isl_stream_yaml_next(s) < 0)
125 return NULL((void*)0);
126
127 tok = isl_stream_next_token(s);
128 if (!tok) {
129 isl_stream_error(s, NULL((void*)0), "unexpected EOF");
130 return NULL((void*)0);
131 }
132 str = isl_token_get_str(ctx, tok);
133 context = isl_set_read_from_str(ctx, str);
134 free(str);
135 isl_token_free(tok);
136
137 more = isl_stream_yaml_next(s);
138 if (more < 0)
139 goto error;
140 if (!more) {
141 tree = isl_schedule_tree_from_context(context);
142 } else {
143 key = get_key(s);
144 if (key != isl_schedule_key_child)
145 isl_die(ctx, isl_error_invalid, "expecting child",do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 146); goto error; } while (0)
146 goto error)do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 146); goto error; } while (0)
;
147 if (isl_stream_yaml_next(s) < 0)
148 goto error;
149 tree = isl_stream_read_schedule_tree(s);
150 tree = isl_schedule_tree_insert_context(tree, context);
151 }
152
153 return tree;
154error:
155 isl_set_free(context);
156 return NULL((void*)0);
157}
158
159/* Read a subtree with domain root node from "s".
160 */
161static __isl_give isl_schedule_tree *read_domain(__isl_keep isl_stream *s)
162{
163 isl_union_set *domain = NULL((void*)0);
164 isl_schedule_tree *tree;
165 isl_ctx *ctx;
166 struct isl_token *tok;
167 enum isl_schedule_key key;
168 char *str;
169 int more;
170
171 ctx = isl_stream_get_ctx(s);
172
173 key = get_key(s);
174
175 if (isl_stream_yaml_next(s) < 0)
176 return NULL((void*)0);
177
178 tok = isl_stream_next_token(s);
179 if (!tok) {
180 isl_stream_error(s, NULL((void*)0), "unexpected EOF");
181 return NULL((void*)0);
182 }
183 str = isl_token_get_str(ctx, tok);
184 domain = isl_union_set_read_from_str(ctx, str);
185 free(str);
186 isl_token_free(tok);
187
188 more = isl_stream_yaml_next(s);
189 if (more < 0)
190 goto error;
191 if (!more) {
192 tree = isl_schedule_tree_from_domain(domain);
193 } else {
194 key = get_key(s);
195 if (key != isl_schedule_key_child)
196 isl_die(ctx, isl_error_invalid, "expecting child",do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 197); goto error; } while (0)
197 goto error)do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 197); goto error; } while (0)
;
198 if (isl_stream_yaml_next(s) < 0)
199 goto error;
200 tree = isl_stream_read_schedule_tree(s);
201 tree = isl_schedule_tree_insert_domain(tree, domain);
202 }
203
204 return tree;
205error:
206 isl_union_set_free(domain);
207 return NULL((void*)0);
208}
209
210/* Read a subtree with expansion root node from "s".
211 */
212static __isl_give isl_schedule_tree *read_expansion(isl_stream *s)
213{
214 isl_ctx *ctx;
215 isl_union_pw_multi_aff *contraction = NULL((void*)0);
216 isl_union_map *expansion = NULL((void*)0);
217 isl_schedule_tree *tree = NULL((void*)0);
218 int more;
219
220 ctx = isl_stream_get_ctx(s);
221
222 do {
223 struct isl_token *tok;
224 enum isl_schedule_key key;
225 char *str;
226
227 key = get_key(s);
228 if (isl_stream_yaml_next(s) < 0)
229 goto error;
230
231 switch (key) {
232 case isl_schedule_key_contraction:
233 isl_union_pw_multi_aff_free(contraction);
234 tok = isl_stream_next_token(s);
235 str = isl_token_get_str(ctx, tok);
236 contraction = isl_union_pw_multi_aff_read_from_str(ctx,
237 str);
238 free(str);
239 isl_token_free(tok);
240 if (!contraction)
241 goto error;
242 break;
243 case isl_schedule_key_expansion:
244 isl_union_map_free(expansion);
245 tok = isl_stream_next_token(s);
246 str = isl_token_get_str(ctx, tok);
247 expansion = isl_union_map_read_from_str(ctx, str);
248 free(str);
249 isl_token_free(tok);
250 if (!expansion)
251 goto error;
252 break;
253 case isl_schedule_key_child:
254 isl_schedule_tree_free(tree);
255 tree = isl_stream_read_schedule_tree(s);
256 if (!tree)
257 goto error;
258 break;
259 default:
260 isl_die(ctx, isl_error_invalid, "unexpected key",do { isl_handle_error(ctx, isl_error_invalid, "unexpected key"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 261); goto error; } while (0)
261 goto error)do { isl_handle_error(ctx, isl_error_invalid, "unexpected key"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 261); goto error; } while (0)
;
262 }
263 } while ((more = isl_stream_yaml_next(s)) > 0);
264
265 if (more < 0)
266 goto error;
267
268 if (!contraction)
269 isl_die(ctx, isl_error_invalid, "missing contraction",do { isl_handle_error(ctx, isl_error_invalid, "missing contraction"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 270); goto error; } while (0)
270 goto error)do { isl_handle_error(ctx, isl_error_invalid, "missing contraction"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 270); goto error; } while (0)
;
271 if (!expansion)
272 isl_die(ctx, isl_error_invalid, "missing expansion",do { isl_handle_error(ctx, isl_error_invalid, "missing expansion"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 273); goto error; } while (0)
273 goto error)do { isl_handle_error(ctx, isl_error_invalid, "missing expansion"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 273); goto error; } while (0)
;
274
275 if (!tree)
276 return isl_schedule_tree_from_expansion(contraction, expansion);
277 return isl_schedule_tree_insert_expansion(tree, contraction, expansion);
278error:
279 isl_schedule_tree_free(tree);
280 isl_union_pw_multi_aff_free(contraction);
281 isl_union_map_free(expansion);
282 return NULL((void*)0);
283}
284
285/* Read a subtree with extension root node from "s".
286 */
287static __isl_give isl_schedule_tree *read_extension(isl_stream *s)
288{
289 isl_union_map *extension = NULL((void*)0);
290 isl_schedule_tree *tree;
291 isl_ctx *ctx;
292 struct isl_token *tok;
293 enum isl_schedule_key key;
294 char *str;
295 int more;
296
297 ctx = isl_stream_get_ctx(s);
298
299 key = get_key(s);
300
301 if (isl_stream_yaml_next(s) < 0)
302 return NULL((void*)0);
303
304 tok = isl_stream_next_token(s);
305 if (!tok) {
306 isl_stream_error(s, NULL((void*)0), "unexpected EOF");
307 return NULL((void*)0);
308 }
309 str = isl_token_get_str(ctx, tok);
310 extension = isl_union_map_read_from_str(ctx, str);
311 free(str);
312 isl_token_free(tok);
313
314 more = isl_stream_yaml_next(s);
315 if (more < 0)
316 goto error;
317 if (!more) {
318 tree = isl_schedule_tree_from_extension(extension);
319 } else {
320 key = get_key(s);
321 if (key != isl_schedule_key_child)
322 isl_die(ctx, isl_error_invalid, "expecting child",do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 323); goto error; } while (0)
323 goto error)do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 323); goto error; } while (0)
;
324 if (isl_stream_yaml_next(s) < 0)
325 goto error;
326 tree = isl_stream_read_schedule_tree(s);
327 tree = isl_schedule_tree_insert_extension(tree, extension);
328 }
329
330 return tree;
331error:
332 isl_union_map_free(extension);
333 return NULL((void*)0);
334}
335
336/* Read a subtree with filter root node from "s".
337 */
338static __isl_give isl_schedule_tree *read_filter(__isl_keep isl_stream *s)
339{
340 isl_union_set *filter = NULL((void*)0);
341 isl_schedule_tree *tree;
342 isl_ctx *ctx;
343 struct isl_token *tok;
344 enum isl_schedule_key key;
345 char *str;
346 int more;
347
348 ctx = isl_stream_get_ctx(s);
349
350 key = get_key(s);
351
352 if (isl_stream_yaml_next(s) < 0)
353 return NULL((void*)0);
354
355 tok = isl_stream_next_token(s);
356 if (!tok) {
357 isl_stream_error(s, NULL((void*)0), "unexpected EOF");
358 return NULL((void*)0);
359 }
360 str = isl_token_get_str(ctx, tok);
361 filter = isl_union_set_read_from_str(ctx, str);
362 free(str);
363 isl_token_free(tok);
364
365 more = isl_stream_yaml_next(s);
366 if (more < 0)
367 goto error;
368 if (!more) {
369 tree = isl_schedule_tree_from_filter(filter);
370 } else {
371 key = get_key(s);
372 if (key != isl_schedule_key_child)
373 isl_die(ctx, isl_error_invalid, "expecting child",do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 374); goto error; } while (0)
374 goto error)do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 374); goto error; } while (0)
;
375 if (isl_stream_yaml_next(s) < 0)
376 goto error;
377 tree = isl_stream_read_schedule_tree(s);
378 tree = isl_schedule_tree_insert_filter(tree, filter);
379 }
380
381 return tree;
382error:
383 isl_union_set_free(filter);
384 return NULL((void*)0);
385}
386
387/* Read a subtree with guard root node from "s".
388 */
389static __isl_give isl_schedule_tree *read_guard(isl_stream *s)
390{
391 isl_set *guard = NULL((void*)0);
392 isl_schedule_tree *tree;
393 isl_ctx *ctx;
394 struct isl_token *tok;
395 enum isl_schedule_key key;
396 char *str;
397 int more;
398
399 ctx = isl_stream_get_ctx(s);
400
401 key = get_key(s);
402
403 if (isl_stream_yaml_next(s) < 0)
404 return NULL((void*)0);
405
406 tok = isl_stream_next_token(s);
407 if (!tok) {
408 isl_stream_error(s, NULL((void*)0), "unexpected EOF");
409 return NULL((void*)0);
410 }
411 str = isl_token_get_str(ctx, tok);
412 guard = isl_set_read_from_str(ctx, str);
413 free(str);
414 isl_token_free(tok);
415
416 more = isl_stream_yaml_next(s);
417 if (more < 0)
418 goto error;
419 if (!more) {
420 tree = isl_schedule_tree_from_guard(guard);
421 } else {
422 key = get_key(s);
423 if (key != isl_schedule_key_child)
424 isl_die(ctx, isl_error_invalid, "expecting child",do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 425); goto error; } while (0)
425 goto error)do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 425); goto error; } while (0)
;
426 if (isl_stream_yaml_next(s) < 0)
427 goto error;
428 tree = isl_stream_read_schedule_tree(s);
429 tree = isl_schedule_tree_insert_guard(tree, guard);
430 }
431
432 return tree;
433error:
434 isl_set_free(guard);
435 return NULL((void*)0);
436}
437
438/* Read a subtree with mark root node from "s".
439 */
440static __isl_give isl_schedule_tree *read_mark(isl_stream *s)
441{
442 isl_id *mark;
443 isl_schedule_tree *tree;
444 isl_ctx *ctx;
445 struct isl_token *tok;
446 enum isl_schedule_key key;
447 char *str;
448 int more;
449
450 ctx = isl_stream_get_ctx(s);
451
452 key = get_key(s);
Value stored to 'key' is never read
453
454 if (isl_stream_yaml_next(s) < 0)
455 return NULL((void*)0);
456
457 tok = isl_stream_next_token(s);
458 if (!tok) {
459 isl_stream_error(s, NULL((void*)0), "unexpected EOF");
460 return NULL((void*)0);
461 }
462 str = isl_token_get_str(ctx, tok);
463 mark = isl_id_alloc(ctx, str, NULL((void*)0));
464 free(str);
465 isl_token_free(tok);
466
467 more = isl_stream_yaml_next(s);
468 if (more < 0)
469 goto error;
470 if (!more) {
471 isl_die(ctx, isl_error_invalid, "expecting child",do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 472); goto error; } while (0)
472 goto error)do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 472); goto error; } while (0)
;
473 } else {
474 key = get_key(s);
475 if (key != isl_schedule_key_child)
476 isl_die(ctx, isl_error_invalid, "expecting child",do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 477); goto error; } while (0)
477 goto error)do { isl_handle_error(ctx, isl_error_invalid, "expecting child"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 477); goto error; } while (0)
;
478 if (isl_stream_yaml_next(s) < 0)
479 goto error;
480 tree = isl_stream_read_schedule_tree(s);
481 tree = isl_schedule_tree_insert_mark(tree, mark);
482 }
483
484 return tree;
485error:
486 isl_id_free(mark);
487 return NULL((void*)0);
488}
489
490/* Read a sequence of integers from "s" (representing the coincident
491 * property of a band node).
492 */
493static __isl_give isl_val_list *read_coincident(__isl_keep isl_stream *s)
494{
495 isl_ctx *ctx;
496 isl_val_list *list;
497 int more;
498
499 ctx = isl_stream_get_ctx(s);
500
501 if (isl_stream_yaml_read_start_sequence(s) < 0)
502 return NULL((void*)0);
503
504 list = isl_val_list_alloc(ctx, 0);
505 while ((more = isl_stream_yaml_next(s)) > 0) {
506 isl_val *val;
507
508 val = isl_stream_read_val(s);
509 list = isl_val_list_add(list, val);
510 }
511
512 if (more < 0 || isl_stream_yaml_read_end_sequence(s))
513 list = isl_val_list_free(list);
514
515 return list;
516}
517
518/* Set the (initial) coincident properties of "band" according to
519 * the (initial) elements of "coincident".
520 */
521static __isl_give isl_schedule_band *set_coincident(
522 __isl_take isl_schedule_band *band, __isl_take isl_val_list *coincident)
523{
524 int i;
525 int n, m;
526
527 n = isl_schedule_band_n_member(band);
528 m = isl_val_list_n_val(coincident);
529
530 for (i = 0; i < n && i < m; ++i) {
531 isl_val *v;
532
533 v = isl_val_list_get_val(coincident, i);
534 if (!v)
535 band = isl_schedule_band_free(band);
536 band = isl_schedule_band_member_set_coincident(band, i,
537 !isl_val_is_zero(v));
538 isl_val_free(v);
539 }
540 isl_val_list_free(coincident);
541 return band;
542}
543
544/* Read a subtree with band root node from "s".
545 */
546static __isl_give isl_schedule_tree *read_band(isl_stream *s)
547{
548 isl_multi_union_pw_aff *schedule = NULL((void*)0);
549 isl_schedule_tree *tree = NULL((void*)0);
550 isl_val_list *coincident = NULL((void*)0);
551 isl_union_set *options = NULL((void*)0);
552 isl_ctx *ctx;
553 isl_schedule_band *band;
554 int permutable = 0;
555 int more;
556
557 ctx = isl_stream_get_ctx(s);
558
559 do {
560 struct isl_token *tok;
561 enum isl_schedule_key key;
562 char *str;
563 isl_val *v;
564
565 key = get_key(s);
566 if (isl_stream_yaml_next(s) < 0)
567 goto error;
568
569 switch (key) {
570 case isl_schedule_key_schedule:
571 schedule = isl_multi_union_pw_aff_free(schedule);
572 tok = isl_stream_next_token(s);
573 if (!tok) {
574 isl_stream_error(s, NULL((void*)0), "unexpected EOF");
575 goto error;
576 }
577 str = isl_token_get_str(ctx, tok);
578 schedule = isl_multi_union_pw_aff_read_from_str(ctx,
579 str);
580 free(str);
581 isl_token_free(tok);
582 if (!schedule)
583 goto error;
584 break;
585 case isl_schedule_key_coincident:
586 coincident = read_coincident(s);
587 if (!coincident)
588 goto error;
589 break;
590 case isl_schedule_key_permutable:
591 v = isl_stream_read_val(s);
592 permutable = !isl_val_is_zero(v);
593 isl_val_free(v);
594 break;
595 case isl_schedule_key_options:
596 isl_union_set_free(options);
597 tok = isl_stream_next_token(s);
598 str = isl_token_get_str(ctx, tok);
599 options = isl_union_set_read_from_str(ctx, str);
600 free(str);
601 isl_token_free(tok);
602 if (!options)
603 goto error;
604 break;
605 case isl_schedule_key_child:
606 isl_schedule_tree_free(tree);
607 tree = isl_stream_read_schedule_tree(s);
608 if (!tree)
609 goto error;
610 break;
611 default:
612 isl_die(ctx, isl_error_invalid, "unexpected key",do { isl_handle_error(ctx, isl_error_invalid, "unexpected key"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 613); goto error; } while (0)
613 goto error)do { isl_handle_error(ctx, isl_error_invalid, "unexpected key"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 613); goto error; } while (0)
;
614 }
615 } while ((more = isl_stream_yaml_next(s)) > 0);
616
617 if (more < 0)
618 goto error;
619
620 if (!schedule)
621 isl_die(ctx, isl_error_invalid, "missing schedule", goto error)do { isl_handle_error(ctx, isl_error_invalid, "missing schedule"
, "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 621); goto error; } while (0)
;
622
623 band = isl_schedule_band_from_multi_union_pw_aff(schedule);
624 band = isl_schedule_band_set_permutable(band, permutable);
625 if (coincident)
626 band = set_coincident(band, coincident);
627 if (options)
628 band = isl_schedule_band_set_ast_build_options(band, options);
629 if (tree)
630 tree = isl_schedule_tree_insert_band(tree, band);
631 else
632 tree = isl_schedule_tree_from_band(band);
633
634 return tree;
635error:
636 isl_val_list_free(coincident);
637 isl_union_set_free(options);
638 isl_schedule_tree_free(tree);
639 isl_multi_union_pw_aff_free(schedule);
640 return NULL((void*)0);
641}
642
643/* Read a subtree with root node of type "type" from "s".
644 * The node is represented by a sequence of children.
645 */
646static __isl_give isl_schedule_tree *read_children(isl_stream *s,
647 enum isl_schedule_node_type type)
648{
649 isl_ctx *ctx;
650 isl_schedule_tree_list *list;
651 int more;
652
653 ctx = isl_stream_get_ctx(s);
654
655 isl_token_free(isl_stream_next_token(s));
656
657 if (isl_stream_yaml_next(s) < 0)
658 return NULL((void*)0);
659
660 if (isl_stream_yaml_read_start_sequence(s))
661 return NULL((void*)0);
662
663 list = isl_schedule_tree_list_alloc(ctx, 0);
664 while ((more = isl_stream_yaml_next(s)) > 0) {
665 isl_schedule_tree *tree;
666
667 tree = isl_stream_read_schedule_tree(s);
668 list = isl_schedule_tree_list_add(list, tree);
669 }
670
671 if (more < 0 || isl_stream_yaml_read_end_sequence(s))
672 list = isl_schedule_tree_list_free(list);
673
674 return isl_schedule_tree_from_children(type, list);
675}
676
677/* Read a subtree with sequence root node from "s".
678 */
679static __isl_give isl_schedule_tree *read_sequence(isl_stream *s)
680{
681 return read_children(s, isl_schedule_node_sequence);
682}
683
684/* Read a subtree with set root node from "s".
685 */
686static __isl_give isl_schedule_tree *read_set(isl_stream *s)
687{
688 return read_children(s, isl_schedule_node_set);
689}
690
691/* Read a schedule (sub)tree from "s".
692 *
693 * We first determine the type of the root node based on the first
694 * mapping key and then hand over to a function tailored to reading
695 * nodes of this type.
696 */
697static __isl_give isl_schedule_tree *isl_stream_read_schedule_tree(
698 struct isl_stream *s)
699{
700 enum isl_schedule_key key;
701 struct isl_token *tok;
702 isl_schedule_tree *tree = NULL((void*)0);
703 int more;
704
705 if (isl_stream_yaml_read_start_mapping(s))
706 return NULL((void*)0);
707 more = isl_stream_yaml_next(s);
708 if (more < 0)
709 return NULL((void*)0);
710 if (!more) {
711 isl_stream_error(s, NULL((void*)0), "missing key");
712 return NULL((void*)0);
713 }
714
715 tok = isl_stream_next_token(s);
716 key = extract_key(s, tok);
717 isl_stream_push_token(s, tok);
718 if (key < 0)
719 return NULL((void*)0);
720 switch (key) {
721 case isl_schedule_key_context:
722 tree = read_context(s);
723 break;
724 case isl_schedule_key_domain:
725 tree = read_domain(s);
726 break;
727 case isl_schedule_key_contraction:
728 case isl_schedule_key_expansion:
729 tree = read_expansion(s);
730 break;
731 case isl_schedule_key_extension:
732 tree = read_extension(s);
733 break;
734 case isl_schedule_key_filter:
735 tree = read_filter(s);
736 break;
737 case isl_schedule_key_guard:
738 tree = read_guard(s);
739 break;
740 case isl_schedule_key_leaf:
741 isl_token_free(isl_stream_next_token(s));
742 tree = isl_schedule_tree_leaf(isl_stream_get_ctx(s));
743 break;
744 case isl_schedule_key_mark:
745 tree = read_mark(s);
746 break;
747 case isl_schedule_key_sequence:
748 tree = read_sequence(s);
749 break;
750 case isl_schedule_key_set:
751 tree = read_set(s);
752 break;
753 case isl_schedule_key_schedule:
754 case isl_schedule_key_coincident:
755 case isl_schedule_key_options:
756 case isl_schedule_key_permutable:
757 tree = read_band(s);
758 break;
759 case isl_schedule_key_child:
760 isl_die(isl_stream_get_ctx(s), isl_error_unsupported,do { isl_handle_error(isl_stream_get_ctx(s), isl_error_unsupported
, "cannot identity node type", "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 761); return ((void*)0); } while (0)
761 "cannot identity node type", return NULL)do { isl_handle_error(isl_stream_get_ctx(s), isl_error_unsupported
, "cannot identity node type", "/tmp/buildd/llvm-toolchain-snapshot-5.0~svn301389/tools/polly/lib/External/isl/isl_schedule_read.c"
, 761); return ((void*)0); } while (0)
;
762 case isl_schedule_key_error:
763 return NULL((void*)0);
764 }
765
766 if (isl_stream_yaml_read_end_mapping(s) < 0) {
767 isl_stream_error(s, NULL((void*)0), "unexpected extra elements");
768 return isl_schedule_tree_free(tree);
769 }
770
771 return tree;
772}
773
774/* Read an isl_schedule from "s".
775 */
776__isl_give isl_schedule *isl_stream_read_schedule(isl_stream *s)
777{
778 isl_ctx *ctx;
779 isl_schedule_tree *tree;
780
781 if (!s)
782 return NULL((void*)0);
783
784 ctx = isl_stream_get_ctx(s);
785 tree = isl_stream_read_schedule_tree(s);
786 return isl_schedule_from_schedule_tree(ctx, tree);
787}
788
789/* Read an isl_schedule from "input".
790 */
791__isl_give isl_schedule *isl_schedule_read_from_file(isl_ctx *ctx, FILE *input)
792{
793 struct isl_stream *s;
794 isl_schedule *schedule;
795
796 s = isl_stream_new_file(ctx, input);
797 if (!s)
798 return NULL((void*)0);
799 schedule = isl_stream_read_schedule(s);
800 isl_stream_free(s);
801
802 return schedule;
803}
804
805/* Read an isl_schedule from "str".
806 */
807__isl_give isl_schedule *isl_schedule_read_from_str(isl_ctx *ctx,
808 const char *str)
809{
810 struct isl_stream *s;
811 isl_schedule *schedule;
812
813 s = isl_stream_new_str(ctx, str);
814 if (!s)
815 return NULL((void*)0);
816 schedule = isl_stream_read_schedule(s);
817 isl_stream_free(s);
818
819 return schedule;
820}