From fbd40c36eb6ac8cd80f1e7841fae5e5da5d0c92d Mon Sep 17 00:00:00 2001 From: Juergen Ributzka Date: Tue, 29 Jul 2014 19:57:11 +0000 Subject: [RuntimeDyld][AArch64] Make encode/decodeAddend more typesafe by using the relocation enum type. NFCI. llvm-svn: 214204 --- llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h') diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h index abc98944a82..7450f1141e1 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h @@ -54,7 +54,7 @@ protected: /// Extract the addend encoded in the instruction. int64_t decodeAddend(uint8_t *LocalAddress, unsigned NumBytes, - uint32_t RelType) const; + MachO::RelocationInfoType RelType) const; /// Construct a RelocationValueRef representing the relocation target. /// For Symbols in known sections, this will return a RelocationValueRef @@ -138,7 +138,8 @@ protected: RI->getOffset(Offset); uint8_t *LocalAddress = Section.Address + Offset; unsigned NumBytes = 1 << Size; - uint32_t RelType = Obj.getAnyRelocationType(RelInfo); + MachO::RelocationInfoType RelType = + static_cast(Obj.getAnyRelocationType(RelInfo)); int64_t Addend = impl().decodeAddend(LocalAddress, NumBytes, RelType); return RelocationEntry(SectionID, Offset, RelType, Addend, IsPCRel, Size); -- cgit v1.2.3