summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-06-17 20:08:20 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-06-17 20:08:20 +0000
commitdfe2d359c5e5517a7cbbe83009cc23518f4ff65a (patch)
tree094446c176d2255fb3c511ee31753d4ccb09d0db /llvm/lib
parente8accef8660e5a5af47e612cccb74dbc95ca5bc7 (diff)
downloadbcm5719-llvm-dfe2d359c5e5517a7cbbe83009cc23518f4ff65a.tar.gz
bcm5719-llvm-dfe2d359c5e5517a7cbbe83009cc23518f4ff65a.zip
Move IsUsedInReloc from MCSymbolELF to MCSymbol.
There is a free bit is MCSymbol and MachO needs the same information. llvm-svn: 239933
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCAssembler.cpp12
-rw-r--r--llvm/lib/MC/MCSymbolELF.cpp14
-rw-r--r--llvm/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp2
-rw-r--r--llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp2
4 files changed, 4 insertions, 26 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 55f50097744..df416710182 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -345,16 +345,6 @@ bool MCAssembler::isThumbFunc(const MCSymbol *Symbol) const {
return true;
}
-void MCAssembler::addLocalUsedInReloc(const MCSymbol &Sym) {
- assert(Sym.isTemporary());
- LocalsUsedInReloc.insert(&Sym);
-}
-
-bool MCAssembler::isLocalUsedInReloc(const MCSymbol &Sym) const {
- assert(Sym.isTemporary());
- return LocalsUsedInReloc.count(&Sym);
-}
-
bool MCAssembler::isSymbolLinkerVisible(const MCSymbol &Symbol) const {
// Non-temporary labels should always be visible to the linker.
if (!Symbol.isTemporary())
@@ -364,7 +354,7 @@ bool MCAssembler::isSymbolLinkerVisible(const MCSymbol &Symbol) const {
if (!Symbol.isInSection())
return false;
- if (isLocalUsedInReloc(Symbol))
+ if (Symbol.isUsedInReloc())
return true;
return false;
diff --git a/llvm/lib/MC/MCSymbolELF.cpp b/llvm/lib/MC/MCSymbolELF.cpp
index c3620651f88..ec7ef447ff8 100644
--- a/llvm/lib/MC/MCSymbolELF.cpp
+++ b/llvm/lib/MC/MCSymbolELF.cpp
@@ -36,10 +36,7 @@ enum {
ELF_WeakrefUsedInReloc_Shift = 11,
// One bit.
- ELF_UsedInReloc_Shift = 12,
-
- // One bit.
- ELF_BindingSet_Shift = 13
+ ELF_BindingSet_Shift = 12
};
}
@@ -175,15 +172,6 @@ unsigned MCSymbolELF::getOther() const {
return Other << 5;
}
-void MCSymbolELF::setUsedInReloc() const {
- uint32_t OtherFlags = getFlags() & ~(0x1 << ELF_UsedInReloc_Shift);
- setFlags(OtherFlags | (1 << ELF_UsedInReloc_Shift));
-}
-
-bool MCSymbolELF::isUsedInReloc() const {
- return getFlags() & (0x1 << ELF_UsedInReloc_Shift);
-}
-
void MCSymbolELF::setIsWeakrefUsedInReloc() const {
uint32_t OtherFlags = getFlags() & ~(0x1 << ELF_WeakrefUsedInReloc_Shift);
setFlags(OtherFlags | (1 << ELF_WeakrefUsedInReloc_Shift));
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp
index 67af810bbbe..741b273073e 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp
@@ -287,7 +287,7 @@ void AArch64MachObjectWriter::recordRelocation(
if (Symbol->isTemporary() && (Value || !CanUseLocalRelocation)) {
const MCSection &Sec = Symbol->getSection();
if (!Asm.getContext().getAsmInfo()->isSectionAtomizableBySymbols(Sec))
- Asm.addLocalUsedInReloc(*Symbol);
+ Symbol->setUsedInReloc();
}
const MCSymbol *Base = Asm.getAtom(*Symbol);
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
index 95acc07192d..9e801fc8f19 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
@@ -205,7 +205,7 @@ void X86MachObjectWriter::RecordX86_64Relocation(
if (Symbol->isTemporary() && Value) {
const MCSection &Sec = Symbol->getSection();
if (!Asm.getContext().getAsmInfo()->isSectionAtomizableBySymbols(Sec))
- Asm.addLocalUsedInReloc(*Symbol);
+ Symbol->setUsedInReloc();
}
RelSymbol = Asm.getAtom(*Symbol);
OpenPOWER on IntegriCloud