]> granicus.if.org Git - clang/commitdiff
[Alignment][NFC] Remove LoadInst::setAlignment(unsigned)
authorGuillaume Chatelet <gchatelet@google.com>
Mon, 30 Sep 2019 09:37:05 +0000 (09:37 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Mon, 30 Sep 2019 09:37:05 +0000 (09:37 +0000)
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, jdoerfert

Subscribers: hiraditya, asbirlea, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D68142

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373195 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCleanup.cpp

index 3cf366e4635d5962cb16262bb3ae8dec918a8e42..1280bdb1932e5208db7182d99f56efe7a1dc64bc 100644 (file)
@@ -310,7 +310,7 @@ static void createStoreInstBefore(llvm::Value *value, Address addr,
 static llvm::LoadInst *createLoadInstBefore(Address addr, const Twine &name,
                                             llvm::Instruction *beforeInst) {
   auto load = new llvm::LoadInst(addr.getPointer(), name, beforeInst);
-  load->setAlignment(addr.getAlignment().getQuantity());
+  load->setAlignment(llvm::MaybeAlign(addr.getAlignment().getQuantity()));
   return load;
 }