diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-04-28 14:24:44 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-04-28 14:24:44 +0000 |
commit | bb626f0ed941f0caaa4e718e678e08ecc52fe2e0 (patch) | |
tree | 2c1502839f05d105b78d53ca764feb92a9ec8bd6 /lib/MC | |
parent | fc1cc11670b203b636ac0d6b2421b8a4ec92a50b (diff) | |
download | llvm-bb626f0ed941f0caaa4e718e678e08ecc52fe2e0.tar.gz llvm-bb626f0ed941f0caaa4e718e678e08ecc52fe2e0.tar.bz2 llvm-bb626f0ed941f0caaa4e718e678e08ecc52fe2e0.tar.xz |
Simplify isLocal().
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207421 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/ELFObjectWriter.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index ba4ffa4ca9..5c0d466ced 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -109,8 +109,7 @@ class ELFObjectWriter : public MCObjectWriter { static uint64_t SymbolValue(MCSymbolData &Data, const MCAsmLayout &Layout); static bool isInSymtab(const MCAsmLayout &Layout, const MCSymbolData &Data, bool Used, bool Renamed); - static bool isLocal(const MCSymbolData &Data, bool isSignature, - bool isUsedInReloc); + static bool isLocal(const MCSymbolData &Data, bool isUsedInReloc); static bool IsELFMetaDataSection(const MCSectionData &SD); static uint64_t DataSectionSize(const MCSectionData &SD); static uint64_t GetSectionFileSize(const MCAsmLayout &Layout, @@ -971,20 +970,16 @@ bool ELFObjectWriter::isInSymtab(const MCAsmLayout &Layout, return true; } -bool ELFObjectWriter::isLocal(const MCSymbolData &Data, bool isSignature, - bool isUsedInReloc) { +bool ELFObjectWriter::isLocal(const MCSymbolData &Data, bool isUsedInReloc) { if (Data.isExternal()) return false; const MCSymbol &Symbol = Data.getSymbol(); - const MCSymbol &RefSymbol = Symbol.AliasedSymbol(); - - if (RefSymbol.isUndefined() && !RefSymbol.isVariable()) { - if (isSignature && !isUsedInReloc) - return true; + if (Symbol.isDefined()) + return true; + if (isUsedInReloc) return false; - } return true; } @@ -1072,7 +1067,7 @@ ELFObjectWriter::computeSymbolTable(MCAssembler &Asm, const MCAsmLayout &Layout, // Undefined symbols are global, but this is the first place we // are able to set it. - bool Local = isLocal(SD, isSignature, Used); + bool Local = isLocal(SD, Used); if (!Local && MCELF::GetBinding(SD) == ELF::STB_LOCAL) { assert(BaseSymbol); MCSymbolData &BaseData = Asm.getSymbolData(*BaseSymbol); |