diff options
| author | Rui Ueyama <ruiu@google.com> | 2019-05-23 09:26:27 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2019-05-23 09:26:27 +0000 |
| commit | 0baaf45be707c9e13e9f4d74001cb87701a519c1 (patch) | |
| tree | 5f0f579917b4a866bb848b0dd2181b508a4e7406 /lld/ELF/SymbolTable.cpp | |
| parent | 39192043bbfca8d4fe8562e2a2105012edaff8c3 (diff) | |
| download | bcm5719-llvm-0baaf45be707c9e13e9f4d74001cb87701a519c1.tar.gz bcm5719-llvm-0baaf45be707c9e13e9f4d74001cb87701a519c1.zip | |
Move SymbolTable::addCombinedLTOObject() to LinkerDriver.
Also renames it LinkerDriver::compileBitcodeFiles.
The function doesn't logically belong to SymbolTable. We added this
function to the symbol table because symbol table used to be a
container of input files. This is no longer the case.
Differential Revision: https://reviews.llvm.org/D62291
llvm-svn: 361469
Diffstat (limited to 'lld/ELF/SymbolTable.cpp')
| -rw-r--r-- | lld/ELF/SymbolTable.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/lld/ELF/SymbolTable.cpp b/lld/ELF/SymbolTable.cpp index b6d1741f856..44fdb96b3e0 100644 --- a/lld/ELF/SymbolTable.cpp +++ b/lld/ELF/SymbolTable.cpp @@ -32,29 +32,6 @@ using namespace lld::elf; SymbolTable *elf::Symtab; -// This function is where all the optimizations of link-time -// optimization happens. When LTO is in use, some input files are -// not in native object file format but in the LLVM bitcode format. -// This function compiles bitcode files into a few big native files -// using LLVM functions and replaces bitcode symbols with the results. -// Because all bitcode files that the program consists of are passed -// to the compiler at once, it can do whole-program optimization. -template <class ELFT> void SymbolTable::addCombinedLTOObject() { - // Compile bitcode files and replace bitcode symbols. - LTO.reset(new BitcodeCompiler); - for (BitcodeFile *F : BitcodeFiles) - LTO->add(*F); - - for (InputFile *File : LTO->compile()) { - DenseMap<CachedHashStringRef, const InputFile *> DummyGroups; - auto *Obj = cast<ObjFile<ELFT>>(File); - Obj->parse(DummyGroups); - for (Symbol *Sym : Obj->getGlobalSymbols()) - Sym->parseSymbolVersion(); - ObjectFiles.push_back(File); - } -} - // Set a flag for --trace-symbol so that we can print out a log message // if a new symbol with the same name is inserted into the symbol table. void SymbolTable::trace(StringRef Name) { @@ -609,8 +586,3 @@ void elf::resolveSymbol(Symbol *Old, const Symbol &New) { llvm_unreachable("bad symbol kind"); } } - -template void SymbolTable::addCombinedLTOObject<ELF32LE>(); -template void SymbolTable::addCombinedLTOObject<ELF32BE>(); -template void SymbolTable::addCombinedLTOObject<ELF64LE>(); -template void SymbolTable::addCombinedLTOObject<ELF64BE>(); |

