[Clang] Bypass distro detection on non-Linux hosts
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Thu, 28 Nov 2019 20:56:00 +0000 (15:56 -0500)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Thu, 28 Nov 2019 22:02:06 +0000 (17:02 -0500)
commit1abd4c94d7575e4cd288e0024c1ec79f17b048a9
tree5dc253472fc233c8305bc1accbd9a935a083736d
parenta7abe6eac061a999e88d651e4857872f5ec52e5d
[Clang] Bypass distro detection on non-Linux hosts

Skip distro detection when we're not running on Linux, or when the target triple is not Linux. This saves a few OS calls for each invocation of clang.exe.

Differential Revision: https://reviews.llvm.org/D70467
clang/include/clang/Driver/Distro.h
clang/lib/Driver/Distro.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/Cuda.cpp
clang/lib/Driver/ToolChains/Linux.cpp
clang/unittests/Driver/DistroTest.cpp