summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2019-09-30 13:34:44 +0000
committerGuillaume Chatelet <gchatelet@google.com>2019-09-30 13:34:44 +0000
commitab11b9188d75a9cc24faa1e76592e4a1903a6e20 (patch)
tree349aa49eb0636054f5b049d3c35f45baddce9e1c /llvm/lib/IR
parent9b034293fa5d2dfdaa4dd894b88ce859f9042954 (diff)
downloadbcm5719-llvm-ab11b9188d75a9cc24faa1e76592e4a1903a6e20.tar.gz
bcm5719-llvm-ab11b9188d75a9cc24faa1e76592e4a1903a6e20.zip
[Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)
Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: jholewinski, arsenm, jvesely, nhaehnle, eraman, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D68141 llvm-svn: 373207
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/Core.cpp2
-rw-r--r--llvm/lib/IR/Instructions.cpp8
2 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index ab7a7471d46..a599a089987 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -2010,7 +2010,7 @@ void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes) {
if (GlobalObject *GV = dyn_cast<GlobalObject>(P))
GV->setAlignment(Bytes);
else if (AllocaInst *AI = dyn_cast<AllocaInst>(P))
- AI->setAlignment(Bytes);
+ AI->setAlignment(MaybeAlign(Bytes));
else if (LoadInst *LI = dyn_cast<LoadInst>(P))
LI->setAlignment(MaybeAlign(Bytes));
else if (StoreInst *SI = dyn_cast<StoreInst>(P))
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index f48bf80cd58..0f000623bdb 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -1228,7 +1228,7 @@ AllocaInst::AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize,
: UnaryInstruction(PointerType::get(Ty, AddrSpace), Alloca,
getAISize(Ty->getContext(), ArraySize), InsertBefore),
AllocatedType(Ty) {
- setAlignment(Align);
+ setAlignment(MaybeAlign(Align));
assert(!Ty->isVoidTy() && "Cannot allocate void!");
setName(Name);
}
@@ -1239,15 +1239,11 @@ AllocaInst::AllocaInst(Type *Ty, unsigned AddrSpace, Value *ArraySize,
: UnaryInstruction(PointerType::get(Ty, AddrSpace), Alloca,
getAISize(Ty->getContext(), ArraySize), InsertAtEnd),
AllocatedType(Ty) {
- setAlignment(Align);
+ setAlignment(MaybeAlign(Align));
assert(!Ty->isVoidTy() && "Cannot allocate void!");
setName(Name);
}
-void AllocaInst::setAlignment(unsigned Align) {
- setAlignment(llvm::MaybeAlign(Align));
-}
-
void AllocaInst::setAlignment(MaybeAlign Align) {
assert((!Align || *Align <= MaximumAlignment) &&
"Alignment is greater than MaximumAlignment!");
OpenPOWER on IntegriCloud