aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Serialization
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-04 18:56:47 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-04 18:56:47 +0000
commit272b6bc6a6c8fc04f951ad850df68c44d137f513 (patch)
tree84fcaff82022819fba1d81dfb01819f72e67033f /include/clang/Serialization
parent3b2257ca054aa0b7d0150a294f184e9349cda433 (diff)
Introduce local -> global mapping for preprocessed entity IDs. This is
the last of the ID/offset/index mappings that I know of. Unfortunately, the "gap" method of testing doesn't work here due to the way the preprocessing record performs iteration. We'll do more testing once multi-AST loading is possible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136902 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization')
-rw-r--r--include/clang/Serialization/ASTBitCodes.h5
-rw-r--r--include/clang/Serialization/ASTReader.h3
-rw-r--r--include/clang/Serialization/ContinuousRangeMap.h3
3 files changed, 10 insertions, 1 deletions
diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h
index fbaf587ad5..55d0ddbbc5 100644
--- a/include/clang/Serialization/ASTBitCodes.h
+++ b/include/clang/Serialization/ASTBitCodes.h
@@ -141,7 +141,10 @@ namespace clang {
/// \brief An ID number that refers to an entity in the detailed
/// preprocessing record.
typedef uint32_t PreprocessedEntityID;
-
+
+ /// \brief The number of predefined preprocessed entity IDs.
+ const unsigned int NUM_PREDEF_PP_ENTITY_IDS = 1;
+
/// \brief Describes the various kinds of blocks that occur within
/// an AST file.
enum BlockIDs {
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h
index d862501c4f..ceb0d2837b 100644
--- a/include/clang/Serialization/ASTReader.h
+++ b/include/clang/Serialization/ASTReader.h
@@ -290,6 +290,9 @@ public:
/// this module.
serialization::PreprocessedEntityID BasePreprocessedEntityID;
+ /// \brief Remapping table for preprocessed entity IDs in this module.
+ ContinuousRangeMap<uint32_t, int, 2> PreprocessedEntityRemap;
+
/// \brief The number of macro definitions in this file.
unsigned LocalNumMacroDefinitions;
diff --git a/include/clang/Serialization/ContinuousRangeMap.h b/include/clang/Serialization/ContinuousRangeMap.h
index 42b8954b54..7f78320410 100644
--- a/include/clang/Serialization/ContinuousRangeMap.h
+++ b/include/clang/Serialization/ContinuousRangeMap.h
@@ -61,6 +61,9 @@ private:
public:
void insert(const value_type &Val) {
+ if (!Rep.empty() && Rep.back() == Val)
+ return;
+
assert((Rep.empty() || Rep.back().first < Val.first) &&
"Must insert keys in order.");
Rep.push_back(Val);