diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-01-06 23:25:42 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-01-06 23:25:42 +0000 |
| commit | f71358dcc9ce42268b853ca48d1db550077a81cf (patch) | |
| tree | a14f5256f7ede2060ccbb98877faa701fe8f1dc6 /lld/ELF/OutputSections.cpp | |
| parent | bc82dedd26a37d72abe34b075ee9605006862ba8 (diff) | |
| download | bcm5719-llvm-f71358dcc9ce42268b853ca48d1db550077a81cf.tar.gz bcm5719-llvm-f71358dcc9ce42268b853ca48d1db550077a81cf.zip | |
Define align() and use that instead of RoundUpToAlignment().
The name "RoundUpToAlignment" is too long compared to what it does.
llvm-svn: 256993
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
| -rw-r--r-- | lld/ELF/OutputSections.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 3ec498ec211..97092eb3825 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -770,7 +770,7 @@ void OutputSection<ELFT>::addSection(InputSectionBase<ELFT> *C) { this->Header.sh_addralign = Align; uintX_t Off = this->Header.sh_size; - Off = RoundUpToAlignment(Off, Align); + Off = align(Off, Align); S->OutSecOff = Off; Off += S->getSize(); this->Header.sh_size = Off; @@ -971,7 +971,7 @@ void EHOutputSection<ELFT>::addSectionAux( auto P = CieMap.insert(std::make_pair(CieInfo, Cies.size())); if (P.second) { Cies.push_back(C); - this->Header.sh_size += RoundUpToAlignment(Length, sizeof(uintX_t)); + this->Header.sh_size += align(Length, sizeof(uintX_t)); } OffsetToIndex[Offset] = P.first->second; } else { @@ -984,7 +984,7 @@ void EHOutputSection<ELFT>::addSectionAux( if (I == OffsetToIndex.end()) error("Invalid CIE reference"); Cies[I->second].Fdes.push_back(EHRegion<ELFT>(S, Index)); - this->Header.sh_size += RoundUpToAlignment(Length, sizeof(uintX_t)); + this->Header.sh_size += align(Length, sizeof(uintX_t)); } } @@ -1037,7 +1037,7 @@ static typename ELFFile<ELFT>::uintX_t writeAlignedCieOrFde(StringRef Data, uint8_t *Buf) { typedef typename ELFFile<ELFT>::uintX_t uintX_t; const endianness E = ELFT::TargetEndianness; - uint64_t Len = RoundUpToAlignment(Data.size(), sizeof(uintX_t)); + uint64_t Len = align(Data.size(), sizeof(uintX_t)); write32<E>(Buf, Len - 4); memcpy(Buf + 4, Data.data() + 4, Data.size() - 4); return Len; |

