[all-commits] [llvm/llvm-project] 134275: [Support] Use final filename for Caching buffer id...

Leonard Grey via All-commits all-commits at lists.llvm.org
Sat Dec 4 19:26:03 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 134275d994d5fb38edfeb587ba45c8f495c8bf66
      https://github.com/llvm/llvm-project/commit/134275d994d5fb38edfeb587ba45c8f495c8bf66
  Author: Leonard Grey <lgrey at chromium.org>
  Date:   2021-12-04 (Sat, 04 Dec 2021)

  Changed paths:
    A lld/test/MachO/lto-cache-dsymutil.ll
    M llvm/lib/Support/Caching.cpp

  Log Message:
  -----------
  [Support] Use final filename for Caching buffer identifier

Mach-O LLD uses the buffer identifier of the memory buffer backing an object
file to generate stabs which are used by `dsymutil` to find the object file for
dSYM generation.

When using thinLTO, these buffers are provided by the cache which initially
saves them to disk as temporary files beginning with "Thin-" but renames them
to persistent files beginning with "llvmcache-" before the buffer is provided
to the cache user.

However, the buffer is created before the file is renamed and is given the temp
file's name as an identifier. This causes the generated stabs to point to
nonexistent files.

This change names the buffer with the eventual persistent filename. I think
this is safe because failing to rename the temp file is a fatal error.

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




More information about the All-commits mailing list