summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-03-26 01:12:32 +0000
committerRui Ueyama <ruiu@google.com>2015-03-26 01:12:32 +0000
commitc3d18f512054d8268d1e1a2e5935167cd3db6480 (patch)
treebbba5c909b78c38fc03457bee4e2e3f749662115 /lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
parent2c6e0597c68c8d51b9fced91803b329a13350e64 (diff)
downloadbcm5719-llvm-c3d18f512054d8268d1e1a2e5935167cd3db6480.tar.gz
bcm5719-llvm-c3d18f512054d8268d1e1a2e5935167cd3db6480.zip
Remove implicit constructor and operator int from PowerOf2.
This patch is to make instantiation and conversion to an integer explicit, so that we can mechanically replace all occurrences of the class with integer in the next step. Now get() returns an alignment value rather than its log2 value. llvm-svn: 233242
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp')
-rw-r--r--lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
index 07a6dbfe569..5b3d942c0ff 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp
@@ -297,7 +297,7 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
section.type = (SectionType)(read32(&sect->flags, isBig) &
SECTION_TYPE);
section.attributes = read32(&sect->flags, isBig) & SECTION_ATTRIBUTES;
- section.alignment = read32(&sect->align, isBig);
+ section.alignment = PowerOf2(read32(&sect->align, isBig));
section.address = read64(&sect->addr, isBig);
const uint8_t *content =
(const uint8_t *)start + read32(&sect->offset, isBig);
@@ -341,7 +341,7 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb,
SECTION_TYPE);
section.attributes =
read32((const uint8_t *)&sect->flags, isBig) & SECTION_ATTRIBUTES;
- section.alignment = read32(&sect->align, isBig);
+ section.alignment = PowerOf2(read32(&sect->align, isBig));
section.address = read32(&sect->addr, isBig);
const uint8_t *content =
(const uint8_t *)start + read32(&sect->offset, isBig);
OpenPOWER on IntegriCloud