[PATCH] D136624: [clang][modules] Account for non-affecting inputs in `ASTWriter`

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 24 10:31:59 PDT 2022


jansvoboda11 created this revision.
jansvoboda11 added reviewers: dexonsmith, Bigcheese, vsapsai, ilyakuteev.
Herald added subscribers: ributzka, mgrang.
Herald added a project: All.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

In D106876 <https://reviews.llvm.org/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`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136624

Files:
  clang/include/clang/Basic/SourceManager.h
  clang/include/clang/Serialization/ASTWriter.h
  clang/lib/Serialization/ASTWriter.cpp
  clang/lib/Serialization/ASTWriterDecl.cpp
  clang/test/Modules/non-affecting-module-maps-source-locations.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136624.470211.patch
Type: text/x-patch
Size: 16281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221024/1f7a1b97/attachment-0001.bin>


More information about the cfe-commits mailing list