[all-commits] [llvm/llvm-project] 67963d: [include-cleaner] Fix a race issue when editing mu...

Haojian Wu via All-commits all-commits at lists.llvm.org
Fri Jan 5 01:13:47 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 67963d384b23a2d46967b8f39ec2df3375731f4f
      https://github.com/llvm/llvm-project/commit/67963d384b23a2d46967b8f39ec2df3375731f4f
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2024-01-05 (Fri, 05 Jan 2024)

  Changed paths:
    M clang-tools-extra/include-cleaner/tool/IncludeCleaner.cpp

  Log Message:
  -----------
  [include-cleaner] Fix a race issue when editing multiple files. (#76960)

We have a previous fix
https://github.com/llvm/llvm-project/commit/be861b64d94198230d8f9889b17280e3cd215a0a,
which snapshots all processing files.

It works most of times, the snapshot (InMemoryFileSystem) is based on
the file path. The file-path-based lookup can fail in a subtle way for
some tricky cases (we encounter it internally), which will result in
reading a corrupted file.

This is a different fix, we don't modify files on the fly, instead, we
write files when the tool finishes for all files.




More information about the All-commits mailing list