diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-01-05 19:45:36 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-01-05 19:45:36 +0000 |
commit | 074149e11baf5f7db12f84efd5c34ba6e35d5cdf (patch) | |
tree | a02b3f87f914315d7ac21bc25fddf46250229d59 /lib/AST/DeclSerialization.cpp | |
parent | e1dccaefe2d44a9f83f8c3f087438a3297254cac (diff) |
Introduce support for "transparent" DeclContexts, which are
DeclContexts whose members are visible from enclosing DeclContexts up
to (and including) the innermost enclosing non-transparent
DeclContexts. Transparent DeclContexts unify the mechanism to be used
for various language features, including C enumerations, anonymous
unions, C++0x inline namespaces, and C++ linkage
specifications. Please refer to the documentation in the Clang
internals manual for more information.
Only enumerations and linkage specifications currently use transparent
DeclContexts.
Still to do: use transparent DeclContexts to implement anonymous
unions and GCC's anonymous structs extension, and, later, the C++0x
features. We also need to tighten up the DeclContext/ScopedDecl link
to ensure that every ScopedDecl is in a single DeclContext, which
will ensure that we can then enforce ownership and reduce the memory
footprint of DeclContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclSerialization.cpp')
-rw-r--r-- | lib/AST/DeclSerialization.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/lib/AST/DeclSerialization.cpp b/lib/AST/DeclSerialization.cpp index 68412f968a..0a298139bd 100644 --- a/lib/AST/DeclSerialization.cpp +++ b/lib/AST/DeclSerialization.cpp @@ -686,29 +686,12 @@ void LinkageSpecDecl::EmitInRec(Serializer& S) const { Decl::EmitInRec(S); S.EmitInt(getLanguage()); 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()); 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); - } } //===----------------------------------------------------------------------===// |