summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp12
-rw-r--r--llvm/lib/IR/DebugInfo.cpp11
2 files changed, 11 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
index eb101ca2dcb..8515dd020c8 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
@@ -210,8 +210,8 @@ bool DwarfExpression::AddMachineRegExpression(DIExpression Expr,
switch (*I) {
case dwarf::DW_OP_piece: {
unsigned SizeOfByte = 8;
- unsigned OffsetInBits = I.getArg(1) * SizeOfByte;
- unsigned SizeInBits = I.getArg(2) * SizeOfByte;
+ unsigned OffsetInBits = (*I).getArg(1) * SizeOfByte;
+ unsigned SizeInBits = (*I).getArg(2) * SizeOfByte;
// Piece always comes at the end of the expression.
return AddMachineRegPiece(MachineReg, SizeInBits,
getOffsetOrZero(OffsetInBits, PieceOffsetInBits));
@@ -219,7 +219,7 @@ bool DwarfExpression::AddMachineRegExpression(DIExpression Expr,
case dwarf::DW_OP_plus:
// [DW_OP_reg,Offset,DW_OP_plus,DW_OP_deref] --> [DW_OP_breg,Offset].
if (*std::next(I) == dwarf::DW_OP_deref) {
- unsigned Offset = I.getArg(1);
+ unsigned Offset = (*I).getArg(1);
ValidReg = AddMachineRegIndirect(MachineReg, Offset);
std::advance(I, 2);
break;
@@ -248,14 +248,14 @@ void DwarfExpression::AddExpression(DIExpression::iterator I,
switch (*I) {
case dwarf::DW_OP_piece: {
unsigned SizeOfByte = 8;
- unsigned OffsetInBits = I.getArg(1) * SizeOfByte;
- unsigned SizeInBits = I.getArg(2) * SizeOfByte;
+ unsigned OffsetInBits = (*I).getArg(1) * SizeOfByte;
+ unsigned SizeInBits = (*I).getArg(2) * SizeOfByte;
AddOpPiece(SizeInBits, getOffsetOrZero(OffsetInBits, PieceOffsetInBits));
break;
}
case dwarf::DW_OP_plus:
EmitOp(dwarf::DW_OP_plus_uconst);
- EmitUnsigned(I.getArg(1));
+ EmitUnsigned((*I).getArg(1));
break;
case dwarf::DW_OP_deref:
EmitOp(dwarf::DW_OP_deref);
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:
OpenPOWER on IntegriCloud