diff options
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 39e84ff..7f90284 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -1990,17 +1990,10 @@ MachOObjectFile::getSectionContents(DataRefImpl Sec) const { return getSectionContents(Offset, Size); } -uint64_t MachOObjectFile::getSectionAlignment(DataRefImpl Sec) const { - uint32_t Align; - if (is64Bit()) { - MachO::section_64 Sect = getSection64(Sec); - Align = Sect.align; - } else { - MachO::section Sect = getSection(Sec); - Align = Sect.align; - } +Align MachOObjectFile::getSectionAlignment(DataRefImpl Sec) const { - return uint64_t(1) << Align; + return is64Bit() ? Align(1ULL << getSection64(Sec).align) + : Align(1ULL << getSection(Sec).align); } Expected<SectionRef> MachOObjectFile::getSection(unsigned SectionIndex) const { |