From 4652c595680cee60e2ea1bb6f6a447a6a993592e Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Sat, 23 Apr 2016 22:26:31 +0000 Subject: [MC/ELF] Pass Fixup to getRelocType64. In preparation for other changes. llvm-svn: 267300 --- llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp index a020155e03d..9f2d2738d1d 100644 --- a/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp +++ b/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp @@ -84,9 +84,10 @@ static void checkIs32(MCContext &Ctx, SMLoc Loc, X86_64RelType Type) { "32 bit reloc applied to a field with a different size"); } -static unsigned getRelocType64(MCContext &Ctx, SMLoc Loc, +static unsigned getRelocType64(MCContext &Ctx, const MCFixup &Fixup, MCSymbolRefExpr::VariantKind Modifier, X86_64RelType Type, bool IsPCRel) { + SMLoc Loc = Fixup.getLoc(); switch (Modifier) { default: llvm_unreachable("Unimplemented"); @@ -258,7 +259,7 @@ unsigned X86ELFObjectWriter::getRelocType(MCContext &Ctx, const MCValue &Target, MCSymbolRefExpr::VariantKind Modifier = Target.getAccessVariant(); X86_64RelType Type = getType64(Fixup.getKind(), Modifier, IsPCRel); if (getEMachine() == ELF::EM_X86_64) - return getRelocType64(Ctx, Fixup.getLoc(), Modifier, Type, IsPCRel); + return getRelocType64(Ctx, Fixup, Modifier, Type, IsPCRel); assert((getEMachine() == ELF::EM_386 || getEMachine() == ELF::EM_IAMCU) && "Unsupported ELF machine type."); -- cgit v1.2.3