[llvm] r319139 - lit: Bring back -Dtool=xxx feature lost in r313928
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 27 19:23:07 PST 2017
Author: matze
Date: Mon Nov 27 19:23:07 2017
New Revision: 319139
URL: http://llvm.org/viewvc/llvm-project?rev=319139&view=rev
Log:
lit: Bring back -Dtool=xxx feature lost in r313928
Modified:
llvm/trunk/utils/lit/lit/llvm/subst.py
Modified: llvm/trunk/utils/lit/lit/llvm/subst.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/llvm/subst.py?rev=319139&r1=319138&r2=319139&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/llvm/subst.py (original)
+++ llvm/trunk/utils/lit/lit/llvm/subst.py Mon Nov 27 19:23:07 2017
@@ -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'
More information about the llvm-commits
mailing list