ELF: Simplify alignment check. NFC.

llvm-svn: 234791
This commit is contained in:
Rui Ueyama 2015-04-13 20:04:50 +00:00
parent cfba8b3481
commit fa92b4c9d8
1 changed files with 1 additions and 4 deletions

View File

@ -50,11 +50,8 @@ private:
using namespace llvm::support;
using llvm::object::ELFType;
size_t align =
1ULL << llvm::countTrailingZeros(uintptr_t(mb->getBufferStart()));
if (align < 2)
if (uintptr_t(mb->getBufferStart()) & 1)
llvm_unreachable("Invalid alignment for ELF file!");
unsigned char size;
unsigned char endian;
std::tie(size, endian) = llvm::object::getElfArchType(mb->getBuffer());