diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-01-22 16:55:22 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-01-22 16:55:22 +0000 |
commit | 0d7d8e45122c52098512747376bcfc6a3862e735 (patch) | |
tree | f8b87d03520082fcc5f3316fc357b0a1ba0d8bb5 /llvm/lib/IR/DebugInfo.cpp | |
parent | 2585a98d383b7503884b13819ffee4917b5c4694 (diff) | |
download | bcm5719-llvm-0d7d8e45122c52098512747376bcfc6a3862e735.tar.gz bcm5719-llvm-0d7d8e45122c52098512747376bcfc6a3862e735.zip |
Rewrite DIExpression::printInternal() to use the iterator interface.
NFC.
llvm-svn: 226836
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index da77c9bb6f9..4a7bc67ab58 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -1406,27 +1406,23 @@ void DIVariable::printInternal(raw_ostream &OS) const { } void DIExpression::printInternal(raw_ostream &OS) const { - for (unsigned I = 0; I < getNumElements(); ++I) { - uint64_t OpCode = getElement(I); + for (auto E = end(), I = begin(); I != E; ++I) { + uint64_t OpCode = *I; OS << " [" << OperationEncodingString(OpCode); switch (OpCode) { case DW_OP_plus: { - OS << " " << getElement(++I); + OS << " " << I.getArg(1); break; } case DW_OP_piece: { - unsigned Offset = getElement(++I); - unsigned Size = getElement(++I); - OS << " offset=" << Offset << ", size=" << Size; + OS << " offset=" << I.getArg(1) << ", size=" << I.getArg(2); break; } case DW_OP_deref: // No arguments. break; default: - // Else bail out early. This may be a line table entry. - OS << "Unknown]"; - return; + llvm_unreachable("unhandled operation"); } OS << "]"; } |