]> granicus.if.org Git - clang/commit
[MinGW] Look for libc++ headers in a triplet prefixed path as well
authorMartin Storsjo <martin@martin.st>
Thu, 12 Apr 2018 20:07:38 +0000 (20:07 +0000)
committerMartin Storsjo <martin@martin.st>
Thu, 12 Apr 2018 20:07:38 +0000 (20:07 +0000)
commitfc3f7d36fba17a49f01a0d82c72c0c8d84a40bdf
tree151ad49b5886e476239d2545eeeaf34f1bf80e1f
parent74d69636471071c87e71690887bcb9b808089086
[MinGW] Look for libc++ headers in a triplet prefixed path as well

This makes it consistent with libstdc++ and the other default
include directories.

If these headers are found in both locations and one isn't a
symlink to the other, this will cause errors due to libc++ headers
having wrapper headers for some standard C headers, wrappers that
do #include_next the actual one.

If the same libc++ standard C wrapper header exists in more than one
include directory before the real system one, the header include
guard will stop it from doing another #include_next to pick up the
real one, breaking things.

As this is a rather uncommon situation, this should be acceptable
and toolchain maintainers can adapt accordingly if necessary.

Also simplify some of the existing code with a local variable.

Differential Revision: https://reviews.llvm.org/D45500

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329946 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/ToolChains/MinGW.cpp
test/Driver/mingw.cpp