52
52
#include " llvm/Config/llvm-config.h"
53
53
#include " llvm/LTO/LTO.h"
54
54
#include " llvm/Object/Archive.h"
55
- #include " llvm/Object/IRObjectFile.h"
56
55
#include " llvm/Remarks/HotnessThresholdParser.h"
57
56
#include " llvm/Support/CommandLine.h"
58
57
#include " llvm/Support/Compression.h"
@@ -238,19 +237,6 @@ static bool isBitcode(MemoryBufferRef mb) {
238
237
return identify_magic (mb.getBuffer ()) == llvm::file_magic::bitcode;
239
238
}
240
239
241
- bool LinkerDriver::tryAddFatLTOFile (MemoryBufferRef mb, StringRef archiveName,
242
- uint64_t offsetInArchive, bool lazy) {
243
- if (!config->fatLTOObjects )
244
- return false ;
245
- Expected<MemoryBufferRef> fatLTOData =
246
- IRObjectFile::findBitcodeInMemBuffer (mb);
247
- if (errorToBool (fatLTOData.takeError ()))
248
- return false ;
249
- files.push_back (
250
- make<BitcodeFile>(*fatLTOData, archiveName, offsetInArchive, lazy));
251
- return true ;
252
- }
253
-
254
240
// Opens a file and create a file object. Path has to be resolved already.
255
241
void LinkerDriver::addFile (StringRef path, bool withLOption) {
256
242
using namespace sys ::fs;
@@ -275,7 +261,7 @@ void LinkerDriver::addFile(StringRef path, bool withLOption) {
275
261
for (const std::pair<MemoryBufferRef, uint64_t > &p : members) {
276
262
if (isBitcode (p.first ))
277
263
files.push_back (make<BitcodeFile>(p.first , path, p.second , false ));
278
- else if (! tryAddFatLTOFile (p. first , path, p. second , false ))
264
+ else
279
265
files.push_back (createObjFile (p.first , path));
280
266
}
281
267
return ;
@@ -299,10 +285,9 @@ void LinkerDriver::addFile(StringRef path, bool withLOption) {
299
285
InputFile::isInGroup = true ;
300
286
for (const std::pair<MemoryBufferRef, uint64_t > &p : members) {
301
287
auto magic = identify_magic (p.first .getBuffer ());
302
- if (magic == file_magic::elf_relocatable) {
303
- if (!tryAddFatLTOFile (p.first , path, p.second , true ))
304
- files.push_back (createObjFile (p.first , path, true ));
305
- } else if (magic == file_magic::bitcode)
288
+ if (magic == file_magic::elf_relocatable)
289
+ files.push_back (createObjFile (p.first , path, true ));
290
+ else if (magic == file_magic::bitcode)
306
291
files.push_back (make<BitcodeFile>(p.first , path, p.second , true ));
307
292
else
308
293
warn (path + " : archive member '" + p.first .getBufferIdentifier () +
@@ -334,8 +319,7 @@ void LinkerDriver::addFile(StringRef path, bool withLOption) {
334
319
files.push_back (make<BitcodeFile>(mbref, " " , 0 , inLib));
335
320
break ;
336
321
case file_magic::elf_relocatable:
337
- if (!tryAddFatLTOFile (mbref, " " , 0 , inLib))
338
- files.push_back (createObjFile (mbref, " " , inLib));
322
+ files.push_back (createObjFile (mbref, " " , inLib));
339
323
break ;
340
324
default :
341
325
error (path + " : unknown file type" );
@@ -1154,8 +1138,6 @@ static void readConfigs(opt::InputArgList &args) {
1154
1138
args.hasFlag (OPT_android_memtag_heap, OPT_no_android_memtag_heap, false );
1155
1139
config->androidMemtagStack = args.hasFlag (OPT_android_memtag_stack,
1156
1140
OPT_no_android_memtag_stack, false );
1157
- config->fatLTOObjects =
1158
- args.hasFlag (OPT_fat_lto_objects, OPT_no_fat_lto_objects, false );
1159
1141
config->androidMemtagMode = getMemtagMode (args);
1160
1142
config->auxiliaryList = args::getStrings (args, OPT_auxiliary);
1161
1143
config->armBe8 = args.hasArg (OPT_be8);
0 commit comments