[RuntimeDyld] Change the return type of decodeAddend to match the storage type.
authorJuergen Ributzka <juergen@apple.com>
Tue, 22 Jul 2014 21:42:46 +0000 (21:42 +0000)
committerJuergen Ributzka <juergen@apple.com>
Tue, 22 Jul 2014 21:42:46 +0000 (21:42 +0000)
llvm-svn: 213686

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h

index 58fb515..ba7c7cb 100644 (file)
@@ -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;
 }
index 7d1dc02..ecbbf82 100644 (file)
@@ -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);
   }