diff options
Diffstat (limited to 'lld/COFF/SymbolTable.cpp')
-rw-r--r-- | lld/COFF/SymbolTable.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lld/COFF/SymbolTable.cpp b/lld/COFF/SymbolTable.cpp index 7072f4d8d0e3..d4d2a159a639 100644 --- a/lld/COFF/SymbolTable.cpp +++ b/lld/COFF/SymbolTable.cpp @@ -204,7 +204,7 @@ static void reportUndefinedSymbol(const UndefinedDiag &undefDiag) { llvm::raw_string_ostream os(out); os << "undefined symbol: " << toString(*undefDiag.sym); - const size_t maxUndefReferences = 10; + const size_t maxUndefReferences = 3; size_t i = 0, numRefs = 0; for (const UndefinedDiag::File &ref : undefDiag.files) { std::vector<std::string> symbolLocations = @@ -438,7 +438,7 @@ void SymbolTable::resolveRemainingUndefines() { if (name.contains("_PchSym_")) continue; - if (config->mingw && handleMinGWAutomaticImport(sym, name)) + if (config->autoImport && handleMinGWAutomaticImport(sym, name)) continue; // Remaining undefined symbols are not fatal if /force is specified. @@ -789,20 +789,16 @@ Symbol *SymbolTable::addUndefined(StringRef name) { return addUndefined(name, nullptr, false); } -std::vector<StringRef> SymbolTable::compileBitcodeFiles() { - lto.reset(new BitcodeCompiler); - for (BitcodeFile *f : BitcodeFile::instances) - lto->add(*f); - return lto->compile(); -} - void SymbolTable::addCombinedLTOObjects() { if (BitcodeFile::instances.empty()) return; ScopedTimer t(ltoTimer); - for (StringRef object : compileBitcodeFiles()) { - auto *obj = make<ObjFile>(MemoryBufferRef(object, "lto.tmp")); + lto.reset(new BitcodeCompiler); + for (BitcodeFile *f : BitcodeFile::instances) + lto->add(*f); + for (InputFile *newObj : lto->compile()) { + ObjFile *obj = cast<ObjFile>(newObj); obj->parse(); ObjFile::instances.push_back(obj); } |