From cff9f26ce0ed76d555cd33b3dca84dd5cdf376af Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 27 Jan 2012 01:47:08 +0000 Subject: Reimplement (de-)serialization of Objective-C categories to eliminate the direct serialization of the linked-list structure. Instead, use a scheme similar to how we handle redeclarations, with redeclaration lists on the side. This addresses several issues: - In cases involving mixing and matching of many categories across many modules, the linked-list structure would not be consistent across different modules, and categories would get lost. - If a module is loaded after the class definition and its other categories have already been loaded, we wouldn't see any categories in the newly-loaded module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149112 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Serialization/Module.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'include/clang/Serialization/Module.h') diff --git a/include/clang/Serialization/Module.h b/include/clang/Serialization/Module.h index 831a873ac1..34f208d71f 100644 --- a/include/clang/Serialization/Module.h +++ b/include/clang/Serialization/Module.h @@ -286,15 +286,6 @@ public: /// for each DeclContext. DeclContextInfosMap DeclContextInfos; - typedef llvm::DenseMap > - ChainedObjCCategoriesMap; - /// \brief ObjC categories that got chained to an interface from another - /// module. - /// Key is the ID of the interface. - /// Value is a pair of linked category DeclIDs (head category, tail category). - ChainedObjCCategoriesMap ChainedObjCCategories; - /// \brief Array of file-level DeclIDs sorted by file. const serialization::DeclID *FileSortedDecls; @@ -302,13 +293,24 @@ public: /// module file, sorted by the first declaration ID. const serialization::LocalRedeclarationsInfo *RedeclarationsMap; - /// \brief The number of redeclaration info entries in RedeclarationsInfo. + /// \brief The number of redeclaration info entries in RedeclarationsMap. unsigned LocalNumRedeclarationsInMap; /// \brief The redeclaration chains for declarations local to this /// module file. SmallVector RedeclarationChains; + /// \brief Array of category list location information within this + /// module file, sorted by the definition ID. + const serialization::ObjCCategoriesInfo *ObjCCategoriesMap; + + /// \brief The number of redeclaration info entries in ObjCCategoriesMap. + unsigned LocalNumObjCCategoriesInMap; + + /// \brief The Objective-C category lists for categories known to this + /// module. + SmallVector ObjCCategories; + // === Types === /// \brief The number of types in this AST file. -- cgit v1.2.3-70-g09d2