Serialization: Simulate -Werror settings in implicit modulesr293123 started serializing diagnostic pragma state for modules. Thismakes the serialization work properly for implicit modules.An im
Serialization: Simulate -Werror settings in implicit modulesr293123 started serializing diagnostic pragma state for modules. Thismakes the serialization work properly for implicit modules.An implicit module build (using Clang's internal build system) uses thesame 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 PCMshould have the same signature, since r297655). In the other direction,if a TU does not have `-Werror=format` and tries to load a PCM builtwith `-Werror=format`, it should "just work".The idea is to evolve the PCM toward the strictest -Werror flags thatanyone tries.r293123 started serializing the diagnostic pragma state for each PCM.Since this encodes the -Werror settings at module-build time, it breaksthe implicit build model.This commit filters the diagnostic state in order to simulate thecurrent compilation's diagnostic settings. Firstly, it ignores themodule's serialized first diagnostic state, replacing it with the statefrom this compilation's command-line. Secondly, if a pragma warning wasupgraded to error/fatal when generating the PCM (e.g., due to `-Werror`on the command-line), it checks whether it should still be upgraded inits current context.llvm-svn: 300025
show more ...