diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-15 16:58:34 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-15 16:58:34 +0000 |
commit | 2171bf1caba4d4b9eeb6a91efac4300b41f38b07 (patch) | |
tree | 98cfad2375715b064a068eb3cf8a527a1e88946e /include/clang/Serialization/Module.h | |
parent | 3419d7cd2e4a4dcd2a88381deb5d83eb946a2b93 (diff) |
Completely re-implement (de-)serialization of redeclaration
chains, again. The prior implementation was very linked-list oriented, and
the list-splicing logic was both fairly convoluted (when loading from
multiple modules) and failed to preserve a reasonable ordering for the
redeclaration chains.
This new implementation uses a simpler strategy, where we store the
ordered redeclaration chains in an array-like structure (indexed based
on the first declaration), and use that ordering to add individual
deserialized declarations to the end of the existing chain. That way,
the chain mimics the ordering from its modules, and a bug somewhere is
far less likely to result in a broken linked list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization/Module.h')
-rw-r--r-- | include/clang/Serialization/Module.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/clang/Serialization/Module.h b/include/clang/Serialization/Module.h index cbac5cd148..ad2c98e695 100644 --- a/include/clang/Serialization/Module.h +++ b/include/clang/Serialization/Module.h @@ -295,12 +295,16 @@ public: /// \brief Array of file-level DeclIDs sorted by file. const serialization::DeclID *FileSortedDecls; - /// \brief Array of redeclaration information within this module file, - /// sorted by the first declaration ID. - const serialization::LocalRedeclarationsInfo *RedeclarationsInfo; + /// \brief Array of redeclaration chain location information within this + /// module file, sorted by the first declaration ID. + const serialization::LocalRedeclarationsInfo *RedeclarationsMap; /// \brief The number of redeclaration info entries in RedeclarationsInfo. - unsigned LocalNumRedeclarationsInfos; + unsigned LocalNumRedeclarationsInMap; + + /// \brief The redeclaration chains for declarations local to this + /// module file. + SmallVector<uint64_t, 1> RedeclarationChains; // === Types === |