[Libclc-dev] [PATCH 1/3] configure.py: Simplify compatibility sources
Tom Stellard via Libclc-dev
libclc-dev at lists.llvm.org
Fri Sep 8 15:31:49 PDT 2017
These 3 patches all LGTM.
-Tom
On 09/01/2017 05:31 PM, Jan Vesely via Libclc-dev wrote:
> Just add the SOURCE_X.Y list to the list of sources if X.Y if the current llvm version.
>
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
> ---
> configure.py | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/configure.py b/configure.py
> index 85004b1..cc4c84b 100755
> --- a/configure.py
> +++ b/configure.py
> @@ -70,7 +70,7 @@ def llvm_config(args):
>
> llvm_version = llvm_config(['--version']).replace('svn', '').split('.')
> llvm_int_version = int(llvm_version[0]) * 100 + int(llvm_version[1]) * 10
> -llvm_string_version = 'LLVM' + llvm_version[0] + '.' + llvm_version[1]
> +llvm_string_version = llvm_version[0] + '.' + llvm_version[1]
>
> if llvm_int_version < 400:
> print("libclc requires LLVM >= 4.0")
> @@ -202,7 +202,7 @@ for target in targets:
>
> objects = []
> sources_seen = set()
> - compats_seen = set()
> + compats = []
>
> if device['gpu'] == '':
> full_target_name = target
> @@ -222,7 +222,7 @@ for target in targets:
> if os.path.exists(compat_list_file):
> for compat in open(compat_list_file).readlines():
> compat = compat.rstrip()
> - compats_seen.add(compat)
> + compats.append(compat)
>
> # Add target overrides
> if os.path.exists(override_list_file):
> @@ -230,15 +230,13 @@ for target in targets:
> override = override.rstrip()
> sources_seen.add(override)
>
> - for src in open(subdir_list_file).readlines():
> + for src in open(subdir_list_file).readlines() + compats:
> src = src.rstrip()
> if src not in sources_seen:
> sources_seen.add(src)
> obj = os.path.join(target, 'lib', src + obj_suffix + '.bc')
> objects.append(obj)
> src_path = libdir
> - if src in compats_seen:
> - src_path = os.path.join(libdir, llvm_string_version)
> src_file = os.path.join(src_path, src)
> ext = os.path.splitext(src)[1]
> if ext == '.ll':
>
More information about the Libclc-dev
mailing list