From: Steven Wu Date: Fri, 4 Sep 2020 19:25:01 +0000 (-0700) Subject: [ThinLTO][Legacy] Fix StringRef assertion from ThinLTO bots X-Git-Tag: llvmorg-13-init~12891 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97866b8de81ce71cf9ae9e50feb450335b0537a0;p=platform%2Fupstream%2Fllvm.git [ThinLTO][Legacy] Fix StringRef assertion from ThinLTO bots This is a presumed fix for FireFox thinLTO bot fix which hits assertion failure for invalid index when access StringRef. Techinically, `IRName` in the symtab should not be empty string for the entries we cared about but this will help to fix the bot before more information can be provided. Otherwise, NFCI. --- diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index 4adc9a2..14dae84 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -276,7 +276,7 @@ static void computeGUIDPreservedSymbols(const lto::InputFile &File, // Iterate the symbols in the input file and if the input has preserved symbol // compute the GUID for the symbol. for (const auto &Sym : File.symbols()) { - if (PreservedSymbols.count(Sym.getName())) + if (PreservedSymbols.count(Sym.getName()) && !Sym.getIRName().empty()) GUIDs.insert(GlobalValue::getGUID(GlobalValue::getGlobalIdentifier( Sym.getIRName(), GlobalValue::ExternalLinkage, ""))); }