[Driver] Check whether Gentoo-specific configuration directory exists
authorDmitry Antipov <dmantipov@yandex.ru>
Wed, 23 Sep 2020 17:21:18 +0000 (20:21 +0300)
committerDmitry Antipov <dmantipov@yandex.ru>
Wed, 23 Sep 2020 17:25:23 +0000 (20:25 +0300)
commitd882ca7f1f1dee7d812d6b1ae060b5f671ab9ebc
treebc54c06b4155218b1afceeee05ba1c2b1a7c6f26
parent76e8c1899e7c9f9462ba08387472899d7de965af
[Driver] Check whether Gentoo-specific configuration directory exists

Check whether /etc/env.d/gcc exists before trying to read from any
file from there. This saves a few OS calls on a non-Gentoo system.

Differential Revision: https://reviews.llvm.org/D87143
clang/lib/Driver/ToolChains/Gnu.cpp
clang/lib/Driver/ToolChains/Gnu.h