diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2019-12-09 17:36:50 +0100 |
---|---|---|
committer | Guillaume Chatelet <gchatelet@google.com> | 2019-12-10 15:17:44 +0100 |
commit | 1b2842bf902a8b52acbef2425120533b63be5ae3 (patch) | |
tree | f3e2d677e3efb5acde068e69f28fb84741978560 /llvm/lib/IR/IRBuilder.cpp | |
parent | 707e9707814bfbb0297be4ab1bd4f976aa44ed37 (diff) | |
download | bcm5719-llvm-1b2842bf902a8b52acbef2425120533b63be5ae3.tar.gz bcm5719-llvm-1b2842bf902a8b52acbef2425120533b63be5ae3.zip |
[Alignment][NFC] CreateMemSet use MaybeAlign
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: arsenm, jvesely, nhaehnle, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D71213
Diffstat (limited to 'llvm/lib/IR/IRBuilder.cpp')
-rw-r--r-- | llvm/lib/IR/IRBuilder.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/IR/IRBuilder.cpp b/llvm/lib/IR/IRBuilder.cpp index b782012e973..c424e845f48 100644 --- a/llvm/lib/IR/IRBuilder.cpp +++ b/llvm/lib/IR/IRBuilder.cpp @@ -96,10 +96,10 @@ static InvokeInst *createInvokeHelper(Function *Invokee, BasicBlock *NormalDest, return II; } -CallInst *IRBuilderBase:: -CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align, - bool isVolatile, MDNode *TBAATag, MDNode *ScopeTag, - MDNode *NoAliasTag) { +CallInst *IRBuilderBase::CreateMemSet(Value *Ptr, Value *Val, Value *Size, + MaybeAlign Align, bool isVolatile, + MDNode *TBAATag, MDNode *ScopeTag, + MDNode *NoAliasTag) { Ptr = getCastedInt8PtrValue(Ptr); Value *Ops[] = {Ptr, Val, Size, getInt1(isVolatile)}; Type *Tys[] = { Ptr->getType(), Size->getType() }; @@ -108,8 +108,8 @@ CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align, CallInst *CI = createCallHelper(TheFn, Ops, this); - if (Align > 0) - cast<MemSetInst>(CI)->setDestAlignment(Align); + if (Align) + cast<MemSetInst>(CI)->setDestAlignment(Align->value()); // Set the TBAA info if present. if (TBAATag) |