[PATCH] D95159: [ASTReader] Allow controlling separately whether validation should be disabled for a PCH vs a module file

Argyrios Kyrtzidis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 21 11:46:43 PST 2021


akyrtzi created this revision.
Herald added subscribers: dang, arphaman.
Herald added a reviewer: jansvoboda11.
akyrtzi requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This addresses an issue with how the PCH preable works, specifically:

1. When using a PCH/preamble the module hash changes and a different cache directory is used
2. When the preamble is used, PCH & PCM validation is disabled.

Due to combination of #1 and #2, reparsing with preamble enabled can end up loading a state module file before a header change and using it without updating it because validation is disabled and it doesn’t check that the header has changed and the module file is out-of-date.

rdar://72611253


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95159

Files:
  clang/include/clang/Driver/Options.td
  clang/include/clang/Frontend/CompilerInstance.h
  clang/include/clang/Lex/PreprocessorOptions.h
  clang/include/clang/Serialization/ASTReader.h
  clang/lib/Frontend/ASTUnit.cpp
  clang/lib/Frontend/ChainedIncludesSource.cpp
  clang/lib/Frontend/CompilerInstance.cpp
  clang/lib/Frontend/FrontendAction.cpp
  clang/lib/Frontend/FrontendActions.cpp
  clang/lib/Frontend/PrecompiledPreamble.cpp
  clang/lib/Serialization/ASTReader.cpp
  clang/test/Index/Inputs/preamble-reparse-changed-module/head.h
  clang/test/Index/Inputs/preamble-reparse-changed-module/module.modulemap
  clang/test/Index/Inputs/preamble-reparse-changed-module/new-head.h
  clang/test/Index/preamble-reparse-changed-module.m
  clang/tools/c-index-test/c-index-test.c
  clang/tools/c-index-test/core_main.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95159.318274.patch
Type: text/x-patch
Size: 24207 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210121/73e5616e/attachment-0001.bin>


More information about the cfe-commits mailing list