summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclOpenMP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/DeclOpenMP.cpp')
-rw-r--r--clang/lib/AST/DeclOpenMP.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/clang/lib/AST/DeclOpenMP.cpp b/clang/lib/AST/DeclOpenMP.cpp
index 0d195f74623..8f454715d77 100644
--- a/clang/lib/AST/DeclOpenMP.cpp
+++ b/clang/lib/AST/DeclOpenMP.cpp
@@ -29,12 +29,8 @@ OMPThreadPrivateDecl *OMPThreadPrivateDecl::Create(ASTContext &C,
DeclContext *DC,
SourceLocation L,
ArrayRef<Expr *> VL) {
- unsigned Size = sizeof(OMPThreadPrivateDecl) +
- (VL.size() * sizeof(Expr *));
-
- void *Mem = C.Allocate(Size, llvm::alignOf<OMPThreadPrivateDecl>());
- OMPThreadPrivateDecl *D = new (Mem) OMPThreadPrivateDecl(OMPThreadPrivate,
- DC, L);
+ OMPThreadPrivateDecl *D = new (C, DC, VL.size() * sizeof(Expr *))
+ OMPThreadPrivateDecl(OMPThreadPrivate, DC, L);
D->NumVars = VL.size();
D->setVars(VL);
return D;
@@ -43,11 +39,8 @@ OMPThreadPrivateDecl *OMPThreadPrivateDecl::Create(ASTContext &C,
OMPThreadPrivateDecl *OMPThreadPrivateDecl::CreateDeserialized(ASTContext &C,
unsigned ID,
unsigned N) {
- unsigned Size = sizeof(OMPThreadPrivateDecl) + (N * sizeof(Expr *));
-
- void *Mem = AllocateDeserializedDecl(C, ID, Size);
- OMPThreadPrivateDecl *D = new (Mem) OMPThreadPrivateDecl(OMPThreadPrivate,
- 0, SourceLocation());
+ OMPThreadPrivateDecl *D = new (C, ID, N * sizeof(Expr *))
+ OMPThreadPrivateDecl(OMPThreadPrivate, 0, SourceLocation());
D->NumVars = N;
return D;
}
OpenPOWER on IntegriCloud