[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 13:28:31 PST 2021
int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added subscribers: ormris, steven_wu, hiraditya.
Herald added a project: lld-macho.
int3 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
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.392517.patch
Type: text/x-patch
Size: 1784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211207/b0ae3d9d/attachment.bin>
More information about the llvm-commits
mailing list