summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-09-01 14:00:35 +0000
committerDan Gohman <gohman@apple.com>2010-09-01 14:00:35 +0000
commite3955df639ff9aff990f628ef6a219ff5efdbc81 (patch)
tree59fc80421919816021622260f4ae70d1ea434c12 /include/llvm
parentf8ff40c0598c6d8707a639ec63644e5e5496678a (diff)
downloadllvm-e3955df639ff9aff990f628ef6a219ff5efdbc81.tar.gz
llvm-e3955df639ff9aff990f628ef6a219ff5efdbc81.tar.bz2
llvm-e3955df639ff9aff990f628ef6a219ff5efdbc81.tar.xz
Make the iterator form of erase return void, since it always succeeds,
and since this is what std::map and std::set do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/ADT/DenseMap.h3
-rw-r--r--include/llvm/ADT/DenseSet.h4
-rw-r--r--include/llvm/ADT/ValueMap.h2
3 files changed, 4 insertions, 5 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h
index c53e255e1c..06a1575da4 100644
--- a/include/llvm/ADT/DenseMap.h
+++ b/include/llvm/ADT/DenseMap.h
@@ -185,13 +185,12 @@ public:
++NumTombstones;
return true;
}
- bool erase(iterator I) {
+ void erase(iterator I) {
BucketT *TheBucket = &*I;
TheBucket->second.~ValueT();
TheBucket->first = getTombstoneKey();
--NumEntries;
++NumTombstones;
- return true;
}
void swap(DenseMap& RHS) {
diff --git a/include/llvm/ADT/DenseSet.h b/include/llvm/ADT/DenseSet.h
index 765105bbf5..00bcf64a2f 100644
--- a/include/llvm/ADT/DenseSet.h
+++ b/include/llvm/ADT/DenseSet.h
@@ -106,8 +106,8 @@ public:
const_iterator end() const { return ConstIterator(TheMap.end()); }
iterator find(const ValueT &V) { return Iterator(TheMap.find(V)); }
- bool erase(Iterator I) { return TheMap.erase(I.I); }
- bool erase(ConstIterator CI) { return TheMap.erase(CI.I); }
+ void erase(Iterator I) { return TheMap.erase(I.I); }
+ void erase(ConstIterator CI) { return TheMap.erase(CI.I); }
std::pair<iterator, bool> insert(const ValueT &V) {
return TheMap.insert(std::make_pair(V, 0));
diff --git a/include/llvm/ADT/ValueMap.h b/include/llvm/ADT/ValueMap.h
index af041fe521..ded17fc322 100644
--- a/include/llvm/ADT/ValueMap.h
+++ b/include/llvm/ADT/ValueMap.h
@@ -149,7 +149,7 @@ public:
bool erase(const KeyT &Val) {
return Map.erase(Wrap(Val));
}
- bool erase(iterator I) {
+ void erase(iterator I) {
return Map.erase(I.base());
}