[llvm] r298437 - Fix clang errors caused by StringMap iterator changes.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 21 13:41:52 PDT 2017
Author: zturner
Date: Tue Mar 21 15:41:51 2017
New Revision: 298437
URL: http://llvm.org/viewvc/llvm-project?rev=298437&view=rev
Log:
Fix clang errors caused by StringMap iterator changes.
Modified:
llvm/trunk/include/llvm/ADT/StringMap.h
Modified: llvm/trunk/include/llvm/ADT/StringMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=298437&r1=298436&r2=298437&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringMap.h (original)
+++ llvm/trunk/include/llvm/ADT/StringMap.h Tue Mar 21 15:41:51 2017
@@ -496,32 +496,38 @@ template <typename ValueTy>
class StringMapConstIterator
: public StringMapIterBase<StringMapConstIterator<ValueTy>,
const StringMapEntry<ValueTy>> {
+ using base = StringMapIterBase<StringMapConstIterator<ValueTy>,
+ const StringMapEntry<ValueTy>>;
+
public:
StringMapConstIterator() = default;
explicit StringMapConstIterator(StringMapEntryBase **Bucket,
bool NoAdvance = false)
- : StringMapIterBase(Bucket, NoAdvance) {}
+ : base(Bucket, NoAdvance) {}
const StringMapEntry<ValueTy> &operator*() const {
- return *static_cast<const StringMapEntry<ValueTy> *>(*Ptr);
+ return *static_cast<const StringMapEntry<ValueTy> *>(*this->Ptr);
}
};
template <typename ValueTy>
class StringMapIterator : public StringMapIterBase<StringMapIterator<ValueTy>,
StringMapEntry<ValueTy>> {
+ using base =
+ StringMapIterBase<StringMapIterator<ValueTy>, StringMapEntry<ValueTy>>;
+
public:
StringMapIterator() = default;
explicit StringMapIterator(StringMapEntryBase **Bucket,
bool NoAdvance = false)
- : StringMapIterBase(Bucket, NoAdvance) {}
+ : base(Bucket, NoAdvance) {}
StringMapEntry<ValueTy> &operator*() const {
- return *static_cast<StringMapEntry<ValueTy> *>(*Ptr);
+ return *static_cast<StringMapEntry<ValueTy> *>(*this->Ptr);
}
operator StringMapConstIterator<ValueTy>() const {
- return StringMapConstIterator<ValueTy>(Ptr, false);
+ return StringMapConstIterator<ValueTy>(this->Ptr, false);
}
};
@@ -530,14 +536,18 @@ class StringMapKeyIterator
: public iterator_adaptor_base<StringMapKeyIterator<ValueTy>,
StringMapConstIterator<ValueTy>,
std::forward_iterator_tag, StringRef> {
+ using base = iterator_adaptor_base<StringMapKeyIterator<ValueTy>,
+ StringMapConstIterator<ValueTy>,
+ std::forward_iterator_tag, StringRef>;
+
public:
StringMapKeyIterator() = default;
explicit StringMapKeyIterator(StringMapConstIterator<ValueTy> Iter)
- : iterator_adaptor_base(std::move(Iter)) {}
+ : base(std::move(Iter)) {}
StringRef &operator*() {
- Key = wrapped()->getKey();
+ Key = this->wrapped()->getKey();
return Key;
}
More information about the llvm-commits
mailing list