From f217ef0d75a4438f610764e582823ffd4807d75d Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 26 Mar 2015 02:03:44 +0000 Subject: Use alignment values everywhere instead of log2. This patch defines implicit conversion between integers and PowerOf2 instances, so uses of the classes is now implicit and look like regular integers. Now we are ready to remove the scaffolding. llvm-svn: 233245 --- lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp') diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp index 0f8bba49eaa..5d851898fc5 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp @@ -291,7 +291,7 @@ MachOFileLayout::MachOFileLayout(const NormalizedFile &file) uint64_t offset = _startOfSectionsContent; for (const Section § : file.sections) { if (sect.type != llvm::MachO::S_ZEROFILL) { - offset = llvm::RoundUpToAlignment(offset, sect.alignment.get()); + offset = llvm::RoundUpToAlignment(offset, sect.alignment); _sectInfo[§].fileOffset = offset; offset += sect.content.size(); } else { @@ -613,7 +613,7 @@ std::error_code MachOFileLayout::writeSingleSegmentLoadCommand(uint8_t *&lc) { sout->addr = sin.address; sout->size = sin.content.size(); sout->offset = _sectInfo[&sin].fileOffset; - sout->align = llvm::Log2_32(sin.alignment.get()); + sout->align = llvm::Log2_32(sin.alignment); sout->reloff = sin.relocations.empty() ? 0 : relOffset; sout->nreloc = sin.relocations.size(); sout->flags = sin.type | sin.attributes; @@ -661,7 +661,7 @@ std::error_code MachOFileLayout::writeSegmentLoadCommands(uint8_t *&lc) { sect->offset = 0; else sect->offset = section->address - seg.address + segInfo.fileOffset; - sect->align = llvm::Log2_32(section->alignment.get()); + sect->align = llvm::Log2_32(section->alignment); sect->reloff = 0; sect->nreloc = 0; sect->flags = section->type | section->attributes; -- cgit v1.2.3