From 900f817591d0f6871b324aef655cbda926d26052 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Wed, 12 Apr 2017 03:58:58 +0000 Subject: 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 --- .../test/Modules/Inputs/implicit-built-Werror-using-W/module.modulemap | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 clang/test/Modules/Inputs/implicit-built-Werror-using-W/module.modulemap (limited to 'clang/test/Modules/Inputs/implicit-built-Werror-using-W/module.modulemap') diff --git a/clang/test/Modules/Inputs/implicit-built-Werror-using-W/module.modulemap b/clang/test/Modules/Inputs/implicit-built-Werror-using-W/module.modulemap new file mode 100644 index 00000000000..825eb86038e --- /dev/null +++ b/clang/test/Modules/Inputs/implicit-built-Werror-using-W/module.modulemap @@ -0,0 +1,3 @@ +module convert { + header "convert.h" +} -- cgit v1.2.3