llvm-project/clang/lib
Manoj Gupta 4fe2732161 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.

Patch by: denik (Denis Nikitin)

llvm-svn: 371785
2019-09-12 22:36:13 +00:00
..
ARCMigrate Removed some questionable default arguments from setters 2019-09-12 12:16:43 +00:00
AST [Clang][CodeGen] support alias attribute w/ gnu_inline 2019-09-12 19:53:35 +00:00
ASTMatchers [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
Analysis [CFG] Add dumps for CFGElement and CFGElementRef 2019-09-12 19:52:34 +00:00
Basic Reland "Change the X86 datalayout to add three address spaces 2019-09-10 23:15:38 +00:00
CodeGen Improve code generation for thread_local variables: 2019-09-12 20:00:24 +00:00
CrossTU [CrossTU] Fix problem with CrossTU AST load limit and progress messages. 2019-08-12 07:15:29 +00:00
DirectoryWatcher [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
Driver [WebAssembly] Add -fwasm-exceptions for wasm EH 2019-09-12 04:01:37 +00:00
Edit [C++2a] Add __builtin_bit_cast, used to implement std::bit_cast 2019-07-02 18:28:13 +00:00
Format [clang-format] [PR43100] clang-format C# support does not add a space between "using" and paren 2019-09-12 10:18:53 +00:00
Frontend Add -Wpoison-system-directories warning 2019-09-12 22:36:13 +00:00
FrontendTool [analyzer] Don't run the analyzer for -analyzer-list-enabled-checkers 2019-09-12 18:53:48 +00:00
Headers [PowerPC][Altivec] Fix constant argument for vec_dss 2019-09-04 14:01:47 +00:00
Index [clang][Index] Replace CodegenNameGenerator with ASTNameGenerator 2019-09-05 20:33:52 +00:00
Lex [clang-scan-deps] add skip excluded conditional preprocessor block preprocessing optimization 2019-09-11 20:40:31 +00:00
Parse Diagnose _Atomic as a C11 extension. 2019-09-04 21:01:57 +00:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema [MS] Warn when shadowing template parameters under -fms-compatibility 2019-09-12 18:26:34 +00:00
Serialization [Sema] Diagnose default-initialization, destruction, and copying of 2019-09-07 00:34:43 +00:00
StaticAnalyzer [analyzer][NFC] Fix inconsistent references to checkers as "checks" 2019-09-12 19:09:24 +00:00
Tooling [clang-scan-deps] remove dots and dots dots from the reported file dependency paths 2019-09-12 18:03:24 +00:00
CMakeLists.txt Reland [clang] DirectoryWatcher 2019-07-12 20:34:10 +00:00