diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-01-13 22:23:36 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-01-13 22:23:36 +0000 |
commit | 00ebfd4b43cb3e7fc81ef463c83f448b206c1a1e (patch) | |
tree | 70ad4ea558af1c50030bd198bc90b1cc0b3536b7 /llvm/lib/MC/ELFObjectWriter.cpp | |
parent | d7f613dd7671f5f7732b7ddcded3ec960bfddb53 (diff) | |
download | bcm5719-llvm-00ebfd4b43cb3e7fc81ef463c83f448b206c1a1e.tar.gz bcm5719-llvm-00ebfd4b43cb3e7fc81ef463c83f448b206c1a1e.zip |
Simplify. NFC.
llvm-svn: 257689
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/ELFObjectWriter.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index e6552beefd0..f3b2a86f6bc 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -618,6 +618,7 @@ void ELFObjectWriter::recordRelocation(MCAssembler &Asm, const MCSectionELF &FixupSection = cast<MCSectionELF>(*Fragment->getParent()); uint64_t C = Target.getConstant(); uint64_t FixupOffset = Layout.getFragmentOffset(Fragment) + Fixup.getOffset(); + MCContext &Ctx = Asm.getContext(); if (const MCSymbolRefExpr *RefB = Target.getSymB()) { assert(RefB->getKind() == MCSymbolRefExpr::VK_None && @@ -631,7 +632,7 @@ void ELFObjectWriter::recordRelocation(MCAssembler &Asm, // or (A + C - R). If B = R + K and the relocation is not pcrel, we can // replace B to implement it: (A - R - K + C) if (IsPCRel) { - Asm.getContext().reportError( + Ctx.reportError( Fixup.getLoc(), "No relocation available to represent this relative expression"); return; @@ -640,24 +641,23 @@ void ELFObjectWriter::recordRelocation(MCAssembler &Asm, const auto &SymB = cast<MCSymbolELF>(RefB->getSymbol()); if (SymB.isUndefined()) { - Asm.getContext().reportError( - Fixup.getLoc(), - Twine("symbol '") + SymB.getName() + - "' can not be undefined in a subtraction expression"); + Ctx.reportError(Fixup.getLoc(), + Twine("symbol '") + SymB.getName() + + "' can not be undefined in a subtraction expression"); return; } assert(!SymB.isAbsolute() && "Should have been folded"); const MCSection &SecB = SymB.getSection(); if (&SecB != &FixupSection) { - Asm.getContext().reportError( - Fixup.getLoc(), "Cannot represent a difference across sections"); + Ctx.reportError(Fixup.getLoc(), + "Cannot represent a difference across sections"); return; } if (::isWeak(SymB)) { - Asm.getContext().reportError( - Fixup.getLoc(), "Cannot represent a subtraction with a weak symbol"); + Ctx.reportError(Fixup.getLoc(), + "Cannot represent a subtraction with a weak symbol"); return; } |