From 0e62011df891d0e7ad904524edf705d07d12d5d4 Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Tue, 15 Oct 2019 11:24:36 +0000 Subject: [Alignment][NFC] Remove dependency on GlobalObject::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: arsenm, mehdi_amini, jvesely, nhaehnle, hiraditya, steven_wu, dexonsmith, dang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68944 llvm-svn: 374880 --- llvm/lib/IR/Core.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/IR/Core.cpp') diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index c548c56211a..afa73b33cd1 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -2008,7 +2008,7 @@ unsigned LLVMGetAlignment(LLVMValueRef V) { void LLVMSetAlignment(LLVMValueRef V, unsigned Bytes) { Value *P = unwrap(V); if (GlobalObject *GV = dyn_cast(P)) - GV->setAlignment(Bytes); + GV->setAlignment(MaybeAlign(Bytes)); else if (AllocaInst *AI = dyn_cast(P)) AI->setAlignment(MaybeAlign(Bytes)); else if (LoadInst *LI = dyn_cast(P)) -- cgit v1.2.3