From fb8c2a4a6b9fb72430903677fc1ffc46e27160f4 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 1 Dec 2016 02:51:12 +0000 Subject: [PATCH] LTO: Remove Symbol::getIRName(). Its only use was in the LTO implementation. Also document Symbol::getName(). llvm-svn: 288302 --- llvm/include/llvm/LTO/LTO.h | 7 ++----- llvm/lib/LTO/LTO.cpp | 5 ++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/llvm/include/llvm/LTO/LTO.h b/llvm/include/llvm/LTO/LTO.h index 16ef686..6309632 100644 --- a/llvm/include/llvm/LTO/LTO.h +++ b/llvm/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/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index b5339cd..4256704 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/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; -- 2.7.4