From: Peter Collingbourne Date: Thu, 1 Dec 2016 02:51:12 +0000 (+0000) Subject: LTO: Remove Symbol::getIRName(). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66a1cdb5785c1f747783b85f52dd54113b0d9fad;p=llvm LTO: Remove Symbol::getIRName(). Its only use was in the LTO implementation. Also document Symbol::getName(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288302 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/LTO/LTO.h b/include/llvm/LTO/LTO.h index 16ef686226a..6309632e257 100644 --- a/include/llvm/LTO/LTO.h +++ b/include/llvm/LTO/LTO.h @@ -162,12 +162,9 @@ public: skip(); } + /// Returns the mangled name of the global. StringRef getName() const { return Name; } - StringRef getIRName() const { - if (GV) - return GV->getName(); - return StringRef(); - } + uint32_t getFlags() const { return Flags; } GlobalValue::VisibilityTypes getVisibility() const { if (GV) diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp index b5339cd61df..4256704f906 100644 --- a/lib/LTO/LTO.cpp +++ b/lib/LTO/LTO.cpp @@ -381,7 +381,10 @@ Error LTO::addRegularLTO(std::unique_ptr Input, // We also record if we see an instance of a common as prevailing, so that // if none is prevailing we can ignore it later. if (Sym.getFlags() & object::BasicSymbolRef::SF_Common) { - auto &CommonRes = RegularLTO.Commons[Sym.getIRName()]; + // FIXME: We should figure out what to do about commons defined by asm. + // For now they aren't reported correctly by ModuleSymbolTable. + assert(GV); + auto &CommonRes = RegularLTO.Commons[GV->getName()]; CommonRes.Size = std::max(CommonRes.Size, Sym.getCommonSize()); CommonRes.Align = std::max(CommonRes.Align, Sym.getCommonAlignment()); CommonRes.Prevailing |= Res.Prevailing;