summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-03-26 02:03:44 +0000
committerRui Ueyama <ruiu@google.com>2015-03-26 02:03:44 +0000
commitf217ef0d75a4438f610764e582823ffd4807d75d (patch)
tree046816af6939a27aa592028ee9effc5fc4e3d92a /lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp
parentf006f4d62c9375288f25870f2b020609d67f6b11 (diff)
downloadbcm5719-llvm-f217ef0d75a4438f610764e582823ffd4807d75d.tar.gz
bcm5719-llvm-f217ef0d75a4438f610764e582823ffd4807d75d.zip
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
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryWriter.cpp6
1 files changed, 3 insertions, 3 deletions
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 &sect : file.sections) {
if (sect.type != llvm::MachO::S_ZEROFILL) {
- offset = llvm::RoundUpToAlignment(offset, sect.alignment.get());
+ offset = llvm::RoundUpToAlignment(offset, sect.alignment);
_sectInfo[&sect].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;
OpenPOWER on IntegriCloud