Support locating the libc++ header files relatively to the clang
executable, in addition to the default system path. This is meant
to cover two use cases: running just-built clang from the install
directory, and running installed clang from non-standard location
(e.g. /usr/local).
This is the first step towards ensuring that tests of more LLVM projects
can work out-of-the-box within the build tree, and use the correct set
of headers (rather than e.g. mixing just-built clang+libcxx with system
install of libcxx). It avoids requiring the user to hack around missing
include paths, or LLVM build system to replicate system-specific C++
library defaults in order to append appropriate paths implicitly.
I propose to go for:
getDriver().SysRoot + "/usr/include/c++/v1", with a fallback for getDriver().SysRoot + "/usr/include/c++",
This innocent customization of paths triggers a lot of headache.
We should switch system location to /usr/include/c++/v1 for next version of LLVM (9.0 as 8.0 is branched and will be released soon).
This way we will keep compat with legacy paths and new clang.