Lazyly initialize uncommon toolchain detector
authorserge-sans-paille <sguelton@mozilla.com>
Thu, 26 Jan 2023 07:41:14 +0000 (08:41 +0100)
committerserge-sans-paille <sguelton@mozilla.com>
Mon, 6 Feb 2023 11:03:00 +0000 (12:03 +0100)
commit6fa2abf90886f18472c87bc9bffbcdf4f73c465e
treec74d982aae5feaccbcbbff216181382a0bd7fee4
parent5ef89b7f777ad6b75a0ad3a7355e1315cc390662
Lazyly initialize uncommon toolchain detector

Cuda and rocm toolchain detectors are currently run unconditionally,
while their result may not be used at all. Make their initialization
lazy so that the discovery code is not run in common cases.

Differential Revision: https://reviews.llvm.org/D142606
clang/lib/Driver/ToolChains/AMDGPU.cpp
clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
clang/lib/Driver/ToolChains/FreeBSD.cpp
clang/lib/Driver/ToolChains/Gnu.cpp
clang/lib/Driver/ToolChains/Gnu.h
clang/lib/Driver/ToolChains/HIPAMD.cpp
clang/lib/Driver/ToolChains/LazyDetector.h [new file with mode: 0644]
clang/lib/Driver/ToolChains/Linux.cpp