aboutsummaryrefslogtreecommitdiff
path: root/lld/COFF/InputFiles.cpp
diff options
context:
space:
mode:
authorJacek Caban <jacek@codeweavers.com>2025-01-17 11:36:12 +0100
committerGitHub <noreply@github.com>2025-01-17 11:36:12 +0100
commitb068f2fd0fefca1ee357483333f034d18e6d8214 (patch)
tree55ead12c0b8b3d1640a3020673ffe2eb739192e1 /lld/COFF/InputFiles.cpp
parent9491f75e1d912b277247450d1c7b6d56f7faf885 (diff)
downloadllvm-b068f2fd0fefca1ee357483333f034d18e6d8214.tar.gz
llvm-b068f2fd0fefca1ee357483333f034d18e6d8214.tar.bz2
llvm-b068f2fd0fefca1ee357483333f034d18e6d8214.zip
[LLD][COFF] Process bitcode files separately for each symbol table on ARM64X (#123194)
Diffstat (limited to 'lld/COFF/InputFiles.cpp')
-rw-r--r--lld/COFF/InputFiles.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 66641ff9dcc1..5ee73d4dc4f8 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -1229,10 +1229,15 @@ void ImportFile::parse() {
}
}
-BitcodeFile::BitcodeFile(COFFLinkerContext &ctx, MemoryBufferRef mb,
- StringRef archiveName, uint64_t offsetInArchive,
- bool lazy)
- : InputFile(ctx.symtab, BitcodeKind, mb, lazy) {
+BitcodeFile::BitcodeFile(SymbolTable &symtab, MemoryBufferRef mb,
+ std::unique_ptr<lto::InputFile> &o, bool lazy)
+ : InputFile(symtab, BitcodeKind, mb, lazy) {
+ obj.swap(o);
+}
+
+BitcodeFile *BitcodeFile::create(COFFLinkerContext &ctx, MemoryBufferRef mb,
+ StringRef archiveName,
+ uint64_t offsetInArchive, bool lazy) {
std::string path = mb.getBufferIdentifier().str();
if (ctx.config.thinLTOIndexOnly)
path = replaceThinLTOSuffix(mb.getBufferIdentifier(),
@@ -1252,7 +1257,9 @@ BitcodeFile::BitcodeFile(COFFLinkerContext &ctx, MemoryBufferRef mb,
sys::path::filename(path) +
utostr(offsetInArchive)));
- obj = check(lto::InputFile::create(mbref));
+ std::unique_ptr<lto::InputFile> obj = check(lto::InputFile::create(mbref));
+ return make<BitcodeFile>(ctx.getSymtab(getMachineType(obj.get())), mb, obj,
+ lazy);
}
BitcodeFile::~BitcodeFile() = default;
@@ -1329,7 +1336,7 @@ void BitcodeFile::parseLazy() {
}
}
-MachineTypes BitcodeFile::getMachineType() const {
+MachineTypes BitcodeFile::getMachineType(const llvm::lto::InputFile *obj) {
Triple t(obj->getTargetTriple());
switch (t.getArch()) {
case Triple::x86_64: