diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-15 18:02:56 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-15 18:02:56 +0000 |
commit | 03c40c5182722022bf74174c69add8fed2faee69 (patch) | |
tree | 1dcfa67c09883535e581b2735abb6774b6678622 /clang/lib/Serialization/Module.cpp | |
parent | 6dda032003306ab5fd383676979a59a3a98d6d12 (diff) | |
download | bcm5719-llvm-03c40c5182722022bf74174c69add8fed2faee69.tar.gz bcm5719-llvm-03c40c5182722022bf74174c69add8fed2faee69.zip |
[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.
llvm-svn: 139809
Diffstat (limited to 'clang/lib/Serialization/Module.cpp')
-rw-r--r-- | clang/lib/Serialization/Module.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/clang/lib/Serialization/Module.cpp b/clang/lib/Serialization/Module.cpp index b5a96bb98b3..0a721c4365a 100644 --- a/clang/lib/Serialization/Module.cpp +++ b/clang/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); |