[lld] 8a1f2d6 - [lld-macho] Include archive name in bitcode files
Jez Ng via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 7 16:11:53 PST 2021
Author: Jez Ng
Date: 2021-12-07T19:11:23-05:00
New Revision: 8a1f2d65804de59fbe7811b74720e6572684e9ca
URL: https://github.com/llvm/llvm-project/commit/8a1f2d65804de59fbe7811b74720e6572684e9ca
DIFF: https://github.com/llvm/llvm-project/commit/8a1f2d65804de59fbe7811b74720e6572684e9ca.diff
LOG: [lld-macho] Include archive name in bitcode files
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D115281
Added:
Modified:
lld/MachO/InputFiles.cpp
lld/test/MachO/lto-archive.ll
Removed:
################################################################################
diff --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp
index 558de4131cb9f..23f28e63bf59e 100644
--- a/lld/MachO/InputFiles.cpp
+++ b/lld/MachO/InputFiles.cpp
@@ -1478,6 +1478,7 @@ static macho::Symbol *createBitcodeSymbol(const lto::InputFile::Symbol &objSym,
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
diff --git a/lld/test/MachO/lto-archive.ll b/lld/test/MachO/lto-archive.ll
index c37fdd0efc23a..866b2d6a4cfef 100644
--- a/lld/test/MachO/lto-archive.ll
+++ b/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
More information about the llvm-commits
mailing list