OSDN Git Service

Remove code that's almost always dead, and harmful if not.
authorNico Weber <nicolasweber@gmx.de>
Tue, 24 Apr 2018 01:05:04 +0000 (01:05 +0000)
committerNico Weber <nicolasweber@gmx.de>
Tue, 24 Apr 2018 01:05:04 +0000 (01:05 +0000)
commitbdd8ac7826b415b24ccd1c335419b7fe77e99063
treec47fe2cb8a520623f0c450bb70f33d1792edcd0b
parent1f039215102da888e04c72548380d1ea1473f927
Remove code that's almost always dead, and harmful if not.

lit's util.which() would check if the passed-in path existed directly,
and if so return it as-is.  This is never the case when running llvm's, clang's,
or lld's tests normally.  But when running `./llvm-lit path/to/clang/test`
with a cwd of llvm-build/bin, this if would detect that clang exists at path
'clang' and return 'clang' as the discovered clang binary -- and then lit would
use the " clang " -> "*** Do not use 'clang' in tests, use '%clang'. ***"
substitution to replace that with a broken test.  By removing this early
return, lit ends up with the usual absolute path and everything works even
in this uncommon case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330672 91177308-0d34-0410-b5e6-96231b3b80d8
utils/lit/lit/util.py