aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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);