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 | 39f50421e35014d4504a3f628312d3b8d0687f5c (patch) | |
tree | 3d88d5b7ccb2a506cf2755854297ee7363839d96 /llvm/lib/MC | |
parent | 6ad1f5c817499b88116ad307f370389912be5260 (diff) | |
download | bcm5719-llvm-39f50421e35014d4504a3f628312d3b8d0687f5c.tar.gz bcm5719-llvm-39f50421e35014d4504a3f628312d3b8d0687f5c.zip |
Simplify isLocal().
No functionality change.
llvm-svn: 207421
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r-- | llvm/lib/MC/ELFObjectWriter.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index ba4ffa4ca9c..5c0d466ced6 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/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); |