HomePhabricator

Reland r371785: Add -Wpoison-system-directories warning

Authored by manojgupta on Sep 13 2019, 11:00 AM.

Description

Reland r371785: Add -Wpoison-system-directories warning

When using clang as a cross-compiler, we should not use system
headers to do the compilation.
This CL adds support of a new warning flag -Wpoison-system-directories which
emits warnings if --sysroot is set and headers from common host system location
are used.
By default the warning is disabled.

The intention of the warning is to catch bad includes which are usually
generated by third party build system not targeting cross-compilation.
Such cases happen in Chrome OS when someone imports a new package or upgrade
one to a newer version from upstream.

This is reland of r371785 with a fix to test file.

Patch by: denik (Denis Nikitin)

llvm-svn: 371878

Details

Committed
manojguptaSep 13 2019, 11:00 AM
Parents
rG4cb267f9f5ff: [NFC][InstSimplify] Add some more tests for D67498/D67502
Branches
Unknown
Tags
Unknown