[PATCH] D20867: [PCH] Fix timestamp check on windows hosts.

pierre gousseau via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 1 08:33:45 PDT 2016


pgousseau created this revision.
pgousseau added reviewers: rsmith, thakis.
pgousseau added subscribers: cfe-commits, wristow, probinson, gbedwell, bruno, cameron314.

On Linux, if the timestamp of a header file, included in the pch, is modified, then including the pch without regenerating it causes a fatal error, which is reasonable.
On Windows the check is ifdefed out, allowing the compilation to continue in a broken state.
The root of the broken state is that, if timestamps dont match, the preprocessor will reparse a header without discarding the pch data.
This leads to "#pragma once" header to be included twice.
The reason behind the ifdefing of the check lacks documentation, and was done 6 years ago.
This change tentatively removes the ifdefing and adds a cc1 option to disable the inclusion of timestamps in pch files, giving some flexibility to build systems such as distributed builds.

This change is a follow up to the discussion started in http://reviews.llvm.org/D20243

http://reviews.llvm.org/D20867

Files:
  include/clang/Driver/CC1Options.td
  include/clang/Frontend/FrontendOptions.h
  lib/Frontend/CompilerInvocation.cpp
  lib/Frontend/FrontendActions.cpp
  lib/Serialization/ASTReader.cpp
  test/PCH/Inputs/include-timestamp-pch.h
  test/PCH/Inputs/include-timestamp.h
  test/PCH/include-timestamp.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20867.59225.patch
Type: text/x-patch
Size: 5569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160601/4a55e92d/attachment.bin>


More information about the cfe-commits mailing list