diff options
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r-- | include/clang/Frontend/PCHBitCodes.h | 6 | ||||
-rw-r--r-- | include/clang/Frontend/PCHReader.h | 8 | ||||
-rw-r--r-- | include/clang/Frontend/PCHWriter.h | 4 |
3 files changed, 14 insertions, 4 deletions
diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h index 0a51961413..76c4a7cb2a 100644 --- a/include/clang/Frontend/PCHBitCodes.h +++ b/include/clang/Frontend/PCHBitCodes.h @@ -238,7 +238,7 @@ namespace clang { /// PCH version and the name of the PCH this is chained to. CHAINED_METADATA = 26, - /// \brief Record code for referenced selector pool. + /// \brief Record code for referenced selector pool. REFERENCED_SELECTOR_POOL = 27 }; @@ -547,8 +547,8 @@ namespace clang { /// \brief A record that stores the set of declarations that are /// lexically stored within a given DeclContext. /// - /// The record itself is an array of declaration IDs, in the - /// order in which those declarations were added to the + /// The record itself is a blob that is an array of declaration IDs, + /// in the order in which those declarations were added to the /// declaration context. This data is used when iterating over /// the contents of a DeclContext, e.g., via /// DeclContext::decls_begin()/DeclContext::decls_end(). diff --git a/include/clang/Frontend/PCHReader.h b/include/clang/Frontend/PCHReader.h index 19b02d258e..17a0cd076f 100644 --- a/include/clang/Frontend/PCHReader.h +++ b/include/clang/Frontend/PCHReader.h @@ -307,8 +307,9 @@ private: /// \brief Information about the contents of a DeclContext. struct DeclContextInfo { llvm::BitstreamCursor *Stream; - uint64_t OffsetToLexicalDecls; uint64_t OffsetToVisibleDecls; + const pch::DeclID *LexicalDecls; + unsigned NumLexicalDecls; }; typedef llvm::SmallVector<DeclContextInfo, 1> DeclContextInfos; typedef llvm::DenseMap<const DeclContext *, DeclContextInfos> @@ -318,6 +319,11 @@ private: /// DeclContext. DeclContextOffsetsMap DeclContextOffsets; + /// \brief Read the records that describe the contents of declcontexts. + bool ReadDeclContextStorage(llvm::BitstreamCursor &Cursor, + const std::pair<uint64_t, uint64_t> &Offsets, + DeclContextInfo &Info); + /// \brief A vector containing identifiers that have already been /// loaded. /// diff --git a/include/clang/Frontend/PCHWriter.h b/include/clang/Frontend/PCHWriter.h index 10b96e8a3c..90f59cfad9 100644 --- a/include/clang/Frontend/PCHWriter.h +++ b/include/clang/Frontend/PCHWriter.h @@ -256,6 +256,7 @@ private: void WriteAttributeRecord(const Attr *Attr); unsigned ParmVarDeclAbbrev; + unsigned DeclContextLexicalAbbrev; void WriteDeclsBlockAbbrevs(); void WriteDecl(ASTContext &Context, Decl *D); @@ -345,6 +346,9 @@ public: /// \brief Emit a reference to a declaration. void AddDeclRef(const Decl *D, RecordData &Record); + /// \brief Force a declaration to be emitted and get its ID. + pch::DeclID GetDeclRef(const Decl *D); + /// \brief Determine the declaration ID of an already-emitted /// declaration. pch::DeclID getDeclID(const Decl *D); |