aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2023-01-31 14:10:25 +0000
committerGuillaume Chatelet <gchatelet@google.com>2023-01-31 14:12:51 +0000
commite098ee726eff11f680149122511d2883cb50e8d2 (patch)
tree906a580bc0f9195b84c88fe22f02234c72255ed9 /llvm/lib/LTO/LTO.cpp
parent6717efe74da825214cb4d307ad35e5fbda353301 (diff)
downloadllvm-e098ee726eff11f680149122511d2883cb50e8d2.zip
llvm-e098ee726eff11f680149122511d2883cb50e8d2.tar.gz
llvm-e098ee726eff11f680149122511d2883cb50e8d2.tar.bz2
Revert D142708 "[NFC] Transition GlobalObject alignment from MaybeAlign to Align"
This is breaking the build bots. e.g., https://lab.llvm.org/buildbot/#/builders/121/builds/27549 This reverts commit 6717efe74da825214cb4d307ad35e5fbda353301.
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 7920481..1cd48ad 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -839,7 +839,8 @@ LTO::addRegularLTO(BitcodeModule BM, ArrayRef<InputFile::Symbol> Syms,
auto &CommonRes = RegularLTO.Commons[std::string(Sym.getIRName())];
CommonRes.Size = std::max(CommonRes.Size, Sym.getCommonSize());
if (uint32_t SymAlignValue = Sym.getCommonAlignment()) {
- CommonRes.Align = std::max(Align(SymAlignValue), CommonRes.Align);
+ const Align SymAlign(SymAlignValue);
+ CommonRes.Align = std::max(SymAlign, CommonRes.Align.valueOrOne());
}
CommonRes.Prevailing |= Res.Prevailing;
}