From e24692b30adbe8144597678a0e3354912e99c747 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Thu, 15 Sep 2011 18:02:56 +0000 Subject: [PCH] Overhaul how preprocessed entities are [de]serialized. -Use an array of offsets for all preprocessed entities -Get rid of the separate array of offsets for just macro definitions; for references to macro definitions use an index inside the preprocessed entities array. -Deserialize each preprocessed entity lazily, at first request; not in bulk. Paves the way for binary searching of preprocessed entities that will offer efficiency and will simplify things on the libclang side a lot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139809 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Serialization/Module.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'lib/Serialization/Module.cpp') diff --git a/lib/Serialization/Module.cpp b/lib/Serialization/Module.cpp index b5a96bb98b..0a721c4365 100644 --- a/lib/Serialization/Module.cpp +++ b/lib/Serialization/Module.cpp @@ -27,16 +27,15 @@ Module::Module(ModuleKind Kind) SLocFileOffsets(0), LocalNumIdentifiers(0), IdentifierOffsets(0), BaseIdentifierID(0), IdentifierTableData(0), IdentifierLookupTable(0), BasePreprocessedEntityID(0), - LocalNumMacroDefinitions(0), MacroDefinitionOffsets(0), - BaseMacroDefinitionID(0), LocalNumHeaderFileInfos(0), + PreprocessedEntityOffsets(0), NumPreprocessedEntities(0), + LocalNumHeaderFileInfos(0), HeaderFileInfoTableData(0), HeaderFileInfoTable(0), HeaderFileFrameworkStrings(0), LocalNumSelectors(0), SelectorOffsets(0), BaseSelectorID(0), SelectorLookupTableData(0), SelectorLookupTable(0), LocalNumDecls(0), DeclOffsets(0), BaseDeclID(0), LocalNumCXXBaseSpecifiers(0), CXXBaseSpecifiersOffsets(0), - LocalNumTypes(0), TypeOffsets(0), BaseTypeIndex(0), StatCache(0), - NumPreallocatedPreprocessingEntities(0) + LocalNumTypes(0), TypeOffsets(0), BaseTypeIndex(0), StatCache(0) {} Module::~Module() { @@ -96,17 +95,10 @@ void Module::dump() { llvm::errs() << " Base preprocessed entity ID: " << BasePreprocessedEntityID << '\n' << " Number of preprocessed entities: " - << NumPreallocatedPreprocessingEntities << '\n'; + << NumPreprocessedEntities << '\n'; dumpLocalRemap("Preprocessed entity ID local -> global map", PreprocessedEntityRemap); - llvm::errs() << " Base macro definition ID: " << BaseMacroDefinitionID - << '\n' - << " Number of macro definitions: " << LocalNumMacroDefinitions - << '\n'; - dumpLocalRemap("Macro definition ID local -> global map", - MacroDefinitionRemap); - llvm::errs() << " Base type index: " << BaseTypeIndex << '\n' << " Number of types: " << LocalNumTypes << '\n'; dumpLocalRemap("Type index local -> global map", TypeRemap); -- cgit v1.2.3