summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp')
-rw-r--r--contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp b/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp
index 1c639d6..a996cab 100644
--- a/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp
+++ b/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp
@@ -46,25 +46,21 @@ FriendDecl *FriendDecl::Create(ASTContext &C, DeclContext *DC,
}
#endif
- std::size_t Size = sizeof(FriendDecl)
- + FriendTypeTPLists.size() * sizeof(TemplateParameterList*);
- void *Mem = C.Allocate(Size);
- FriendDecl *FD = new (Mem) FriendDecl(DC, L, Friend, FriendL,
- FriendTypeTPLists);
+ std::size_t Extra = FriendTypeTPLists.size() * sizeof(TemplateParameterList*);
+ FriendDecl *FD = new (C, DC, Extra) FriendDecl(DC, L, Friend, FriendL,
+ FriendTypeTPLists);
cast<CXXRecordDecl>(DC)->pushFriendDecl(FD);
return FD;
}
FriendDecl *FriendDecl::CreateDeserialized(ASTContext &C, unsigned ID,
unsigned FriendTypeNumTPLists) {
- std::size_t Size = sizeof(FriendDecl)
- + FriendTypeNumTPLists * sizeof(TemplateParameterList*);
- void *Mem = AllocateDeserializedDecl(C, ID, Size);
- return new (Mem) FriendDecl(EmptyShell(), FriendTypeNumTPLists);
+ std::size_t Extra = FriendTypeNumTPLists * sizeof(TemplateParameterList*);
+ return new (C, ID, Extra) FriendDecl(EmptyShell(), FriendTypeNumTPLists);
}
FriendDecl *CXXRecordDecl::getFirstFriend() const {
ExternalASTSource *Source = getParentASTContext().getExternalSource();
Decl *First = data().FirstFriend.get(Source);
- return First ? cast<FriendDecl>(First) : 0;
+ return First ? cast<FriendDecl>(First) : nullptr;
}
OpenPOWER on IntegriCloud