diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-01-23 21:24:41 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-01-23 21:24:41 +0000 |
commit | 4bd0a0c3ed4633b4f23a5bbdbf65d47251dcfe05 (patch) | |
tree | 5693ed973fad312a5b44ea5777f7c3eae89a28e5 /llvm/lib/IR/DebugInfo.cpp | |
parent | f4e33cc9bb3a24a7d8372ce17192e6dd89a516fa (diff) | |
download | bcm5719-llvm-4bd0a0c3ed4633b4f23a5bbdbf65d47251dcfe05.tar.gz bcm5719-llvm-4bd0a0c3ed4633b4f23a5bbdbf65d47251dcfe05.zip |
Move the accessor functions from DIExpression::iterator into a wrapper
DIExpression::Operand, so we can write range-based for loops.
Thanks to David Blaikie for the idea.
llvm-svn: 226939
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 4a7bc67ab58..095fcbffde3 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -1406,16 +1406,15 @@ void DIVariable::printInternal(raw_ostream &OS) const { } void DIExpression::printInternal(raw_ostream &OS) const { - for (auto E = end(), I = begin(); I != E; ++I) { - uint64_t OpCode = *I; - OS << " [" << OperationEncodingString(OpCode); - switch (OpCode) { + for (auto Op : *this) { + OS << " [" << OperationEncodingString(Op); + switch (Op) { case DW_OP_plus: { - OS << " " << I.getArg(1); + OS << " " << Op.getArg(1); break; } case DW_OP_piece: { - OS << " offset=" << I.getArg(1) << ", size=" << I.getArg(2); + OS << " offset=" << Op.getArg(1) << ", size=" << Op.getArg(2); break; } case DW_OP_deref: |