[PATCH] D115055: [Support] Use final filename for Caching buffer identifier

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 4 19:25:57 PST 2021


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG134275d994d5: [Support] Use final filename for Caching buffer identifier (authored by lgrey, committed by thakis).
Herald added subscribers: ormris, steven_wu.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.

Changed prior to commit:
  https://reviews.llvm.org/D115055?vs=391673&id=391885#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115055/new/

https://reviews.llvm.org/D115055

Files:
  lld/test/MachO/lto-cache-dsymutil.ll
  llvm/lib/Support/Caching.cpp


Index: llvm/lib/Support/Caching.cpp
===================================================================
--- llvm/lib/Support/Caching.cpp
+++ llvm/lib/Support/Caching.cpp
@@ -99,7 +99,7 @@
         // Open the file first to avoid racing with a cache pruner.
         ErrorOr<std::unique_ptr<MemoryBuffer>> MBOrErr =
             MemoryBuffer::getOpenFile(
-                sys::fs::convertFDToNativeFile(TempFile.FD), TempFile.TmpName,
+                sys::fs::convertFDToNativeFile(TempFile.FD), EntryPath,
                 /*FileSize=*/-1, /*RequiresNullTerminator=*/false);
         if (!MBOrErr)
           report_fatal_error(Twine("Failed to open new cache file ") +
Index: lld/test/MachO/lto-cache-dsymutil.ll
===================================================================
--- /dev/null
+++ lld/test/MachO/lto-cache-dsymutil.ll
@@ -0,0 +1,28 @@
+; REQUIRES: x86
+
+; RUN: rm -rf %t; mkdir %t
+; RUN: opt -module-hash -module-summary %s -o %t/foo.o
+; RUN: %lld -cache_path_lto %t/cache -o %t/test %t/foo.o
+
+;; Check that dsymutil is able to read the .o file out of the thinlto cache.
+; RUN: dsymutil -f -o - %t/test | llvm-dwarfdump - | FileCheck %s
+; CHECK: DW_AT_name ("test.cpp")
+
+
+target triple = "x86_64-apple-macosx10.15.0"
+target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @main() #0 !dbg !4 {
+  ret void
+}
+
+!llvm.module.flags = !{ !0, !1 }
+!llvm.dbg.cu = !{!2}
+
+!0 = !{i32 7, !"Dwarf Version", i32 4}
+!1 = !{i32 2, !"Debug Info Version", i32 3}
+!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, emissionKind: FullDebug)
+!3 = !DIFile(filename: "test.cpp", directory: "/tmp")
+!4 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 1, type: !5, scopeLine: 1, unit: !2)
+!5 = !DISubroutineType(types: !6)
+!6 = !{}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115055.391885.patch
Type: text/x-patch
Size: 1841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211205/d6f0e8ac/attachment.bin>


More information about the llvm-commits mailing list