diff options
author | Lang Hames <lhames@gmail.com> | 2018-04-04 00:12:12 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2018-04-04 00:12:12 +0000 |
commit | 4e319acd846b58047e237d6efeff3ac7d9d886f3 (patch) | |
tree | ff057e5d395e76956b6ab879380dcd49a0e1f152 /llvm/lib/ExecutionEngine | |
parent | 5fa2a63785d6e07029887317df6a8d7ff144bbbd (diff) | |
download | bcm5719-llvm-4e319acd846b58047e237d6efeff3ac7d9d886f3.tar.gz bcm5719-llvm-4e319acd846b58047e237d6efeff3ac7d9d886f3.zip |
Revert r329133 "[RuntimeDyld][AArch64] Add some error pluming / generation..."
This broke a number of buildbots. Looking in to it now...
llvm-svn: 329135
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h index 6cee7278524..31cedffa15b 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h @@ -13,8 +13,6 @@ #include "../RuntimeDyldMachO.h" #include "llvm/Support/Endian.h" -#include <sstream> - #define DEBUG_TYPE "dyld" namespace llvm { @@ -34,7 +32,7 @@ public: unsigned getStubAlignment() override { return 8; } /// Extract the addend encoded in the instruction / memory location. - Expected<int64_t> decodeAddend(const RelocationEntry &RE) const { + int64_t decodeAddend(const RelocationEntry &RE) const { const SectionEntry &Section = Sections[RE.SectionID]; uint8_t *LocalAddress = Section.getAddressWithOffset(RE.Offset); unsigned NumBytes = 1 << RE.Size; @@ -42,15 +40,9 @@ public: // Verify that the relocation has the correct size and alignment. switch (RE.RelType) { default: - return make_error<StringError>((std::ostringstream() - << "Unsupported relocation type: " - << getRelocName(RE.RelType)).str(), - inconvertibleErrorCode()); + llvm_unreachable("Unsupported relocation type!"); case MachO::ARM64_RELOC_UNSIGNED: - if (NumBytes != 4 && NumBytes != 8) - return make_error<StringError>("Invalid relocation size for " - "ARM64_RELOC_UNSIGNED", - inconvertibleErrorCode()); + assert((NumBytes == 4 || NumBytes == 8) && "Invalid relocation size."); break; case MachO::ARM64_RELOC_BRANCH26: case MachO::ARM64_RELOC_PAGE21: @@ -290,10 +282,7 @@ public: return processSubtractRelocation(SectionID, RelI, Obj, ObjSectionToID); RelocationEntry RE(getRelocationEntry(SectionID, Obj, RelI)); - if (auto Addend = decodeAddend(RE)) - RE.Addend = *Addend; - else - return Addend.takeError(); + RE.Addend = decodeAddend(RE); assert((ExplicitAddend == 0 || RE.Addend == 0) && "Relocation has "\ "ARM64_RELOC_ADDEND and embedded addend in the instruction."); @@ -474,23 +463,6 @@ private: return ++RelI; } - static const char *getRelocName(uint32_t RelocType) { - switch (RelocType) { - case MachO::ARM64_RELOC_UNSIGNED: return "ARM64_RELOC_UNSIGNED"; - case MachO::ARM64_RELOC_SUBTRACTOR: return "ARM64_RELOC_SUBTRACTOR"; - case MachO::ARM64_RELOC_BRANCH26: return "ARM64_RELOC_BRANCH26"; - case MachO::ARM64_RELOC_PAGE21: return "ARM64_RELOC_PAGE21"; - case MachO::ARM64_RELOC_PAGEOFF12: return "ARM64_RELOC_PAGEOFF12"; - case MachO::ARM64_RELOC_GOT_LOAD_PAGE21: return "ARM64_RELOC_GOT_LOAD_PAGE21"; - case MachO::ARM64_RELOC_GOT_LOAD_PAGEOFF12: return "ARM64_RELOC_GOT_LOAD_PAGEOFF12"; - case MachO::ARM64_RELOC_POINTER_TO_GOT: return "ARM64_RELOC_POINTER_TO_GOT"; - case MachO::ARM64_RELOC_TLVP_LOAD_PAGE21: return "ARM64_RELOC_TLVP_LOAD_PAGE21"; - case MachO::ARM64_RELOC_TLVP_LOAD_PAGEOFF12: return "ARM64_RELOC_TLVP_LOAD_PAGEOFF12"; - case MachO::ARM64_RELOC_ADDEND: return "ARM64_RELOC_ADDEND"; - } - return "Unrecognized arm64 addend"; - } - }; } |