summaryrefslogtreecommitdiff
path: root/lib/Target/X86/MCTargetDesc
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-06-30 00:33:59 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-06-30 00:33:59 +0000
commitde4d84470408a14ec1dfc33df38de8730cefc561 (patch)
tree038d7164b28c84894d809506343ab9a105e97080 /lib/Target/X86/MCTargetDesc
parent1a5b04c7250ea502e307076cf99bd2514e1d5fd0 (diff)
Cleanup getRelocationAddend.
Realistically, this will be returning ErrorOr for some time as refactoring the user code to check once per section will take some time. Given that, use it for checking if a relocation has addend or not. While at it, add ELFRelocationRef to simplify the users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/MCTargetDesc')
-rw-r--r--lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp b/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp
index 8d2ae67dd7b..85783844358 100644
--- a/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp
+++ b/lib/Target/X86/MCTargetDesc/X86ELFRelocationInfo.cpp
@@ -31,9 +31,8 @@ public:
StringRef SymName; SymI->getName(SymName);
uint64_t SymAddr; SymI->getAddress(SymAddr);
- auto *Obj = cast<ELFObjectFileBase>(Rel.getObject());
uint64_t SymSize = SymI->getSize();
- int64_t Addend = *Obj->getRelocationAddend(Rel.getRawDataRefImpl());
+ int64_t Addend = *ELFRelocationRef(Rel).getAddend();
MCSymbol *Sym = Ctx.getOrCreateSymbol(SymName);
// FIXME: check that the value is actually the same.