[PATCH] D22773: Modules: add command line option fmodules-disable-diagnostic-validation to disable validation of the diagnostic options when loading the module

Manman Ren via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 25 13:01:56 PDT 2016


manmanren created this revision.
manmanren added a reviewer: benlangmuir.
manmanren added a subscriber: cfe-commits.

With PCH+Module, sometimes compiler gives a hard error:
"Module file ‘<some-file path>.pcm' is out of date and needs to be rebuilt"

This happens when we have a PCH importing a module and the module gets overwritten by another compiler instance after we build the pch (one example is that both compiler instances hash to the same pcm file but use different diagnostic options). When we try to load the pch later on, the compiler notices that the imported module is out of date (modification date, size do not match)  but it can't handle this out of date pcm (i.e it does not know how to rebuild the pch).

This patch introduces a new command line option so for PCH + module, we can turn on this option and if two compiler instances only differ in diagnostic options, the latter instance will not invalidate the original pcm.


https://reviews.llvm.org/D22773

Files:
  include/clang/Driver/Options.td
  include/clang/Lex/HeaderSearchOptions.h
  include/clang/Serialization/ASTReader.h
  lib/Frontend/CompilerInvocation.cpp
  lib/Frontend/FrontendActions.cpp
  lib/Serialization/ASTReader.cpp
  test/Driver/modules.m
  test/Modules/Inputs/DiagOutOfDate.h
  test/Modules/Inputs/module.map
  test/Modules/Inputs/pch-import-module-out-of-date.pch
  test/Modules/diagnostic-options-out-of-date.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22773.65405.patch
Type: text/x-patch
Size: 10648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160725/179140fb/attachment.bin>


More information about the cfe-commits mailing list