[PATCH] D115281: [lld-macho] Include archive name in bitcode files

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 7 16:11:57 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG8a1f2d65804d: [lld-macho] Include archive name in bitcode files (authored by int3).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115281

Files:
  lld/MachO/InputFiles.cpp
  lld/test/MachO/lto-archive.ll


Index: lld/test/MachO/lto-archive.ll
===================================================================
--- lld/test/MachO/lto-archive.ll
+++ lld/test/MachO/lto-archive.ll
@@ -10,15 +10,15 @@
 ; RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/references-foo.s -o %t/references-foo.o
 
 ; RUN: %lld -lSystem %t/references-foo.o %t/foo.a -o /dev/null -why_load | FileCheck %s --check-prefix=FOO
-; FOO: _foo forced load of foo.o
+; FOO: _foo forced load of {{.+}}foo.a(foo.o)
 
 ; RUN: %lld -lSystem -force_load %t/foo.a %t/main.o -o /dev/null -why_load | FileCheck %s --check-prefix=FORCE-LOAD
-; FORCE-LOAD: -force_load forced load of foo.o
+; FORCE-LOAD: -force_load forced load of {{.+}}foo.a(foo.o)
 
 ; RUN: %lld -lSystem -ObjC -framework CoreFoundation %t/objc.a %t/main.o \
 ; RUN:   -o /dev/null -why_load | FileCheck %s --check-prefix=OBJC
-; OBJC: _OBJC_CLASS_$_Foo forced load of has-objc-symbol.o
-; OBJC: -ObjC forced load of has-objc-category.o
+; OBJC: _OBJC_CLASS_$_Foo forced load of {{.+}}objc.a(has-objc-symbol.o)
+; OBJC: -ObjC forced load of {{.+}}objc.a(has-objc-category.o)
 
 ; RUN: %lld -lSystem %t/foo.a %t/main.o -o %t/no-force-load -why_load | count 0
 
Index: lld/MachO/InputFiles.cpp
===================================================================
--- lld/MachO/InputFiles.cpp
+++ lld/MachO/InputFiles.cpp
@@ -1478,6 +1478,7 @@
 BitcodeFile::BitcodeFile(MemoryBufferRef mb, StringRef archiveName,
                          uint64_t offsetInArchive)
     : InputFile(BitcodeKind, mb) {
+  this->archiveName = std::string(archiveName);
   std::string path = mb.getBufferIdentifier().str();
   // ThinLTO assumes that all MemoryBufferRefs given to it have a unique
   // name. If two members with the same name are provided, this causes a


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115281.392588.patch
Type: text/x-patch
Size: 1780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211208/d5fac0d6/attachment.bin>


More information about the llvm-commits mailing list