summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2018-04-24 01:05:04 +0000
committerNico Weber <nicolasweber@gmx.de>2018-04-24 01:05:04 +0000
commita425db5a1e40c082a71bc23dcf8a57306d0e3ef0 (patch)
tree084f899ba642e18fd37c514dac36fae02a7cf308 /llvm/utils
parentd2a57220acfed8d910968435ca2d69ffe48117cc (diff)
downloadbcm5719-llvm-a425db5a1e40c082a71bc23dcf8a57306d0e3ef0.tar.gz
bcm5719-llvm-a425db5a1e40c082a71bc23dcf8a57306d0e3ef0.zip
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. llvm-svn: 330672
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/lit/lit/util.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/llvm/utils/lit/lit/util.py b/llvm/utils/lit/lit/util.py
index 5f20262d4c3..8d4d9d25b19 100644
--- a/llvm/utils/lit/lit/util.py
+++ b/llvm/utils/lit/lit/util.py
@@ -193,10 +193,6 @@ def which(command, paths=None):
if paths is None:
paths = os.environ.get('PATH', '')
- # Check for absolute match first.
- if os.path.isfile(command):
- return os.path.normpath(command)
-
# Would be nice if Python had a lib function for this.
if not paths:
paths = os.defpath
OpenPOWER on IntegriCloud