aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-08-21 18:18:06 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-08-21 18:18:06 +0000
commita796b6c4b99116ca31e6e61d8765b321678d580e (patch)
tree0f2fac9dd8de8d4a7203f9d8c999f30744e8caa6 /lib/AST/ExprCXX.cpp
parent83591b6d3f20ee84f4abe1c2574e90736aa84b11 (diff)
Switch some realignment calculations over to llvm::RoundUpToAlignment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162297 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprCXX.cpp')
-rw-r--r--lib/AST/ExprCXX.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index 97814afa18..40d218bee8 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -880,8 +880,7 @@ LambdaExpr *LambdaExpr::Create(ASTContext &Context,
if (!ArrayIndexVars.empty()) {
Size += sizeof(unsigned) * (Captures.size() + 1);
// Realign for following VarDecl array.
- unsigned Align = llvm::alignOf<VarDecl*>();
- Size = (Size + Align - 1) & ~(Align - 1);
+ Size = llvm::RoundUpToAlignment(Size, llvm::alignOf<VarDecl*>());
Size += sizeof(VarDecl *) * ArrayIndexVars.size();
}
void *Mem = Context.Allocate(Size);