From 10fcac7b0768dfb1d9fb3030f2bb664ad8e4e65b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 30 Jun 2015 20:32:26 +0000 Subject: Use ErrorOr in getRelocationAdress. We can probably do better in this method, but this is an improvement and enables further ErrorOr cleanups. llvm-svn: 241114 --- llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp') diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp index d4a680d749a..2ae14ac0fa8 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp @@ -97,9 +97,8 @@ void RuntimeDyldMachO::makeValueAddendPCRel(RelocationValueRef &Value, bool IsPCRel = Obj.getAnyRelocationPCRel(RelInfo); if (IsPCRel) { - uint64_t RelocAddr = 0; - RI->getAddress(RelocAddr); - Value.Offset += RelocAddr + OffsetToNextPC; + ErrorOr RelocAddr = RI->getAddress(); + Value.Offset += *RelocAddr + OffsetToNextPC; } } -- cgit v1.2.3