summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.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/PECOFF/WriterPECOFF.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/PECOFF/WriterPECOFF.cpp')
-rw-r--r--lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp b/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
index d34e2d3d63f..024a1c273fe 100644
--- a/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
@@ -849,10 +849,10 @@ uint64_t AtomChunk::memAlign() const {
// the section. We restore that here.
if (_atomLayouts.empty())
return _ctx.getPageSize();
- int align = _ctx.getPageSize();
+ unsigned align = _ctx.getPageSize();
for (auto atomLayout : _atomLayouts) {
auto *atom = cast<const DefinedAtom>(atomLayout->_atom);
- align = std::max(align, 1 << atom->alignment().powerOf2);
+ align = std::max(align, (unsigned)atom->alignment().powerOf2.get());
}
return align;
}
@@ -860,7 +860,7 @@ uint64_t AtomChunk::memAlign() const {
void AtomChunk::appendAtom(const DefinedAtom *atom) {
// Atom may have to be at a proper alignment boundary. If so, move the
// pointer to make a room after the last atom before adding new one.
- _size = llvm::RoundUpToAlignment(_size, 1 << atom->alignment().powerOf2);
+ _size = llvm::RoundUpToAlignment(_size, atom->alignment().powerOf2.get());
// Create an AtomLayout and move the current pointer.
auto *layout = new (_alloc) AtomLayout(atom, _size, _size);
OpenPOWER on IntegriCloud