diff --git a/bolt/test/Unit/lit.site.cfg.py.in b/bolt/test/Unit/lit.site.cfg.py.in --- a/bolt/test/Unit/lit.site.cfg.py.in +++ b/bolt/test/Unit/lit.site.cfg.py.in @@ -2,25 +2,15 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.bolt_obj_root = "@BOLT_BINARY_DIR@" config.bolt_src_root = "@BOLT_SOURCE_DIR@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/bolt/test/lit.site.cfg.py.in b/bolt/test/lit.site.cfg.py.in --- a/bolt/test/lit.site.cfg.py.in +++ b/bolt/test/lit.site.cfg.py.in @@ -6,9 +6,9 @@ config.llvm_obj_root = "@LLVM_BINARY_DIR@" config.bolt_obj_root = "@BOLT_BINARY_DIR@" config.bolt_enable_runtime = @BOLT_ENABLE_RUNTIME@ -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.host_triple = "@LLVM_HOST_TRIPLE@" @@ -22,17 +22,6 @@ config.bolt_clang = "@BOLT_CLANG_EXE@" config.bolt_lld = "@BOLT_LLD_EXE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/clang/test/Unit/lit.site.cfg.py.in b/clang/test/Unit/lit.site.cfg.py.in --- a/clang/test/Unit/lit.site.cfg.py.in +++ b/clang/test/Unit/lit.site.cfg.py.in @@ -4,27 +4,14 @@ config.llvm_src_root = path(r"@LLVM_SOURCE_DIR@") config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@") -config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@") -config.llvm_libs_dir = path(r"@LLVM_LIBS_DIR@") -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute(path(r"@LLVM_TOOLS_DIR@")) +config.llvm_libs_dir = lit_config.substitute(path(r"@LLVM_LIBS_DIR@")) +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.clang_obj_root = path(r"@CLANG_BINARY_DIR@") config.enable_shared = @ENABLE_SHARED@ -config.shlibdir = path(r"@SHLIBDIR@") +config.shlibdir = lit_config.substitute(path(r"@SHLIBDIR@")) config.target_triple = "@LLVM_TARGET_TRIPLE@" -# Support substitution of the tools_dir, libs_dirs, and build_mode with user -# parameters. This is used when we can't determine the tool dir at -# configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params - config.shlibdir = config.shlibdir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # Let the main config do the real work. lit_config.load_config( config, os.path.join(path(r"@CLANG_SOURCE_DIR@"), "test/Unit/lit.cfg.py")) diff --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in --- a/clang/test/lit.site.cfg.py.in +++ b/clang/test/lit.site.cfg.py.in @@ -4,16 +4,16 @@ config.llvm_src_root = path(r"@LLVM_SOURCE_DIR@") config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@") -config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@") -config.llvm_libs_dir = path(r"@LLVM_LIBS_DIR@") -config.llvm_shlib_dir = path(r"@SHLIBDIR@") +config.llvm_tools_dir = lit_config.substitute(path(r"@LLVM_TOOLS_DIR@")) +config.llvm_libs_dir = lit_config.substitute(path(r"@LLVM_LIBS_DIR@")) +config.llvm_shlib_dir = lit_config.substitute(path(r"@SHLIBDIR@")) config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.lit_tools_dir = path(r"@LLVM_LIT_TOOLS_DIR@") config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@" config.clang_lit_site_cfg = __file__ config.clang_obj_root = path(r"@CLANG_BINARY_DIR@") config.clang_src_dir = path(r"@CLANG_SOURCE_DIR@") -config.clang_tools_dir = path(r"@CLANG_TOOLS_DIR@") +config.clang_tools_dir = lit_config.substitute(path(r"@CLANG_TOOLS_DIR@")) config.clang_lib_dir = path(r"@CMAKE_LIBRARY_OUTPUT_DIRECTORY@") config.host_triple = "@LLVM_HOST_TRIPLE@" config.target_triple = "@LLVM_TARGET_TRIPLE@" @@ -38,18 +38,6 @@ config.clang_vendor_uti = "@CLANG_VENDOR_UTI@" config.llvm_external_lit = path(r"@LLVM_EXTERNAL_LIT@") -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.clang_tools_dir = config.clang_tools_dir % lit_config.params - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/clang/utils/perf-training/lit.site.cfg.in b/clang/utils/perf-training/lit.site.cfg.in --- a/clang/utils/perf-training/lit.site.cfg.in +++ b/clang/utils/perf-training/lit.site.cfg.in @@ -2,21 +2,12 @@ import sys -config.clang_tools_dir = "@CLANG_TOOLS_DIR@" +config.clang_tools_dir = lit_config.substitute("@CLANG_TOOLS_DIR@") config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@" config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@" config.test_source_root = "@CLANG_PGO_TRAINING_DATA@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_exe = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.clang_tools_dir = config.clang_tools_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # Let the main config do the real work. lit_config.load_config(config, "@CLANG_SOURCE_DIR@/utils/perf-training/lit.cfg") diff --git a/clang/utils/perf-training/order-files.lit.site.cfg.in b/clang/utils/perf-training/order-files.lit.site.cfg.in --- a/clang/utils/perf-training/order-files.lit.site.cfg.in +++ b/clang/utils/perf-training/order-files.lit.site.cfg.in @@ -2,21 +2,12 @@ import sys -config.clang_tools_dir = "@CLANG_TOOLS_DIR@" +config.clang_tools_dir = lit_config.substitute("@CLANG_TOOLS_DIR@") config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@" config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@" config.test_source_root = "@CLANG_PGO_TRAINING_DATA@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_exe = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.clang_tools_dir = config.clang_tools_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # Let the main config do the real work. lit_config.load_config(config, "@CLANG_SOURCE_DIR@/utils/perf-training/order-files.lit.cfg") diff --git a/compiler-rt/test/lit.common.configured.in b/compiler-rt/test/lit.common.configured.in --- a/compiler-rt/test/lit.common.configured.in +++ b/compiler-rt/test/lit.common.configured.in @@ -70,13 +70,9 @@ # LLVM tools dir can be passed in lit parameters, so try to # apply substitution. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.clang = config.clang % lit_config.params - config.compiler_rt_libdir = config.compiler_rt_libdir % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) +config.llvm_tools_dir = lit_config.substitute(config.llvm_tools_dir) +config.clang = lit_config.substitute(config.clang) +config.compiler_rt_libdir = lit_config.substitute(config.compiler_rt_libdir) if not os.path.exists(config.clang): lit_config.fatal("Can't find compiler on path %r" % config.clang) diff --git a/compiler-rt/unittests/lit.common.unit.configured.in b/compiler-rt/unittests/lit.common.unit.configured.in --- a/compiler-rt/unittests/lit.common.unit.configured.in +++ b/compiler-rt/unittests/lit.common.unit.configured.in @@ -4,26 +4,16 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@" config.llvm_src_root = "@LLVM_MAIN_SRC_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@" -config.compiler_rt_libdir = "@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@" +config.compiler_rt_libdir = lit_config.substitute("@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@") config.enable_per_target_runtime_dir = @LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_PYBOOL@ -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.host_arch = "@HOST_ARCH@" config.host_os = "@HOST_OS@" config.llvm_lib_dir = "@LLVM_LIBRARY_DIR@" config.gwp_asan = @COMPILER_RT_HAS_GWP_ASAN_PYBOOL@ config.emulator = "@COMPILER_RT_EMULATOR@" -# LLVM tools dir and build mode can be passed in lit parameters, -# so try to apply substitution. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.compiler_rt_libdir = config.compiler_rt_libdir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key, key)) - # Setup attributes common for all compiler-rt unit tests. lit_config.load_config(config, "@COMPILER_RT_SOURCE_DIR@/unittests/lit.common.unit.cfg.py") diff --git a/cross-project-tests/lit.site.cfg.py.in b/cross-project-tests/lit.site.cfg.py.in --- a/cross-project-tests/lit.site.cfg.py.in +++ b/cross-project-tests/lit.site.cfg.py.in @@ -5,9 +5,9 @@ config.targets_to_build = "@TARGETS_TO_BUILD@".split() config.llvm_src_root = "@LLVM_SOURCE_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.cross_project_tests_obj_root = "@CROSS_PROJECT_TESTS_BINARY_DIR@" @@ -21,16 +21,6 @@ config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@" -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/flang/test/NonGtestUnit/lit.site.cfg.py.in b/flang/test/NonGtestUnit/lit.site.cfg.py.in --- a/flang/test/NonGtestUnit/lit.site.cfg.py.in +++ b/flang/test/NonGtestUnit/lit.site.cfg.py.in @@ -2,9 +2,9 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.flang_obj_root = "@FLANG_BINARY_DIR@" config.flang_src_root = "@FLANG_SOURCE_DIR@" @@ -13,15 +13,5 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # Let the main config do the real work. lit_config.load_config(config, "@FLANG_SOURCE_DIR@/test/NonGtestUnit/lit.cfg.py") diff --git a/flang/test/Unit/lit.site.cfg.py.in b/flang/test/Unit/lit.site.cfg.py.in --- a/flang/test/Unit/lit.site.cfg.py.in +++ b/flang/test/Unit/lit.site.cfg.py.in @@ -2,9 +2,9 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.flang_obj_root = "@FLANG_BINARY_DIR@" config.flang_src_root = "@FLANG_SOURCE_DIR@" @@ -13,15 +13,5 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # Let the main config do the real work. lit_config.load_config(config, "@FLANG_SOURCE_DIR@/test/Unit/lit.cfg.py") diff --git a/flang/test/lit.site.cfg.py.in b/flang/test/lit.site.cfg.py.in --- a/flang/test/lit.site.cfg.py.in +++ b/flang/test/lit.site.cfg.py.in @@ -2,14 +2,14 @@ import sys -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_shlib_dir = path(r"@SHLIBDIR@") +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_shlib_dir = lit_config.substitute(path(r"@SHLIBDIR@")) config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@" config.flang_obj_root = "@FLANG_BINARY_DIR@" config.flang_src_dir = "@FLANG_SOURCE_DIR@" -config.flang_tools_dir = "@FLANG_TOOLS_DIR@" +config.flang_tools_dir = lit_config.substitute("@FLANG_TOOLS_DIR@") config.flang_intrinsic_modules_dir = "@FLANG_INTRINSIC_MODULES_DIR@" config.flang_llvm_tools_dir = "@CMAKE_BINARY_DIR@/bin" config.flang_lib_dir = "@CMAKE_BINARY_DIR@/lib" @@ -20,17 +20,6 @@ config.cc = "@CMAKE_C_COMPILER@" config.targets_to_build = "@TARGETS_TO_BUILD@" -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.flang_tools_dir = config.flang_tools_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/lld/test/Unit/lit.site.cfg.py.in b/lld/test/Unit/lit.site.cfg.py.in --- a/lld/test/Unit/lit.site.cfg.py.in +++ b/lld/test/Unit/lit.site.cfg.py.in @@ -2,28 +2,16 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lld_obj_root = "@LLD_BINARY_DIR@" config.lld_src_root = "@LLD_SOURCE_DIR@" -config.lld_libs_dir = "@LLD_LIBS_DIR@" -config.lld_tools_dir = "@LLD_TOOLS_DIR@" +config.lld_libs_dir = lit_config.substitute("@LLD_LIBS_DIR@") +config.lld_tools_dir = lit_config.substitute("@LLD_TOOLS_DIR@") config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params - config.lld_libs_dir = config.lld_libs_dir % lit_config.params - config.lld_tools_dir = config.lld_tools_dir % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # Let the main config do the real work. lit_config.load_config(config, "@LLD_SOURCE_DIR@/test/Unit/lit.cfg.py") diff --git a/lld/test/lit.site.cfg.py.in b/lld/test/lit.site.cfg.py.in --- a/lld/test/lit.site.cfg.py.in +++ b/lld/test/lit.site.cfg.py.in @@ -5,13 +5,13 @@ config.have_dia_sdk = lit.util.pythonize_bool("@LLVM_ENABLE_DIA_SDK@") config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@" config.lld_obj_root = "@LLD_BINARY_DIR@" -config.lld_libs_dir = "@LLD_LIBS_DIR@" -config.lld_tools_dir = "@LLD_TOOLS_DIR@" +config.lld_libs_dir = lit_config.substitute("@LLD_LIBS_DIR@") +config.lld_tools_dir = lit_config.substitute("@LLD_TOOLS_DIR@") config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" config.have_zlib = @LLVM_ENABLE_ZLIB@ @@ -20,17 +20,6 @@ config.sizeof_void_p = @CMAKE_SIZEOF_VOID_P@ config.ld_lld_default_mingw = @LLD_DEFAULT_LD_LLD_IS_MINGW@ -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.lld_libs_dir = config.lld_libs_dir % lit_config.params - config.lld_tools_dir = config.lld_tools_dir % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in --- a/lldb/test/API/lit.site.cfg.py.in +++ b/lldb/test/API/lit.site.cfg.py.in @@ -2,15 +2,15 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" -config.lldb_libs_dir = "@LLDB_LIBS_DIR@" -config.lldb_framework_dir = "@LLDB_FRAMEWORK_DIR@" +config.lldb_libs_dir = lit_config.substitute("@LLDB_LIBS_DIR@") +config.lldb_framework_dir = lit_config.substitute("@LLDB_FRAMEWORK_DIR@") config.cmake_cxx_compiler = "@CMAKE_CXX_COMPILER@" config.host_os = "@HOST_OS@" config.host_triple = "@LLVM_HOST_TRIPLE@" @@ -21,14 +21,14 @@ config.python_executable = "@Python3_EXECUTABLE@" config.lua_executable = "@Lua_EXECUTABLE@" config.lua_test_entry = "TestLuaAPI.py" -config.dotest_args_str = "@LLDB_DOTEST_ARGS@" +config.dotest_args_str = lit_config.substitute("@LLDB_DOTEST_ARGS@") config.lldb_enable_python = @LLDB_ENABLE_PYTHON@ config.dotest_lit_args_str = None config.enabled_plugins = [] -config.lldb_executable = '@LLDB_TEST_EXECUTABLE@' +config.lldb_executable = lit_config.substitute('@LLDB_TEST_EXECUTABLE@') config.test_arch = '@LLDB_TEST_ARCH@' -config.test_compiler = '@LLDB_TEST_COMPILER@' -config.dsymutil = '@LLDB_TEST_DSYMUTIL@' +config.test_compiler = lit_config.substitute('@LLDB_TEST_COMPILER@') +config.dsymutil = lit_config.substitute('@LLDB_TEST_DSYMUTIL@') # The API tests use their own module caches. config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api") config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-api") @@ -44,22 +44,5 @@ if dotest_lit_args_str: config.dotest_lit_args_str = dotest_lit_args_str -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params - config.lldb_executable = config.lldb_executable % lit_config.params - config.lldb_libs_dir = config.lldb_libs_dir % lit_config.params - config.test_compiler = config.test_compiler % lit_config.params - config.dsymutil = config.dsymutil % lit_config.params - config.lldb_framework_dir = config.lldb_framework_dir % lit_config.params - config.dotest_args_str = config.dotest_args_str % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # Let the main config do the real work. lit_config.load_config(config, os.path.join(config.lldb_src_root, "test", "API", "lit.cfg.py")) diff --git a/lldb/test/Shell/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in --- a/lldb/test/Shell/lit.site.cfg.py.in +++ b/lldb/test/Shell/lit.site.cfg.py.in @@ -2,17 +2,17 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" -config.lldb_libs_dir = "@LLDB_LIBS_DIR@" -config.lldb_tools_dir = "@LLDB_TOOLS_DIR@" +config.lldb_libs_dir = lit_config.substitute("@LLDB_LIBS_DIR@") +config.lldb_tools_dir = lit_config.substitute("@LLDB_TOOLS_DIR@") # Since it comes from the command line, it may have backslashes which # should not need to be escaped. -config.lldb_lit_tools_dir = r"@LLDB_LIT_TOOLS_DIR@" +config.lldb_lit_tools_dir = lit_config.substitute(r"@LLDB_LIT_TOOLS_DIR@") config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" config.have_zlib = @LLVM_ENABLE_ZLIB@ @@ -27,19 +27,6 @@ config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell") config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-shell") -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params - config.lldb_libs_dir = config.lldb_libs_dir % lit_config.params - config.lldb_tools_dir = config.lldb_tools_dir % lit_config.params - config.lldb_lit_tools_dir = config.lldb_lit_tools_dir % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/lldb/test/Unit/lit.site.cfg.py.in b/lldb/test/Unit/lit.site.cfg.py.in --- a/lldb/test/Unit/lit.site.cfg.py.in +++ b/lldb/test/Unit/lit.site.cfg.py.in @@ -2,25 +2,15 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/lldb/test/lit.site.cfg.py.in b/lldb/test/lit.site.cfg.py.in --- a/lldb/test/lit.site.cfg.py.in +++ b/lldb/test/lit.site.cfg.py.in @@ -2,25 +2,15 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" config.target_triple = "@LLVM_TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError as e: - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/llvm/test/Unit/lit.site.cfg.py.in b/llvm/test/Unit/lit.site.cfg.py.in --- a/llvm/test/Unit/lit.site.cfg.py.in +++ b/llvm/test/Unit/lit.site.cfg.py.in @@ -4,21 +4,10 @@ config.llvm_src_root = path(r"@LLVM_SOURCE_DIR@") config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@") -config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@") -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute(path(r"@LLVM_TOOLS_DIR@")) +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.enable_shared = @ENABLE_SHARED@ -config.shlibdir = path(r"@SHLIBDIR@") - -# Support substitution of the tools_dir and build_mode with user parameters. -# This is used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params - config.shlibdir = config.shlibdir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) +config.shlibdir = lit_config.substitute(path(r"@SHLIBDIR@")) # Let the main config do the real work. lit_config.load_config( diff --git a/llvm/test/lit.site.cfg.py.in b/llvm/test/lit.site.cfg.py.in --- a/llvm/test/lit.site.cfg.py.in +++ b/llvm/test/lit.site.cfg.py.in @@ -6,9 +6,9 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@" config.llvm_src_root = path(r"@LLVM_SOURCE_DIR@") config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@") -config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@") -config.llvm_lib_dir = path(r"@LLVM_LIBS_DIR@") -config.llvm_shlib_dir = path(r"@SHLIBDIR@") +config.llvm_tools_dir = lit_config.substitute(path(r"@LLVM_TOOLS_DIR@")) +config.llvm_lib_dir = lit_config.substitute(path(r"@LLVM_LIBS_DIR@")) +config.llvm_shlib_dir = lit_config.substitute(path(r"@SHLIBDIR@")) config.llvm_shlib_ext = "@SHLIBEXT@" config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" config.llvm_exe_ext = "@EXEEXT@" @@ -58,17 +58,6 @@ config.llvm_raevict_model_autogenerated = @LLVM_RAEVICT_MODEL_AUTOGENERATED@ config.expensive_checks = @LLVM_ENABLE_EXPENSIVE_CHECKS@ -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/llvm/utils/lit/tests/lit.site.cfg.in b/llvm/utils/lit/tests/lit.site.cfg.in --- a/llvm/utils/lit/tests/lit.site.cfg.in +++ b/llvm/utils/lit/tests/lit.site.cfg.in @@ -5,16 +5,7 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" - -# Support substitution of the tools_dir with user parameters. -# This is used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/mlir/examples/standalone/test/lit.site.cfg.py.in b/mlir/examples/standalone/test/lit.site.cfg.py.in --- a/mlir/examples/standalone/test/lit.site.cfg.py.in +++ b/mlir/examples/standalone/test/lit.site.cfg.py.in @@ -6,9 +6,9 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@" config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_lib_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_lib_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") config.llvm_shlib_ext = "@SHLIBEXT@" config.llvm_exe_ext = "@EXEEXT@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" @@ -34,18 +34,6 @@ config.standalone_src_root = "@CMAKE_SOURCE_DIR@" config.standalone_obj_root = "@CMAKE_BINARY_DIR@" -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/mlir/test/Unit/lit.site.cfg.py.in b/mlir/test/Unit/lit.site.cfg.py.in --- a/mlir/test/Unit/lit.site.cfg.py.in +++ b/mlir/test/Unit/lit.site.cfg.py.in @@ -4,24 +4,13 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.enable_shared = @ENABLE_SHARED@ -config.shlibdir = "@SHLIBDIR@" +config.shlibdir = lit_config.substitute("@SHLIBDIR@") config.mlir_src_root = "@MLIR_SOURCE_DIR@" config.mlir_obj_root = "@MLIR_BINARY_DIR@" config.mlir_tools_dir = "@MLIR_TOOLS_DIR@" -# Support substitution of the tools_dir and build_mode with user parameters. -# This is used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params - config.shlibdir = config.shlibdir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # Let the main config do the real work. lit_config.load_config(config, "@MLIR_SOURCE_DIR@/test/Unit/lit.cfg.py") diff --git a/mlir/test/lit.site.cfg.py.in b/mlir/test/lit.site.cfg.py.in --- a/mlir/test/lit.site.cfg.py.in +++ b/mlir/test/lit.site.cfg.py.in @@ -6,9 +6,9 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@" config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_lib_dir = "@LLVM_LIBS_DIR@" -config.llvm_shlib_dir = "@SHLIBDIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_lib_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@") config.llvm_shlib_ext = "@SHLIBEXT@" config.llvm_exe_ext = "@EXEEXT@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" @@ -55,17 +55,6 @@ config.mlir_run_cuda_tensor_core_tests = @MLIR_RUN_CUDA_TENSOR_CORE_TESTS@ config.mlir_include_integration_tests = @MLIR_INCLUDE_INTEGRATION_TESTS@ -# Support substitution of the tools_dir with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params - config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - import lit.llvm lit.llvm.initialize(lit_config, config) diff --git a/polly/test/Unit/lit.site.cfg.in b/polly/test/Unit/lit.site.cfg.in --- a/polly/test/Unit/lit.site.cfg.in +++ b/polly/test/Unit/lit.site.cfg.in @@ -4,9 +4,9 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") +config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@") config.polly_obj_root = "@POLLY_BINARY_DIR@" config.polly_lib_dir = "@POLLY_LIB_DIR@" config.enable_shared = @ENABLE_SHARED@ @@ -16,17 +16,5 @@ config.llvm_polly_link_into_tools = "@LLVM_POLLY_LINK_INTO_TOOLS@" config.has_unittests = @POLLY_GTEST_AVAIL@ -# Support substitution of the tools_dir, libs_dirs, and build_mode with user -# parameters. This is used when we can't determine the tool dir at -# configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params - config.llvm_build_mode = config.llvm_build_mode % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # Let the main config do the real work. lit_config.load_config(config, "@POLLY_SOURCE_DIR@/test/Unit/lit.cfg") diff --git a/polly/test/lit.site.cfg.in b/polly/test/lit.site.cfg.in --- a/polly/test/lit.site.cfg.in +++ b/polly/test/lit.site.cfg.in @@ -2,8 +2,8 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" -config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_libs_dir = "@LLVM_LIBS_DIR@" +config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@") +config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@") config.polly_obj_root = "@POLLY_BINARY_DIR@" config.polly_lib_dir = "@POLLY_LIB_DIR@" config.target_triple = "@LLVM_TARGET_TRIPLE@" @@ -21,16 +21,6 @@ for arch in config.targets_to_build.split(): config.available_features.add(arch.lower() + '-registered-target') -# Support substitution of the tools and libs dirs with user parameters. This is -# used when we can't determine the tool dir at configuration time. -try: - config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params - config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params -except KeyError: - e = sys.exc_info()[1] - key, = e.args - lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) - # excludes: A list of directories to exclude from the testsuite. The 'Inputs' # subdirectories contain auxiliary inputs for various tests in their parent # directories.