diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-02-03 10:48:31 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-02-03 10:48:31 +0000 |
commit | d9d2f187759d0154574657c195068d367c338473 (patch) | |
tree | 5b467a7f84e18ccf93fceccc6ed4ef210ea3de94 /lib/Object | |
parent | fa987f08fb237e61e4f542572535546d92838b4f (diff) | |
download | external_llvm-d9d2f187759d0154574657c195068d367c338473.zip external_llvm-d9d2f187759d0154574657c195068d367c338473.tar.gz external_llvm-d9d2f187759d0154574657c195068d367c338473.tar.bz2 |
[Support] Add LLVM_IS_UNALIGNED_ACCESS_FAST.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r-- | lib/Object/ELFObjectFile.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/Object/ELFObjectFile.cpp b/lib/Object/ELFObjectFile.cpp index 160053d..cfe0eb4 100644 --- a/lib/Object/ELFObjectFile.cpp +++ b/lib/Object/ELFObjectFile.cpp @@ -27,30 +27,42 @@ ObjectFile *ObjectFile::createELFObjectFile(MemoryBuffer *Object) { 1ULL << CountTrailingZeros_64(uintptr_t(Object->getBufferStart())); if (Ident.first == ELF::ELFCLASS32 && Ident.second == ELF::ELFDATA2LSB) +#if !LLVM_IS_UNALIGNED_ACCESS_FAST if (MaxAlignment >= 4) return new ELFObjectFile<ELFType<support::little, 4, false> >(Object, ec); - else if (MaxAlignment >= 2) + else +#endif + if (MaxAlignment >= 2) return new ELFObjectFile<ELFType<support::little, 2, false> >(Object, ec); else llvm_unreachable("Invalid alignment for ELF file!"); else if (Ident.first == ELF::ELFCLASS32 && Ident.second == ELF::ELFDATA2MSB) +#if !LLVM_IS_UNALIGNED_ACCESS_FAST if (MaxAlignment >= 4) return new ELFObjectFile<ELFType<support::big, 4, false> >(Object, ec); - else if (MaxAlignment >= 2) + else +#endif + if (MaxAlignment >= 2) return new ELFObjectFile<ELFType<support::big, 2, false> >(Object, ec); else llvm_unreachable("Invalid alignment for ELF file!"); else if (Ident.first == ELF::ELFCLASS64 && Ident.second == ELF::ELFDATA2MSB) +#if !LLVM_IS_UNALIGNED_ACCESS_FAST if (MaxAlignment >= 8) return new ELFObjectFile<ELFType<support::big, 8, true> >(Object, ec); - else if (MaxAlignment >= 2) + else +#endif + if (MaxAlignment >= 2) return new ELFObjectFile<ELFType<support::big, 2, true> >(Object, ec); else llvm_unreachable("Invalid alignment for ELF file!"); else if (Ident.first == ELF::ELFCLASS64 && Ident.second == ELF::ELFDATA2LSB) { +#if !LLVM_IS_UNALIGNED_ACCESS_FAST if (MaxAlignment >= 8) return new ELFObjectFile<ELFType<support::little, 8, true> >(Object, ec); - else if (MaxAlignment >= 2) + else +#endif + if (MaxAlignment >= 2) return new ELFObjectFile<ELFType<support::little, 2, true> >(Object, ec); else llvm_unreachable("Invalid alignment for ELF file!"); |