Skip to content

Commit a79fc96

Browse files
authored
Merge pull request #27441 from smeenai/maybealign
[IRGen] Adjust for LLVM r373054
2 parents 0ba3e30 + a007f64 commit a79fc96

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,7 +2076,7 @@ static void emitCoerceAndExpand(IRGenFunction &IGF, Explosion &in,
20762076
Alignment(coercionTyLayout->getAlignment().value());
20772077
auto alloca = cast<llvm::AllocaInst>(temporary.getAddress());
20782078
if (alloca->getAlignment() < coercionTyAlignment.getValue()) {
2079-
alloca->setAlignment(coercionTyAlignment.getValue());
2079+
alloca->setAlignment(llvm::MaybeAlign(coercionTyAlignment.getValue()));
20802080
temporary = Address(temporary.getAddress(), coercionTyAlignment);
20812081
}
20822082

@@ -2353,7 +2353,7 @@ static void externalizeArguments(IRGenFunction &IGF, const Callee &callee,
23532353
auto ABIAlign = AI.getIndirectAlign();
23542354
if (ABIAlign > addr.getAlignment()) {
23552355
auto *AS = cast<llvm::AllocaInst>(addr.getAddress());
2356-
AS->setAlignment(ABIAlign.getQuantity());
2356+
AS->setAlignment(llvm::MaybeAlign(ABIAlign.getQuantity()));
23572357
addr = Address(addr.getAddress(), Alignment(ABIAlign.getQuantity()));
23582358
}
23592359
}
@@ -3027,7 +3027,7 @@ static void adjustAllocaAlignment(const llvm::DataLayout &DL,
30273027
Alignment layoutAlignment = Alignment(layout->getAlignment().value());
30283028
auto alloca = cast<llvm::AllocaInst>(allocaAddr.getAddress());
30293029
if (alloca->getAlignment() < layoutAlignment.getValue()) {
3030-
alloca->setAlignment(layoutAlignment.getValue());
3030+
alloca->setAlignment(llvm::MaybeAlign(layoutAlignment.getValue()));
30313031
allocaAddr = Address(allocaAddr.getAddress(), layoutAlignment);
30323032
}
30333033
}

lib/IRGen/GenDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4152,7 +4152,7 @@ Address IRGenFunction::createAlloca(llvm::Type *type,
41524152
llvm::AllocaInst *alloca =
41534153
new llvm::AllocaInst(type, IGM.DataLayout.getAllocaAddrSpace(), name,
41544154
AllocaIP);
4155-
alloca->setAlignment(alignment.getValue());
4155+
alloca->setAlignment(llvm::MaybeAlign(alignment.getValue()));
41564156
return Address(alloca, alignment);
41574157
}
41584158

lib/IRGen/GenOpaque.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ StackAddress IRGenFunction::emitDynamicAlloca(llvm::Type *eltTy,
549549

550550
// Emit the dynamic alloca.
551551
auto *alloca = Builder.IRBuilderBase::CreateAlloca(eltTy, arraySize, name);
552-
alloca->setAlignment(align.getValue());
552+
alloca->setAlignment(llvm::MaybeAlign(align.getValue()));
553553

554554
assert(!isInEntryBlock ||
555555
getActiveDominancePoint().isUniversal() &&

lib/IRGen/IRBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class IRBuilder : public IRBuilderBase {
125125
llvm::LoadInst *CreateLoad(llvm::Value *addr, Alignment align,
126126
const llvm::Twine &name = "") {
127127
llvm::LoadInst *load = IRBuilderBase::CreateLoad(addr, name);
128-
load->setAlignment(align.getValue());
128+
load->setAlignment(llvm::MaybeAlign(align.getValue()));
129129
return load;
130130
}
131131
llvm::LoadInst *CreateLoad(Address addr, const llvm::Twine &name = "") {

0 commit comments

Comments
 (0)