@@ -2332,17 +2332,17 @@ static void writeDIExpression(raw_ostream &Out, const DIExpression *N,
2332
2332
Out << " !DIExpression(" ;
2333
2333
FieldSeparator FS;
2334
2334
if (N->isValid ()) {
2335
- for (auto I = N-> expr_op_begin (), E = N->expr_op_end (); I != E; ++I ) {
2336
- auto OpStr = dwarf::OperationEncodingString (I-> getOp ());
2335
+ for (const DIExpression::ExprOperand &Op : N->expr_ops () ) {
2336
+ auto OpStr = dwarf::OperationEncodingString (Op. getOp ());
2337
2337
assert (!OpStr.empty () && " Expected valid opcode" );
2338
2338
2339
2339
Out << FS << OpStr;
2340
- if (I-> getOp () == dwarf::DW_OP_LLVM_convert) {
2341
- Out << FS << I-> getArg (0 );
2342
- Out << FS << dwarf::AttributeEncodingString (I-> getArg (1 ));
2340
+ if (Op. getOp () == dwarf::DW_OP_LLVM_convert) {
2341
+ Out << FS << Op. getArg (0 );
2342
+ Out << FS << dwarf::AttributeEncodingString (Op. getArg (1 ));
2343
2343
} else {
2344
- for (unsigned A = 0 , AE = I-> getNumArgs (); A != AE; ++A)
2345
- Out << FS << I-> getArg (A);
2344
+ for (unsigned A = 0 , AE = Op. getNumArgs (); A != AE; ++A)
2345
+ Out << FS << Op. getArg (A);
2346
2346
}
2347
2347
}
2348
2348
} else {
@@ -2914,12 +2914,11 @@ void AssemblyWriter::printModuleSummaryIndex() {
2914
2914
}
2915
2915
2916
2916
// Print the TypeIdMap entries.
2917
- for (auto TidIter = TheIndex->typeIds ().begin ();
2918
- TidIter != TheIndex->typeIds ().end (); TidIter++) {
2919
- Out << " ^" << Machine.getTypeIdSlot (TidIter->second .first )
2920
- << " = typeid: (name: \" " << TidIter->second .first << " \" " ;
2921
- printTypeIdSummary (TidIter->second .second );
2922
- Out << " ) ; guid = " << TidIter->first << " \n " ;
2917
+ for (const auto &TID : TheIndex->typeIds ()) {
2918
+ Out << " ^" << Machine.getTypeIdSlot (TID.second .first )
2919
+ << " = typeid: (name: \" " << TID.second .first << " \" " ;
2920
+ printTypeIdSummary (TID.second .second );
2921
+ Out << " ) ; guid = " << TID.first << " \n " ;
2923
2922
}
2924
2923
2925
2924
// Print the TypeIdCompatibleVtableMap entries.
@@ -4023,8 +4022,8 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
4023
4022
} else if (const ExtractValueInst *EVI = dyn_cast<ExtractValueInst>(&I)) {
4024
4023
Out << ' ' ;
4025
4024
writeOperand (I.getOperand (0 ), true );
4026
- for (const unsigned *i = EVI->idx_begin (), *e = EVI-> idx_end (); i != e; ++i )
4027
- Out << " , " << * i;
4025
+ for (unsigned i : EVI->indices () )
4026
+ Out << " , " << i;
4028
4027
} else if (const InsertValueInst *IVI = dyn_cast<InsertValueInst>(&I)) {
4029
4028
Out << ' ' ;
4030
4029
writeOperand (I.getOperand (0 ), true ); Out << " , " ;
0 commit comments