diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-12-16 22:23:02 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-12-16 22:23:02 +0000 |
commit | f44515a49b549171dc3ee9faa6281b72609da563 (patch) | |
tree | 35d055f6565248f38a37956a46cca974f2388ade /lib/AST/DeclSerialization.cpp | |
parent | f595eb04a77d2544fac1f37e4b4c3183ac8c17f7 (diff) |
Make linkage-specifications hold on to all of their declarations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61110 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclSerialization.cpp')
-rw-r--r-- | lib/AST/DeclSerialization.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/AST/DeclSerialization.cpp b/lib/AST/DeclSerialization.cpp index c0ffb0c423..c853b1b84c 100644 --- a/lib/AST/DeclSerialization.cpp +++ b/lib/AST/DeclSerialization.cpp @@ -660,13 +660,30 @@ TemplateTypeParmDecl::CreateImpl(Deserializer& D, ASTContext& C) { void LinkageSpecDecl::EmitInRec(Serializer& S) const { Decl::EmitInRec(S); S.EmitInt(getLanguage()); - S.EmitPtr(D); + S.EmitBool(HadBraces); + if (HadBraces) { + S.EmitInt(NumDecls); + for (decl_const_iterator D = decls_begin(), DEnd = decls_end(); + D != DEnd; ++D) + S.EmitPtr(*D); + } else { + S.EmitPtr((Decl*)Decls); + } } void LinkageSpecDecl::ReadInRec(Deserializer& D, ASTContext& C) { Decl::ReadInRec(D, C); Language = static_cast<LanguageIDs>(D.ReadInt()); - D.ReadPtr(this->D); + HadBraces = D.ReadBool(); + if (HadBraces) { + NumDecls = D.ReadInt(); + Decl **NewDecls = new Decl*[NumDecls]; + Decls = NewDecls; + for (unsigned I = 0; I < NumDecls; ++I) + D.ReadPtr(NewDecls[I]); + } else { + D.ReadPtr(this->Decls); + } } //===----------------------------------------------------------------------===// |