diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-06-29 22:47:00 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-06-29 22:47:00 +0000 |
commit | 74d28bd084a29eac89aa16ed452582df91cfa1fd (patch) | |
tree | 071f643dbf3e1e54a0df522cef266277a232d76a /clang/lib/AST/DeclFriend.cpp | |
parent | 26d7201d5d6eca1eb5dcf04c0f7a2af97fc46d4d (diff) | |
download | bcm5719-llvm-74d28bd084a29eac89aa16ed452582df91cfa1fd.tar.gz bcm5719-llvm-74d28bd084a29eac89aa16ed452582df91cfa1fd.zip |
Support C++ friend declarations for PCH.
This commit 'introduces' a slightly different way to restore the state of the AST object.
It makes PCHDeclReader/PCHDeclWriter friends and gives them access to the private members of the object.
The rationale is to avoid using/modifying the AST interfaces for PCH read/write so that to:
-Avoid complications with objects that have side-effects during creation or when using some setters.
-Not 'pollute' the AST interface with methods only used by the PCH reader/writer
-Allow AST objects to be read-only.
llvm-svn: 107219
Diffstat (limited to 'clang/lib/AST/DeclFriend.cpp')
-rw-r--r-- | clang/lib/AST/DeclFriend.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclFriend.cpp b/clang/lib/AST/DeclFriend.cpp index ab3552db28e..99bfe40c31f 100644 --- a/clang/lib/AST/DeclFriend.cpp +++ b/clang/lib/AST/DeclFriend.cpp @@ -39,3 +39,7 @@ FriendDecl *FriendDecl::Create(ASTContext &C, DeclContext *DC, cast<CXXRecordDecl>(DC)->pushFriendDecl(FD); return FD; } + +FriendDecl *FriendDecl::Create(ASTContext &C, EmptyShell Empty) { + return new (C) FriendDecl(Empty); +} |