From: Rafael Espindola Date: Wed, 13 Jan 2016 22:23:36 +0000 (+0000) Subject: Simplify. NFC. X-Git-Tag: android-x86-7.1-r4~39155 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9a03a19dcdd7ec553b81271f20ebadbb26892506;p=android-x86%2Fexternal-llvm.git Simplify. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257689 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index e6552beefd0..f3b2a86f6bc 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/lib/MC/ELFObjectWriter.cpp @@ -618,6 +618,7 @@ void ELFObjectWriter::recordRelocation(MCAssembler &Asm, const MCSectionELF &FixupSection = cast(*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(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; }