]> granicus.if.org Git - clang/commitdiff
[Alignment] Move OffsetToAlignment to Alignment.h
authorGuillaume Chatelet <gchatelet@google.com>
Thu, 12 Sep 2019 15:20:36 +0000 (15:20 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Thu, 12 Sep 2019 15:20:36 +0000 (15:20 +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, JDevlieghere, alexshap, rupprecht, jhenderson

Subscribers: sdardis, nemanjai, hiraditya, kbarton, jakehehrlich, jrtc27, MaskRay, atanasyan, jsji, seiya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

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

lib/AST/DeclBase.cpp

index aa2c21230c89198de0b143727f27c6dedee3e4ac..10537efebfc76e54db4d5291db3aeeeb17fee56e 100644 (file)
@@ -100,7 +100,7 @@ void *Decl::operator new(std::size_t Size, const ASTContext &Ctx,
     // Ensure required alignment of the resulting object by adding extra
     // padding at the start if required.
     size_t ExtraAlign =
-        llvm::OffsetToAlignment(sizeof(Module *), alignof(Decl));
+        llvm::offsetToAlignment(sizeof(Module *), llvm::Align(alignof(Decl)));
     auto *Buffer = reinterpret_cast<char *>(
         ::operator new(ExtraAlign + sizeof(Module *) + Size + Extra, Ctx));
     Buffer += ExtraAlign;