[Alignment] fix build

llvm-svn: 372562
This commit is contained in:
Guillaume Chatelet 2019-09-23 09:04:12 +00:00
parent 93ca36d756
commit f7caf3cac8
1 changed files with 6 additions and 5 deletions

View File

@ -4132,9 +4132,10 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
auto scalarAlign = CGM.getDataLayout().getPrefTypeAlignment(scalarType);
// Materialize to a temporary.
addr = CreateTempAlloca(RV.getScalarVal()->getType(),
addr = CreateTempAlloca(
RV.getScalarVal()->getType(),
CharUnits::fromQuantity(std::max(
layout->getAlignment(), scalarAlign)),
(unsigned)layout->getAlignment().value(), scalarAlign)),
"tmp",
/*ArraySize=*/nullptr, &AllocaAddr);
tempSize = EmitLifetimeStart(scalarSize, AllocaAddr.getPointer());