[llvm] r315347 - Simplify. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 10 12:07:10 PDT 2017
Author: rafael
Date: Tue Oct 10 12:07:10 2017
New Revision: 315347
URL: http://llvm.org/viewvc/llvm-project?rev=315347&view=rev
Log:
Simplify. NFC.
Modified:
llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
Modified: llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp?rev=315347&r1=315346&r2=315347&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp Tue Oct 10 12:07:10 2017
@@ -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 Bu
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> createELFDebugO
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");
More information about the llvm-commits
mailing list