r371742 - [Alignment] Move OffsetToAlignment to Alignment.h
Guillaume Chatelet via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 12 08:20:36 PDT 2019
Author: gchatelet
Date: Thu Sep 12 08:20:36 2019
New Revision: 371742
URL: http://llvm.org/viewvc/llvm-project?rev=371742&view=rev
Log:
[Alignment] Move OffsetToAlignment to Alignment.h
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
Modified:
cfe/trunk/lib/AST/DeclBase.cpp
Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=371742&r1=371741&r2=371742&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Thu Sep 12 08:20:36 2019
@@ -100,7 +100,7 @@ void *Decl::operator new(std::size_t Siz
// 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;
More information about the cfe-commits
mailing list