@@ -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
@@ -311,7 +312,7 @@ struct OperandsSignature {
311
312
void PrintArguments (raw_ostream &OS, ArrayRef<std::string> PhyRegs) const {
312
313
ListSeparator LS;
313
314
for (const auto [Idx, Opnd, PhyReg] : enumerate(Operands, PhyRegs)) {
314
- if (PhyReg != " " ) {
315
+ if (!PhyReg. empty () ) {
315
316
// Implicit physical register operand.
316
317
continue ;
317
318
}
@@ -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 (const 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
};
@@ -638,7 +639,7 @@ void FastISelMap::emitInstructionCode(raw_ostream &OS,
638
639
}
639
640
640
641
for (const auto [Idx, PhyReg] : enumerate(Memo.PhysRegs )) {
641
- if (PhyReg != " " )
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