[lld] r315627 - [lit] Raise the logic for enabling clang & lld substitutions to llvm.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 14:56:05 PDT 2017


Author: zturner
Date: Thu Oct 12 14:56:05 2017
New Revision: 315627

URL: http://llvm.org/viewvc/llvm-project?rev=315627&view=rev
Log:
[lit] Raise the logic for enabling clang & lld substitutions to llvm.

This paves the way for other projects which might /use/ clang or
lld but not necessarily need to the full set of functionality
available to clang and lld tests to be able to have a basic set
of substitutions that allow a project to run the clang or lld
executables.

Modified:
    lld/trunk/test/lit.cfg.py

Modified: lld/trunk/test/lit.cfg.py
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.cfg.py?rev=315627&r1=315626&r2=315627&view=diff
==============================================================================
--- lld/trunk/test/lit.cfg.py (original)
+++ lld/trunk/test/lit.cfg.py Thu Oct 12 14:56:05 2017
@@ -10,7 +10,6 @@ import lit.formats
 import lit.util
 
 from lit.llvm import llvm_config
-from lit.llvm.subst import ToolSubst
 
 # Configuration file for the 'lit' test runner.
 
@@ -36,28 +35,14 @@ config.test_source_root = os.path.dirnam
 
 config.test_exec_root = os.path.join(config.lld_obj_root, 'test')
 
-# Tweak the PATH to include the tools dir and the scripts dir.
-llvm_config.with_environment('PATH',
-                             [config.llvm_tools_dir, config.lld_tools_dir], append_path=True)
-
-llvm_config.with_environment('LD_LIBRARY_PATH',
-                             [config.lld_libs_dir, config.llvm_libs_dir], append_path=True)
-
 llvm_config.use_default_substitutions()
-
-# For each occurrence of a clang tool name, replace it with the full path to
-# the build directory holding that tool.  We explicitly specify the directories
-# to search to ensure that we get the tools just built and not some random
-# tools that might happen to be in the user's PATH.
-tool_dirs = [config.lld_tools_dir, config.llvm_tools_dir]
+llvm_config.use_lld()
 
 tool_patterns = [
-    ToolSubst('ld.lld', extra_args=['--full-shutdown']),
-    'lld-link', 'llvm-as', 'llvm-mc', 'llvm-nm',
-    'llvm-objdump', 'llvm-pdbutil', 'llvm-readobj', 'obj2yaml', 'yaml2obj',
-    'lld']
+    'llvm-as', 'llvm-mc', 'llvm-nm',
+    'llvm-objdump', 'llvm-pdbutil', 'llvm-readobj', 'obj2yaml', 'yaml2obj']
 
-llvm_config.add_tool_substitutions(tool_patterns, tool_dirs)
+llvm_config.add_tool_substitutions(tool_patterns)
 
 # When running under valgrind, we mangle '-vg' onto the end of the triple so we
 # can check it with XFAIL and XTARGET.




More information about the llvm-commits mailing list