@@ -158,8 +158,9 @@ struct OperandsSignature {
158
158
OperandsSignature getWithoutImmCodes () const {
159
159
OperandsSignature Result;
160
160
Result.Operands .resize (Operands.size ());
161
- for (auto [RO, O] : zip_equal (Result.Operands , Operands))
162
- RO = O.isImm () ? OpKind::getImm (0 ) : O;
161
+ llvm::transform (Operands, Result.Operands .begin (), [](OpKind Kind) {
162
+ return Kind.isImm () ? OpKind::getImm (0 ) : Kind;
163
+ });
163
164
return Result;
164
165
}
165
166
@@ -295,7 +296,7 @@ struct OperandsSignature {
295
296
296
297
void PrintParameters (raw_ostream &OS) const {
297
298
ListSeparator LS;
298
- for (const auto [Idx, Opnd] : enumerate(Operands)) {
299
+ for (auto [Idx, Opnd] : enumerate(Operands)) {
299
300
OS << LS;
300
301
if (Opnd.isReg ())
301
302
OS << " Register Op" << Idx;
@@ -310,8 +311,8 @@ struct OperandsSignature {
310
311
311
312
void PrintArguments (raw_ostream &OS, ArrayRef<std::string> PhyRegs) const {
312
313
ListSeparator LS;
313
- for (const auto [Idx, Opnd, PhyReg] : enumerate(Operands, PhyRegs)) {
314
- if (PhyReg != " " ) {
314
+ for (auto [Idx, Opnd, PhyReg] : enumerate(Operands, PhyRegs)) {
315
+ if (!PhyReg. empty () ) {
315
316
// Implicit physical register operand.
316
317
continue ;
317
318
}
@@ -330,7 +331,7 @@ struct OperandsSignature {
330
331
331
332
void PrintArguments (raw_ostream &OS) const {
332
333
ListSeparator LS;
333
- for (const auto [Idx, Opnd] : enumerate(Operands)) {
334
+ for (auto [Idx, Opnd] : enumerate(Operands)) {
334
335
OS << LS;
335
336
if (Opnd.isReg ())
336
337
OS << " Op" << Idx;
@@ -346,8 +347,8 @@ struct OperandsSignature {
346
347
void PrintManglingSuffix (raw_ostream &OS, ArrayRef<std::string> PhyRegs,
347
348
ImmPredicateSet &ImmPredicates,
348
349
bool StripImmCodes = false ) const {
349
- for (const auto [PR , Opnd] : zip_equal (PhyRegs, Operands)) {
350
- if (PR != " " ) {
350
+ for (auto [PhyReg , Opnd] : zip_equal (PhyRegs, Operands)) {
351
+ if (!PhyReg. empty () ) {
351
352
// Implicit physical register operand. e.g. Instruction::Mul expect to
352
353
// select to a binary op. On x86, mul may take a single operand with
353
354
// the other operand being implicit. We must emit something that looks
@@ -361,7 +362,7 @@ struct OperandsSignature {
361
362
362
363
void PrintManglingSuffix (raw_ostream &OS, ImmPredicateSet &ImmPredicates,
363
364
bool StripImmCodes = false ) const {
364
- for (const OpKind Opnd : Operands)
365
+ for (OpKind Opnd : Operands)
365
366
Opnd.printManglingSuffix (OS, ImmPredicates, StripImmCodes);
366
367
}
367
368
};
@@ -637,8 +638,8 @@ void FastISelMap::emitInstructionCode(raw_ostream &OS,
637
638
OS << " " ;
638
639
}
639
640
640
- for (const auto [Idx, PhyReg] : enumerate(Memo.PhysRegs )) {
641
- if (PhyReg != " " )
641
+ for (auto [Idx, PhyReg] : enumerate(Memo.PhysRegs )) {
642
+ if (!PhyReg. empty () )
642
643
OS << " BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, "
643
644
<< " TII.get(TargetOpcode::COPY), " << PhyReg << " ).addReg(Op" << Idx
644
645
<< " );\n " ;
0 commit comments