llvm-project/clang/lib/Basic
Duncan P. N. Exon Smith 900f817591 Serialization: Simulate -Werror settings in implicit modules
r293123 started serializing diagnostic pragma state for modules.  This
makes the serialization work properly for implicit modules.

An implicit module build (using Clang's internal build system) uses the
same PCM file location for different `-Werror` levels.

E.g., if a TU has `-Werror=format` and tries to load a PCM built without
`-Werror=format`, a new PCM will be built in its place (and the new PCM
should have the same signature, since r297655).  In the other direction,
if a TU does not have `-Werror=format` and tries to load a PCM built
with `-Werror=format`, it should "just work".

The idea is to evolve the PCM toward the strictest -Werror flags that
anyone tries.

r293123 started serializing the diagnostic pragma state for each PCM.
Since this encodes the -Werror settings at module-build time, it breaks
the implicit build model.

This commit filters the diagnostic state in order to simulate the
current compilation's diagnostic settings.  Firstly, it ignores the
module's serialized first diagnostic state, replacing it with the state
from this compilation's command-line.  Secondly, if a pragma warning was
upgraded to error/fatal when generating the PCM (e.g., due to `-Werror`
on the command-line), it checks whether it should still be upgraded in
its current context.

llvm-svn: 300025
2017-04-12 03:58:58 +00:00
..
Attributes.cpp Ignore the "novtable" declspec when not using the Microsoft C++ ABI. 2015-07-20 22:57:31 +00:00
Builtins.cpp [OpenCL] Make OpenCL Builtins added according to the right version. 2016-07-04 16:07:18 +00:00
CMakeLists.txt [XRay] Add -fxray-{always,never}-instrument= flags to clang 2017-03-30 00:29:36 +00:00
CharInfo.cpp
Cuda.cpp [CUDA] Fix "control reaches end of non-void function" warnings in Cuda.cpp. 2016-07-07 01:06:59 +00:00
Diagnostic.cpp Serialization: Simulate -Werror settings in implicit modules 2017-04-12 03:58:58 +00:00
DiagnosticIDs.cpp Remove and replace DiagStatePoint tracking and lookup data structure. 2017-01-26 01:01:01 +00:00
DiagnosticOptions.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
FileManager.cpp FileManager: mark virtual file entries as valid entries 2017-03-28 09:18:05 +00:00
FileSystemStatCache.cpp [VFS] Replace TimeValue usage with std::chrono 2016-11-09 10:52:22 +00:00
IdentifierTable.cpp [Parser][ObjC++] Improve diagnostics and recovery when C++ keywords are used 2017-04-11 15:01:53 +00:00
LangOptions.cpp [XRay] Add -fxray-{always,never}-instrument= flags to clang 2017-03-30 00:29:36 +00:00
MemoryBufferCache.cpp Reapply "Modules: Cache PCMs in memory and avoid a use-after-free" 2017-03-20 17:58:26 +00:00
Module.cpp Modular Codegen: Add/use a bit in serialized function definitions to track whether they are the subject of modular codegen 2017-04-11 20:46:34 +00:00
ObjCRuntime.cpp Watch and TV OS: wire up basic ABI choices 2015-10-30 16:30:36 +00:00
OpenMPKinds.cpp [OpenMP] Prepare Sema for initial implementation for pragma 'distribute parallel for' 2017-02-17 21:29:13 +00:00
OperatorPrecedence.cpp [OpenCL] Adding reserved operator logical xor for OpenCL 2016-02-03 15:17:14 +00:00
SanitizerBlacklist.cpp Replace double-negated !SourceLocation.isInvalid() with SourceLocation.isValid(). 2015-10-03 05:15:57 +00:00
Sanitizers.cpp Pull trivial SanitizerSet methods into the header. 2015-07-14 15:34:19 +00:00
SourceLocation.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
SourceManager.cpp [Basic] getColumnNumber returns location of CR+LF on Windows 2017-04-06 18:36:50 +00:00
TargetInfo.cpp Move setting of LangOpts based on target flags out of CompilerInstance 2017-03-22 06:36:09 +00:00
Targets.cpp [OpenCL] Map default address space to alloca address space 2017-04-11 17:24:23 +00:00
TokenKinds.cpp
Version.cpp Revert r223578, perf data collection depends on the old symbol name. 2014-12-10 23:49:03 +00:00
VersionTuple.cpp MS ABI: Implement driver-level support for thread-safe statics 2015-03-22 08:39:22 +00:00
VirtualFileSystem.cpp Reapply [VFS] Ignore broken symlinks in the directory iterator. 2017-03-14 00:14:40 +00:00
Warnings.cpp
XRayLists.cpp [XRay] Add -fxray-{always,never}-instrument= flags to clang 2017-03-30 00:29:36 +00:00