[llvm] r213686 - [RuntimeDyld] Change the return type of decodeAddend to match the storage type.
Juergen Ributzka
juergen at apple.com
Tue Jul 22 14:42:46 PDT 2014
Author: ributzka
Date: Tue Jul 22 16:42:46 2014
New Revision: 213686
URL: http://llvm.org/viewvc/llvm-project?rev=213686&view=rev
Log:
[RuntimeDyld] Change the return type of decodeAddend to match the storage type.
Modified:
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp?rev=213686&r1=213685&r2=213686&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp Tue Jul 22 16:42:46 2014
@@ -27,9 +27,9 @@ using namespace llvm::object;
namespace llvm {
-uint64_t RuntimeDyldMachO::decodeAddend(uint8_t *LocalAddress, unsigned NumBytes,
- uint32_t RelType) const {
- uint64_t Addend = 0;
+int64_t RuntimeDyldMachO::decodeAddend(uint8_t *LocalAddress, unsigned NumBytes,
+ uint32_t RelType) const {
+ int64_t Addend = 0;
memcpy(&Addend, LocalAddress, NumBytes);
return Addend;
}
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h?rev=213686&r1=213685&r2=213686&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h Tue Jul 22 16:42:46 2014
@@ -52,8 +52,8 @@ protected:
RuntimeDyldMachO(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) {}
/// Extract the addend encoded in the instruction.
- uint64_t decodeAddend(uint8_t *LocalAddress, unsigned NumBytes,
- uint32_t RelType) const;
+ int64_t decodeAddend(uint8_t *LocalAddress, unsigned NumBytes,
+ uint32_t RelType) const;
/// Construct a RelocationValueRef representing the relocation target.
/// For Symbols in known sections, this will return a RelocationValueRef
@@ -138,7 +138,7 @@ protected:
uint8_t *LocalAddress = Section.Address + Offset;
unsigned NumBytes = 1 << Size;
uint32_t RelType = Obj.getAnyRelocationType(RelInfo);
- uint64_t Addend = impl().decodeAddend(LocalAddress, NumBytes, RelType);
+ int64_t Addend = impl().decodeAddend(LocalAddress, NumBytes, RelType);
return RelocationEntry(SectionID, Offset, RelType, Addend, IsPCRel, Size);
}
More information about the llvm-commits
mailing list