[Driver] move FreeBSD header search path management to the driver
authorMatt Jacobson <mhjacobson@me.com>
Thu, 17 Nov 2022 04:42:15 +0000 (23:42 -0500)
committerMatt Jacobson <mhjacobson@me.com>
Fri, 18 Nov 2022 07:29:49 +0000 (02:29 -0500)
commitba7a1d9e4aec5399e9cd45e47c7a548b1514b8ba
treee2f1396ccef95fef733a6321989f510a3aa94e8f
parenta35ad711d90497994701a99723a81badf3d4348e
[Driver] move FreeBSD header search path management to the driver

This matches OpenBSD, and it supports Swift's use of clang for its C interop
functionality.  Recent changes to Swift use AddClangSystemIncludeArgs() to
inspect the cc1 args; this doesn't work for platforms where cc1 adds standard
include paths implicitly.  See:

<https://github.com/apple/swift/commit/cf3354222d9f480de74db390f53a6dcc749fde14>

Also clean up InitHeaderSearch, making it clearer which targets manage header
search paths in the driver.

Differential Revision: https://reviews.llvm.org/D138183
clang/lib/Driver/ToolChains/FreeBSD.cpp
clang/lib/Driver/ToolChains/FreeBSD.h
clang/lib/Lex/InitHeaderSearch.cpp
clang/test/Driver/freebsd.c
clang/test/Driver/freebsd.cpp