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
This commit is contained in:
Peter Collingbourne 2016-12-01 02:51:12 +00:00
parent 0719114a69
commit 66a1cdb578
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -381,7 +381,10 @@ Error LTO::addRegularLTO(std::unique_ptr<InputFile> 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;