From 0dcdb335cf70a5324629d1a4e3ebafcb4ff9abf5 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 29 May 2019 13:04:50 -0500 Subject: [PATCH 1/3] Upgrade to isl 0.21+ --- gen_wrap.py | 48 ++++++++++++++++++++++++++++-------------------- isl | 2 +- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/gen_wrap.py b/gen_wrap.py index f2bfc6c..5769963 100644 --- a/gen_wrap.py +++ b/gen_wrap.py @@ -343,6 +343,7 @@ MACRO_ENUMS = [ HEADER_PREAMBLE = """ // flow.h +typedef int isl_size; typedef int (*isl_access_level_before)(void *first, void *second); typedef isl_restriction *(*isl_access_restrict)( isl_map *source_map, isl_set *sink, @@ -519,7 +520,7 @@ else: """ SAFE_TYPES = list(ENUMS) + ["int", "unsigned", "uint32_t", "size_t", "double", - "long", "unsigned long"] + "long", "unsigned long", "isl_size"] SAFE_IN_TYPES = SAFE_TYPES + ["const char *", "char *"] @@ -561,12 +562,17 @@ FUNC_PTR_RE = re.compile(r""" re.VERBOSE) STRUCT_DECL_RE = re.compile( r"(__isl_export\s+)?" - "struct\s+" - "(__isl_export\s+)?" - "(__isl_subclass\([a-z_ ]+\)\s+)?" - "([a-z_A-Z0-9]+)\s*;") + r"struct\s+" + r"(__isl_export\s+)?" + r"(__isl_subclass\([a-z_ ]+\)\s+)?" + r"([a-z_A-Z0-9]+)\s*;") ARG_RE = re.compile(r"^((?:\w+)\s+)+(\**)\s*(\w+)$") INLINE_SEMICOLON_RE = re.compile(r"\;[ \t]*(?=\w)") +SUBCLASS_RE = re.compile( + r"__isl_subclass\s*" + r"\(\s*" + "[0-9a-zA-Z_]+" + r"\s*\)") def filter_semantics(words): @@ -704,6 +710,7 @@ class FunctionData: my_line = lines[i].strip() i += 1 + my_line, _ = SUBCLASS_RE.subn("", my_line) while my_line.endswith("\\"): my_line = my_line[:-1] + lines[i].strip() i += 1 @@ -717,41 +724,41 @@ class FunctionData: i = 0 while i < len(lines): - l = lines[i].strip() + line = lines[i].strip() - if (not l - or l.startswith("extern") - or STRUCT_DECL_RE.search(l) - or l.startswith("typedef") - or l == "}"): + if (not line + or line.startswith("extern") + or STRUCT_DECL_RE.search(line) + or line.startswith("typedef") + or line == "}"): i += 1 - elif "/*" in l: + elif "/*" in line: while True: - if "*/" in l: + if "*/" in line: i += 1 break i += 1 - l = lines[i].strip() - elif l.endswith("{"): + line = lines[i].strip() + elif line.endswith("{"): while True: - if "}" in l: + if "}" in line: i += 1 break i += 1 - l = lines[i].strip() + line = lines[i].strip() - elif not l: + elif not line: i += 1 else: decl = "" while True: - decl = decl + l + decl = decl + line if decl: decl += " " i += 1 @@ -762,7 +769,7 @@ class FunctionData: close_par_count = sum(1 for i in decl if i == ")") if open_par_count and open_par_count == close_par_count: break - l = lines[i].strip() + line = lines[i].strip() if not STRUCT_DECL_RE.search(decl): self.parse_decl(decl) @@ -1757,6 +1764,7 @@ def gen_wrapper(include_dirs, include_barvinok=False, isl_version=None): return fdata.headers + if __name__ == "__main__": from os.path import expanduser gen_wrapper([expanduser("isl/include")]) diff --git a/isl b/isl index 01416bd..98bb6b8 160000 --- a/isl +++ b/isl @@ -1 +1 @@ -Subproject commit 01416bdfdb0dcbd282abe1ee13848fc7d36ec8d6 +Subproject commit 98bb6b881bdfd77d44ecece3dd3f2057569874a4 -- GitLab From e78a28995779e3163aaf82c8fa4093ad93b3219e Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 29 May 2019 13:25:45 -0500 Subject: [PATCH 2/3] Update isl submodule --- isl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isl b/isl index 98bb6b8..a72ac2e 160000 --- a/isl +++ b/isl @@ -1 +1 @@ -Subproject commit 98bb6b881bdfd77d44ecece3dd3f2057569874a4 +Subproject commit a72ac2e6329c659cdec28c3bfcd506b8b1f90476 -- GitLab From 7a5ba62008ea8b2b0fa0107adfac2e9d43d37127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Wed, 29 May 2019 20:44:34 +0200 Subject: [PATCH 3/3] Fix isl submodule URL --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 88eb43b..9de7df7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "isl"] path = isl - url = https://github.com/inducer/isl + url = https://github.com/inducer/isl.git -- GitLab