summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h
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/ELF/Hexagon/HexagonSectionChunks.h
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/ELF/Hexagon/HexagonSectionChunks.h')
-rw-r--r--lld/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h
index 5b3fbbbd899..6157599856d 100644
--- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h
+++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h
@@ -38,7 +38,7 @@ public:
const lld::AtomLayout *appendAtom(const Atom *atom) {
const DefinedAtom *definedAtom = cast<DefinedAtom>(atom);
DefinedAtom::Alignment atomAlign = definedAtom->alignment();
- uint64_t alignment = 1u << atomAlign.powerOf2;
+ uint64_t alignment = atomAlign.powerOf2.get();
this->_atoms.push_back(new (this->_alloc) lld::AtomLayout(atom, 0, 0));
// Set the section alignment to the largest alignment
// std::max doesn't support uint64_t
@@ -57,8 +57,8 @@ void SDataSection<HexagonELFType>::doPreFlight() {
const lld::AtomLayout * B) {
const DefinedAtom *definedAtomA = cast<DefinedAtom>(A->_atom);
const DefinedAtom *definedAtomB = cast<DefinedAtom>(B->_atom);
- int64_t alignmentA = 1 << definedAtomA->alignment().powerOf2;
- int64_t alignmentB = 1 << definedAtomB->alignment().powerOf2;
+ int64_t alignmentA = definedAtomA->alignment().powerOf2.get();
+ int64_t alignmentB = definedAtomB->alignment().powerOf2.get();
if (alignmentA == alignmentB) {
if (definedAtomA->merge() == DefinedAtom::mergeAsTentative)
return false;
OpenPOWER on IntegriCloud