aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Serialization/ContinuousRangeMap.h
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/ContinuousRangeMap.h
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/ContinuousRangeMap.h')
-rw-r--r--include/clang/Serialization/ContinuousRangeMap.h3
1 files changed, 3 insertions, 0 deletions
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);