[all-commits] [llvm/llvm-project] 6924a4: [clang][modules] Account for non-affecting inputs ...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Tue Nov 1 19:33:06 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6924a49690eee074f6c341d3ada4e98d640b8a7e
      https://github.com/llvm/llvm-project/commit/6924a49690eee074f6c341d3ada4e98d640b8a7e
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2022-11-01 (Tue, 01 Nov 2022)

  Changed paths:
    M clang/include/clang/Serialization/ASTWriter.h
    M clang/lib/Serialization/ASTWriter.cpp
    M clang/test/Modules/add-remove-irrelevant-module-map.m

  Log Message:
  -----------
  [clang][modules] Account for non-affecting inputs in `ASTWriter`

In D106876, we stopped serializing module map files that didn't affect compilation of the current module.

However, since each `SourceLocation` is simply an offset into `SourceManager`'s global buffer of concatenated input files in, these need to be adjusted during serialization. Otherwise, they can incorrectly point after the buffer or into subsequent input file.

This patch starts adjusting `SourceLocation`s, `FileID`s and other `SourceManager` offsets in `ASTWriter`.

Reviewed By: dexonsmith

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




More information about the All-commits mailing list