Skip to content

[IRGen] Adjust for LLVM r373054 #27441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/IRGen/GenCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,7 @@ static void emitCoerceAndExpand(IRGenFunction &IGF, Explosion &in,
Alignment(coercionTyLayout->getAlignment().value());
auto alloca = cast<llvm::AllocaInst>(temporary.getAddress());
if (alloca->getAlignment() < coercionTyAlignment.getValue()) {
alloca->setAlignment(coercionTyAlignment.getValue());
alloca->setAlignment(llvm::MaybeAlign(coercionTyAlignment.getValue()));
temporary = Address(temporary.getAddress(), coercionTyAlignment);
}

Expand Down Expand Up @@ -2353,7 +2353,7 @@ static void externalizeArguments(IRGenFunction &IGF, const Callee &callee,
auto ABIAlign = AI.getIndirectAlign();
if (ABIAlign > addr.getAlignment()) {
auto *AS = cast<llvm::AllocaInst>(addr.getAddress());
AS->setAlignment(ABIAlign.getQuantity());
AS->setAlignment(llvm::MaybeAlign(ABIAlign.getQuantity()));
addr = Address(addr.getAddress(), Alignment(ABIAlign.getQuantity()));
}
}
Expand Down Expand Up @@ -3027,7 +3027,7 @@ static void adjustAllocaAlignment(const llvm::DataLayout &DL,
Alignment layoutAlignment = Alignment(layout->getAlignment().value());
auto alloca = cast<llvm::AllocaInst>(allocaAddr.getAddress());
if (alloca->getAlignment() < layoutAlignment.getValue()) {
alloca->setAlignment(layoutAlignment.getValue());
alloca->setAlignment(llvm::MaybeAlign(layoutAlignment.getValue()));
allocaAddr = Address(allocaAddr.getAddress(), layoutAlignment);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/IRGen/GenDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4152,7 +4152,7 @@ Address IRGenFunction::createAlloca(llvm::Type *type,
llvm::AllocaInst *alloca =
new llvm::AllocaInst(type, IGM.DataLayout.getAllocaAddrSpace(), name,
AllocaIP);
alloca->setAlignment(alignment.getValue());
alloca->setAlignment(llvm::MaybeAlign(alignment.getValue()));
return Address(alloca, alignment);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/IRGen/GenOpaque.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ StackAddress IRGenFunction::emitDynamicAlloca(llvm::Type *eltTy,

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

assert(!isInEntryBlock ||
getActiveDominancePoint().isUniversal() &&
Expand Down
2 changes: 1 addition & 1 deletion lib/IRGen/IRBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class IRBuilder : public IRBuilderBase {
llvm::LoadInst *CreateLoad(llvm::Value *addr, Alignment align,
const llvm::Twine &name = "") {
llvm::LoadInst *load = IRBuilderBase::CreateLoad(addr, name);
load->setAlignment(align.getValue());
load->setAlignment(llvm::MaybeAlign(align.getValue()));
return load;
}
llvm::LoadInst *CreateLoad(Address addr, const llvm::Twine &name = "") {
Expand Down