summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-11-28 03:23:07 +0000
committerMatthias Braun <matze@braunis.de>2017-11-28 03:23:07 +0000
commit90a526c5b6a9c51a1e5e2a846fe6419d245cce25 (patch)
tree1b346ef7cb081248293ae5ad9f01779b7b7ed4f4 /utils
parentd04afd7720bf0f56756be411865278a4c6997720 (diff)
lit: Bring back -Dtool=xxx feature lost in r313928
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319139 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/lit/lit/llvm/subst.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/utils/lit/lit/llvm/subst.py b/utils/lit/lit/llvm/subst.py
index e570f4ebf09..3c8db1d31ff 100644
--- a/utils/lit/lit/llvm/subst.py
+++ b/utils/lit/lit/llvm/subst.py
@@ -12,9 +12,14 @@ class FindTool(object):
self.name = name
def resolve(self, config, dirs):
- command = lit.util.which(self.name, dirs)
- if not command:
- return None
+ # Check for a user explicitely overriding a tool. This allows:
+ # llvm-lit -D llc="llc -enable-misched -verify-machineinstrs"
+ command = config.lit_config.params.get(self.name)
+ if command is None:
+ # Then check out search paths.
+ command = lit.util.which(self.name, dirs)
+ if not command:
+ return None
if self.name == 'llc' and os.environ.get('LLVM_ENABLE_MACHINE_VERIFIER') == '1':
command += ' -verify-machineinstrs'