diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2017-10-10 19:07:10 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2017-10-10 19:07:10 +0000 |
commit | 563ede149a26bcf45f121cd372a12b2f9fa6edf3 (patch) | |
tree | f8a5ec51c1fcc76b8f1871635d1d2046e7e29f18 /llvm/lib/ExecutionEngine | |
parent | 36a2eb34ed394b7277df6ef9b935bfe2be3402b8 (diff) | |
download | bcm5719-llvm-563ede149a26bcf45f121cd372a12b2f9fa6edf3.tar.gz bcm5719-llvm-563ede149a26bcf45f121cd372a12b2f9fa6edf3.zip |
Simplify. NFC.
llvm-svn: 315347
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp index a079d95a50f..bf527f5ca82 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -133,11 +133,9 @@ public: }; template <typename ELFT> -std::unique_ptr<DyldELFObject<ELFT>> -createRTDyldELFObject(MemoryBufferRef Buffer, - const ObjectFile &SourceObject, - const LoadedELFObjectInfo &L, - std::error_code &ec) { +static std::unique_ptr<DyldELFObject<ELFT>> +createRTDyldELFObject(MemoryBufferRef Buffer, const ObjectFile &SourceObject, + const LoadedELFObjectInfo &L, std::error_code &ec) { typedef typename ELFFile<ELFT>::Elf_Shdr Elf_Shdr; typedef typename ELFDataTypeTypedefHelper<ELFT>::value_type addr_type; @@ -166,8 +164,8 @@ createRTDyldELFObject(MemoryBufferRef Buffer, return Obj; } -OwningBinary<ObjectFile> createELFDebugObject(const ObjectFile &Obj, - const LoadedELFObjectInfo &L) { +static OwningBinary<ObjectFile> +createELFDebugObject(const ObjectFile &Obj, const LoadedELFObjectInfo &L) { assert(Obj.isELF() && "Not an ELF object file."); std::unique_ptr<MemoryBuffer> Buffer = @@ -176,23 +174,19 @@ OwningBinary<ObjectFile> createELFDebugObject(const ObjectFile &Obj, std::error_code ec; std::unique_ptr<ObjectFile> DebugObj; - if (Obj.getBytesInAddress() == 4 && Obj.isLittleEndian()) { - typedef ELFType<support::little, false> ELF32LE; + if (Obj.getBytesInAddress() == 4 && Obj.isLittleEndian()) DebugObj = createRTDyldELFObject<ELF32LE>(Buffer->getMemBufferRef(), Obj, L, ec); - } else if (Obj.getBytesInAddress() == 4 && !Obj.isLittleEndian()) { - typedef ELFType<support::big, false> ELF32BE; + else if (Obj.getBytesInAddress() == 4 && !Obj.isLittleEndian()) DebugObj = createRTDyldELFObject<ELF32BE>(Buffer->getMemBufferRef(), Obj, L, ec); - } else if (Obj.getBytesInAddress() == 8 && !Obj.isLittleEndian()) { - typedef ELFType<support::big, true> ELF64BE; + else if (Obj.getBytesInAddress() == 8 && !Obj.isLittleEndian()) DebugObj = createRTDyldELFObject<ELF64BE>(Buffer->getMemBufferRef(), Obj, L, ec); - } else if (Obj.getBytesInAddress() == 8 && Obj.isLittleEndian()) { - typedef ELFType<support::little, true> ELF64LE; + else if (Obj.getBytesInAddress() == 8 && Obj.isLittleEndian()) DebugObj = createRTDyldELFObject<ELF64LE>(Buffer->getMemBufferRef(), Obj, L, ec); - } else + else llvm_unreachable("Unexpected ELF format"); assert(!ec && "Could not construct copy ELF object file"); |