diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-01-23 23:40:47 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-01-23 23:40:47 +0000 |
commit | 70f2a736db55f89646f3478047926df2f509abb3 (patch) | |
tree | d37fc1a6866ffab317c0c9c41e83f37cc4f67925 /llvm/lib/IR/DebugInfo.cpp | |
parent | 009c1a931e4e0751f84217de22d7755ee3149ef1 (diff) | |
download | bcm5719-llvm-70f2a736db55f89646f3478047926df2f509abb3.tar.gz bcm5719-llvm-70f2a736db55f89646f3478047926df2f509abb3.zip |
Address more review comments for DIExpression::iterator.
- input_iterator
- define an operator->
- make constructors private were possible
llvm-svn: 226967
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 095fcbffde3..9b5a9c3da47 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -170,6 +170,11 @@ DIExpression::iterator DIExpression::end() const { return DIExpression::iterator(); } +const DIExpression::Operand &DIExpression::Operand::getNext() const { + iterator it(I); + return *(++it); +} + //===----------------------------------------------------------------------===// // Predicates //===----------------------------------------------------------------------===// @@ -606,13 +611,13 @@ bool DIExpression::Verify() const { if (!(isExpression() && DbgNode->getNumOperands() == 1)) return false; - for (auto E = end(), I = begin(); I != E; ++I) - switch (*I) { + for (auto Op : *this) + switch (Op) { case DW_OP_piece: // Must be the last element of the expression. - return std::distance(I.getBase(), DIHeaderFieldIterator()) == 3; + return std::distance(Op.getBase(), DIHeaderFieldIterator()) == 3; case DW_OP_plus: - if (std::distance(I.getBase(), DIHeaderFieldIterator()) < 2) + if (std::distance(Op.getBase(), DIHeaderFieldIterator()) < 2) return false; break; case DW_OP_deref: |