aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/AST/Redeclarable.h3
-rw-r--r--include/clang/Frontend/PCHBitCodes.h6
-rw-r--r--include/clang/Frontend/PCHReader.h7
-rw-r--r--include/clang/Frontend/PCHWriter.h6
4 files changed, 20 insertions, 2 deletions
diff --git a/include/clang/AST/Redeclarable.h b/include/clang/AST/Redeclarable.h
index 55e1f84779..85c75b771b 100644
--- a/include/clang/AST/Redeclarable.h
+++ b/include/clang/AST/Redeclarable.h
@@ -177,6 +177,9 @@ public:
static_cast<const decl_type*>(this)));
}
redecl_iterator redecls_end() const { return redecl_iterator(); }
+
+ friend class PCHDeclReader;
+ friend class PCHDeclWriter;
};
}
diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h
index 109a78bd88..a07060f800 100644
--- a/include/clang/Frontend/PCHBitCodes.h
+++ b/include/clang/Frontend/PCHBitCodes.h
@@ -245,8 +245,12 @@ namespace clang {
/// declarations.
TU_UPDATE_LEXICAL = 28,
+ /// \brief Record code for an update to first decls pointing to the
+ /// latest redeclarations.
+ REDECLS_UPDATE_LATEST = 29,
+
/// \brief Record code for declarations that Sema keeps references of.
- SEMA_DECL_REFS = 29
+ SEMA_DECL_REFS = 30
};
/// \brief Record types used within a source manager block.
diff --git a/include/clang/Frontend/PCHReader.h b/include/clang/Frontend/PCHReader.h
index dda15670b5..e19669ec7f 100644
--- a/include/clang/Frontend/PCHReader.h
+++ b/include/clang/Frontend/PCHReader.h
@@ -319,6 +319,11 @@ private:
/// DeclContext.
DeclContextOffsetsMap DeclContextOffsets;
+ typedef llvm::DenseMap<pch::DeclID, pch::DeclID> FirstLatestDeclIDMap;
+ /// \brief Map of first declarations from a chained PCH that point to the
+ /// most recent declarations in another PCH.
+ FirstLatestDeclIDMap FirstLatestDeclIDs;
+
/// \brief Read the records that describe the contents of declcontexts.
bool ReadDeclContextStorage(llvm::BitstreamCursor &Cursor,
const std::pair<uint64_t, uint64_t> &Offsets,
@@ -561,7 +566,7 @@ private:
QualType ReadTypeRecord(unsigned Index);
RecordLocation TypeCursorForIndex(unsigned Index);
void LoadedDecl(unsigned Index, Decl *D);
- Decl *ReadDeclRecord(unsigned Index);
+ Decl *ReadDeclRecord(unsigned Index, pch::DeclID ID);
RecordLocation DeclCursorForIndex(unsigned Index);
void PassInterestingDeclsToConsumer();
diff --git a/include/clang/Frontend/PCHWriter.h b/include/clang/Frontend/PCHWriter.h
index 92c7085bc6..3403c6e2d1 100644
--- a/include/clang/Frontend/PCHWriter.h
+++ b/include/clang/Frontend/PCHWriter.h
@@ -79,6 +79,7 @@ class PCHWriter : public PCHDeserializationListener {
public:
typedef llvm::SmallVector<uint64_t, 64> RecordData;
+ friend class PCHDeclWriter;
private:
/// \brief The bitstream writer used to emit this precompiled header.
llvm::BitstreamWriter &Stream;
@@ -195,6 +196,11 @@ private:
/// \brief Mapping from the macro definition indices in \c MacroDefinitions
/// to the corresponding offsets within the preprocessor block.
std::vector<uint32_t> MacroDefinitionOffsets;
+
+ typedef llvm::DenseMap<Decl *, Decl *> FirstLatestDeclMap;
+ /// \brief Map of first declarations from a chained PCH that point to the
+ /// most recent declarations in another PCH.
+ FirstLatestDeclMap FirstLatestDecls;
/// \brief Declarations encountered that might be external
/// definitions.