[all-commits] [llvm/llvm-project] c3f815: Modify the localCache API to require an explicit c...

anjenner via All-commits all-commits at lists.llvm.org
Tue Apr 22 01:45:36 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c3f815ba82defc84244a9688fd2578da513340fb
      https://github.com/llvm/llvm-project/commit/c3f815ba82defc84244a9688fd2578da513340fb
  Author: anjenner <161845516+anjenner at users.noreply.github.com>
  Date:   2025-04-22 (Tue, 22 Apr 2025)

  Changed paths:
    M lldb/source/Core/DataFileCache.cpp
    M llvm/include/llvm/Support/Caching.h
    M llvm/lib/CGData/CodeGenData.cpp
    M llvm/lib/Debuginfod/Debuginfod.cpp
    M llvm/lib/LTO/LTOBackend.cpp
    M llvm/lib/Support/Caching.cpp
    M llvm/tools/gold/gold-plugin.cpp
    M llvm/tools/llvm-lto2/llvm-lto2.cpp
    M llvm/unittests/Support/CMakeLists.txt
    A llvm/unittests/Support/Caching.cpp

  Log Message:
  -----------
  Modify the localCache API to require an explicit commit on CachedFile… (#136121)

…Stream.

CachedFileStream has previously performed the commit step in its
destructor, but this means its only recourse for error handling is
report_fatal_error. Modify this to add an explicit commit() method, and
call this in the appropriate places with appropriate error handling for
the location.

Currently the destructor of CacheStream gives an assert failure in Debug
builds if commit() was not called. This will help track down any
remaining uses of the API that assume the old destructior behaviour. In
Release builds we fall back to the previous behaviour and call
report_fatal_error if the commit fails.

This is version 2 of this PR, superseding reverted PR
https://github.com/llvm/llvm-project/pull/115331 . I have incorporated a
change to the testcase to make it more reliable on Windows, as well as
two follow-up changes
(https://github.com/llvm/llvm-project/commit/df79000896101acc9b8d7435e59f767b36c00ac8
and
https://github.com/llvm/llvm-project/commit/b0baa1d8bd68a2ce2f7c5f2b62333e410e9122a1)
that were also reverted when 115331 was reverted.

---------

Co-authored-by: Augie Fackler <augie at google.com>
Co-authored-by: Vitaly Buka <vitalybuka at google.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list