[all-commits] [llvm/llvm-project] b0e899: [ASTReader] Allow controlling separately whether v...

Argyrios Kyrtzidis via All-commits all-commits at lists.llvm.org
Thu Jan 21 20:46:23 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b0e89906f5b7e505a1ea315ab4ff612b1607fda8
      https://github.com/llvm/llvm-project/commit/b0e89906f5b7e505a1ea315ab4ff612b1607fda8
  Author: Argyrios Kyrtzidis <kyrtzidis at apple.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

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

  Log Message:
  -----------
  [ASTReader] Allow controlling separately whether validation should be disabled for a PCH vs a module file

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 stale 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

Differential Revision: https://reviews.llvm.org/D95159




More information about the All-commits mailing list