[llvm] r248497 - [objdump] Make iterator operator* return a reference.
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 24 07:52:52 PDT 2015
Author: d0k
Date: Thu Sep 24 09:52:52 2015
New Revision: 248497
URL: http://llvm.org/viewvc/llvm-project?rev=248497&view=rev
Log:
[objdump] Make iterator operator* return a reference.
This is closer to the expected behavior of an iterator and avoids awkward
warnings from clang's -Wrange-loop-analysis below.
Modified:
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=248497&r1=248496&r2=248497&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Thu Sep 24 09:52:52 2015
@@ -189,7 +189,7 @@ public:
: Predicate(P), Iterator(I), End(E) {
ScanPredicate();
}
- llvm::object::SectionRef operator*() const { return *Iterator; }
+ const llvm::object::SectionRef &operator*() const { return *Iterator; }
SectionFilterIterator &operator++() {
++Iterator;
ScanPredicate();
More information about the llvm-commits
mailing list