@@ -280,15 +280,13 @@ class MachineRegisterInfo {
280
280
template <bool Uses, bool Defs, bool SkipDebug,
281
281
bool ByOperand, bool ByInstr, bool ByBundle>
282
282
class defusechain_iterator ;
283
- template <bool Uses, bool Defs, bool SkipDebug,
284
- bool ByOperand, bool ByInstr, bool ByBundle>
283
+ template <bool Uses, bool Defs, bool SkipDebug, bool ByInstr>
285
284
class defusechain_instr_iterator ;
286
285
287
286
// Make it a friend so it can access getNextOperandForReg().
288
287
template <bool , bool , bool , bool , bool , bool >
289
288
friend class defusechain_iterator ;
290
- template <bool , bool , bool , bool , bool , bool >
291
- friend class defusechain_instr_iterator ;
289
+ template <bool , bool , bool , bool > friend class defusechain_instr_iterator ;
292
290
293
291
// / reg_iterator/reg_begin/reg_end - Walk all defs and uses of the specified
294
292
// / register.
@@ -306,7 +304,7 @@ class MachineRegisterInfo {
306
304
// / reg_instr_iterator/reg_instr_begin/reg_instr_end - Walk all defs and uses
307
305
// / of the specified register, stepping by MachineInstr.
308
306
using reg_instr_iterator =
309
- defusechain_instr_iterator<true , true , false , false , true , false >;
307
+ defusechain_instr_iterator<true , true , false , /* ByInstr= */ true >;
310
308
reg_instr_iterator reg_instr_begin (Register RegNo) const {
311
309
return reg_instr_iterator (getRegUseDefListHead (RegNo));
312
310
}
@@ -322,7 +320,7 @@ class MachineRegisterInfo {
322
320
// / reg_bundle_iterator/reg_bundle_begin/reg_bundle_end - Walk all defs and uses
323
321
// / of the specified register, stepping by bundle.
324
322
using reg_bundle_iterator =
325
- defusechain_instr_iterator<true , true , false , false , false , true >;
323
+ defusechain_instr_iterator<true , true , false , /* ByInstr= */ false >;
326
324
reg_bundle_iterator reg_bundle_begin (Register RegNo) const {
327
325
return reg_bundle_iterator (getRegUseDefListHead (RegNo));
328
326
}
@@ -358,7 +356,7 @@ class MachineRegisterInfo {
358
356
// / all defs and uses of the specified register, stepping by MachineInstr,
359
357
// / skipping those marked as Debug.
360
358
using reg_instr_nodbg_iterator =
361
- defusechain_instr_iterator<true , true , true , false , true , false >;
359
+ defusechain_instr_iterator<true , true , true , /* ByInstr= */ true >;
362
360
reg_instr_nodbg_iterator reg_instr_nodbg_begin (Register RegNo) const {
363
361
return reg_instr_nodbg_iterator (getRegUseDefListHead (RegNo));
364
362
}
@@ -375,7 +373,7 @@ class MachineRegisterInfo {
375
373
// / all defs and uses of the specified register, stepping by bundle,
376
374
// / skipping those marked as Debug.
377
375
using reg_bundle_nodbg_iterator =
378
- defusechain_instr_iterator<true , true , true , false , false , true >;
376
+ defusechain_instr_iterator<true , true , true , /* ByInstr= */ false >;
379
377
reg_bundle_nodbg_iterator reg_bundle_nodbg_begin (Register RegNo) const {
380
378
return reg_bundle_nodbg_iterator (getRegUseDefListHead (RegNo));
381
379
}
@@ -409,7 +407,7 @@ class MachineRegisterInfo {
409
407
// / def_instr_iterator/def_instr_begin/def_instr_end - Walk all defs of the
410
408
// / specified register, stepping by MachineInst.
411
409
using def_instr_iterator =
412
- defusechain_instr_iterator<false , true , false , false , true , false >;
410
+ defusechain_instr_iterator<false , true , false , /* ByInstr= */ true >;
413
411
def_instr_iterator def_instr_begin (Register RegNo) const {
414
412
return def_instr_iterator (getRegUseDefListHead (RegNo));
415
413
}
@@ -425,7 +423,7 @@ class MachineRegisterInfo {
425
423
// / def_bundle_iterator/def_bundle_begin/def_bundle_end - Walk all defs of the
426
424
// / specified register, stepping by bundle.
427
425
using def_bundle_iterator =
428
- defusechain_instr_iterator<false , true , false , false , false , true >;
426
+ defusechain_instr_iterator<false , true , false , /* ByInstr= */ false >;
429
427
def_bundle_iterator def_bundle_begin (Register RegNo) const {
430
428
return def_bundle_iterator (getRegUseDefListHead (RegNo));
431
429
}
@@ -489,7 +487,7 @@ class MachineRegisterInfo {
489
487
// / use_instr_iterator/use_instr_begin/use_instr_end - Walk all uses of the
490
488
// / specified register, stepping by MachineInstr.
491
489
using use_instr_iterator =
492
- defusechain_instr_iterator<true , false , false , false , true , false >;
490
+ defusechain_instr_iterator<true , false , false , /* ByInstr= */ true >;
493
491
use_instr_iterator use_instr_begin (Register RegNo) const {
494
492
return use_instr_iterator (getRegUseDefListHead (RegNo));
495
493
}
@@ -505,7 +503,7 @@ class MachineRegisterInfo {
505
503
// / use_bundle_iterator/use_bundle_begin/use_bundle_end - Walk all uses of the
506
504
// / specified register, stepping by bundle.
507
505
using use_bundle_iterator =
508
- defusechain_instr_iterator<true , false , false , false , false , true >;
506
+ defusechain_instr_iterator<true , false , false , /* ByInstr= */ false >;
509
507
use_bundle_iterator use_bundle_begin (Register RegNo) const {
510
508
return use_bundle_iterator (getRegUseDefListHead (RegNo));
511
509
}
@@ -547,7 +545,7 @@ class MachineRegisterInfo {
547
545
// / all uses of the specified register, stepping by MachineInstr, skipping
548
546
// / those marked as Debug.
549
547
using use_instr_nodbg_iterator =
550
- defusechain_instr_iterator<true , false , true , false , true , false >;
548
+ defusechain_instr_iterator<true , false , true , /* ByInstr= */ true >;
551
549
use_instr_nodbg_iterator use_instr_nodbg_begin (Register RegNo) const {
552
550
return use_instr_nodbg_iterator (getRegUseDefListHead (RegNo));
553
551
}
@@ -564,7 +562,7 @@ class MachineRegisterInfo {
564
562
// / all uses of the specified register, stepping by bundle, skipping
565
563
// / those marked as Debug.
566
564
using use_bundle_nodbg_iterator =
567
- defusechain_instr_iterator<true , false , true , false , false , true >;
565
+ defusechain_instr_iterator<true , false , true , /* ByInstr= */ false >;
568
566
use_bundle_nodbg_iterator use_bundle_nodbg_begin (Register RegNo) const {
569
567
return use_bundle_nodbg_iterator (getRegUseDefListHead (RegNo));
570
568
}
@@ -1151,8 +1149,7 @@ class MachineRegisterInfo {
1151
1149
// / returns defs. If neither are true then you are silly and it always
1152
1150
// / returns end(). If SkipDebug is true it skips uses marked Debug
1153
1151
// / when incrementing.
1154
- template <bool ReturnUses, bool ReturnDefs, bool SkipDebug, bool ByOperand,
1155
- bool ByInstr, bool ByBundle>
1152
+ template <bool ReturnUses, bool ReturnDefs, bool SkipDebug, bool ByInstr>
1156
1153
class defusechain_instr_iterator {
1157
1154
friend class MachineRegisterInfo ;
1158
1155
@@ -1210,14 +1207,12 @@ class MachineRegisterInfo {
1210
1207
// Iterator traversal: forward iteration only
1211
1208
defusechain_instr_iterator &operator ++() { // Preincrement
1212
1209
assert (Op && " Cannot increment end iterator!" );
1213
- if (ByOperand)
1214
- advance ();
1215
- else if (ByInstr) {
1210
+ if (ByInstr) {
1216
1211
MachineInstr *P = Op->getParent ();
1217
1212
do {
1218
1213
advance ();
1219
1214
} while (Op && Op->getParent () == P);
1220
- } else if (ByBundle) {
1215
+ } else {
1221
1216
MachineBasicBlock::instr_iterator P =
1222
1217
getBundleStart (Op->getParent ()->getIterator ());
1223
1218
do {
@@ -1234,7 +1229,7 @@ class MachineRegisterInfo {
1234
1229
// Retrieve a reference to the current operand.
1235
1230
MachineInstr &operator *() const {
1236
1231
assert (Op && " Cannot dereference end iterator!" );
1237
- if (ByBundle )
1232
+ if (!ByInstr )
1238
1233
return *getBundleStart (Op->getParent ()->getIterator ());
1239
1234
return *Op->getParent ();
1240
1235
}
0 commit comments