lit: Bring back -Dtool=xxx feature lost in r313928

llvm-svn: 319139
This commit is contained in:
Matthias Braun 2017-11-28 03:23:07 +00:00
parent 53fe469162
commit adf7582d14
1 changed files with 8 additions and 3 deletions

View File

@ -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'