@@ -150,8 +150,8 @@ class MCRegisterInfo {
150
150
private:
151
151
const MCRegisterDesc *Desc; // Pointer to the descriptor array
152
152
unsigned NumRegs; // Number of entries in the array
153
- unsigned RAReg; // Return address register
154
- unsigned PCReg; // Program counter register
153
+ MCRegister RAReg; // Return address register
154
+ MCRegister PCReg; // Program counter register
155
155
const MCRegisterClass *Classes; // Pointer to the regclass array
156
156
unsigned NumClasses; // Number of entries in the array
157
157
unsigned NumRegUnits; // Number of regunits.
@@ -177,8 +177,8 @@ class MCRegisterInfo {
177
177
const DwarfLLVMRegPair *EHL2DwarfRegs; // LLVM to Dwarf regs mapping EH
178
178
const DwarfLLVMRegPair *Dwarf2LRegs; // Dwarf to LLVM regs mapping
179
179
const DwarfLLVMRegPair *EHDwarf2LRegs; // Dwarf to LLVM regs mapping EH
180
- DenseMap<unsigned , int > L2SEHRegs; // LLVM to SEH regs mapping
181
- DenseMap<unsigned , int > L2CVRegs; // LLVM to CV regs mapping
180
+ DenseMap<MCRegister , int > L2SEHRegs; // LLVM to SEH regs mapping
181
+ DenseMap<MCRegister , int > L2CVRegs; // LLVM to CV regs mapping
182
182
183
183
public:
184
184
// / DiffListIterator - Base iterator class that can traverse the
@@ -204,7 +204,7 @@ class MCRegisterInfo {
204
204
// / advance - Move to the next list position, return the applied
205
205
// / differential. This function does not detect the end of the list, that
206
206
// / is the caller's responsibility (by checking for a 0 return value).
207
- unsigned advance () {
207
+ MCRegister advance () {
208
208
assert (isValid () && " Cannot move off the end of the list." );
209
209
MCPhysReg D = *List++;
210
210
Val += D;
@@ -216,7 +216,7 @@ class MCRegisterInfo {
216
216
bool isValid () const { return List; }
217
217
218
218
// / Dereference the iterator to get the value at the current position.
219
- unsigned operator *() const { return Val; }
219
+ MCRegister operator *() const { return Val; }
220
220
221
221
// / Pre-increment to move to the next position.
222
222
void operator ++() {
@@ -311,51 +311,51 @@ class MCRegisterInfo {
311
311
// / as the LLVM register number.
312
312
// / FIXME: TableGen these numbers. Currently this requires target specific
313
313
// / initialization code.
314
- void mapLLVMRegToSEHReg (unsigned LLVMReg, int SEHReg) {
314
+ void mapLLVMRegToSEHReg (MCRegister LLVMReg, int SEHReg) {
315
315
L2SEHRegs[LLVMReg] = SEHReg;
316
316
}
317
317
318
- void mapLLVMRegToCVReg (unsigned LLVMReg, int CVReg) {
318
+ void mapLLVMRegToCVReg (MCRegister LLVMReg, int CVReg) {
319
319
L2CVRegs[LLVMReg] = CVReg;
320
320
}
321
321
322
322
// / This method should return the register where the return
323
323
// / address can be found.
324
- unsigned getRARegister () const {
324
+ MCRegister getRARegister () const {
325
325
return RAReg;
326
326
}
327
327
328
328
// / Return the register which is the program counter.
329
- unsigned getProgramCounter () const {
329
+ MCRegister getProgramCounter () const {
330
330
return PCReg;
331
331
}
332
332
333
- const MCRegisterDesc &operator [](unsigned RegNo) const {
333
+ const MCRegisterDesc &operator [](MCRegister RegNo) const {
334
334
assert (RegNo < NumRegs &&
335
335
" Attempting to access record for invalid register number!" );
336
336
return Desc[RegNo];
337
337
}
338
338
339
339
// / Provide a get method, equivalent to [], but more useful with a
340
340
// / pointer to this object.
341
- const MCRegisterDesc &get (unsigned RegNo) const {
341
+ const MCRegisterDesc &get (MCRegister RegNo) const {
342
342
return operator [](RegNo);
343
343
}
344
344
345
345
// / Returns the physical register number of sub-register "Index"
346
346
// / for physical register RegNo. Return zero if the sub-register does not
347
347
// / exist.
348
- unsigned getSubReg (unsigned Reg, unsigned Idx) const ;
348
+ MCRegister getSubReg (MCRegister Reg, unsigned Idx) const ;
349
349
350
350
// / Return a super-register of the specified register
351
351
// / Reg so its sub-register of index SubIdx is Reg.
352
- unsigned getMatchingSuperReg (unsigned Reg, unsigned SubIdx,
353
- const MCRegisterClass *RC) const ;
352
+ MCRegister getMatchingSuperReg (MCRegister Reg, unsigned SubIdx,
353
+ const MCRegisterClass *RC) const ;
354
354
355
355
// / For a given register pair, return the sub-register index
356
356
// / if the second register is a sub-register of the first. Return zero
357
357
// / otherwise.
358
- unsigned getSubRegIndex (unsigned RegNo, unsigned SubRegNo) const ;
358
+ unsigned getSubRegIndex (MCRegister RegNo, MCRegister SubRegNo) const ;
359
359
360
360
// / Get the size of the bit range covered by a sub-register index.
361
361
// / If the index isn't continuous, return the sum of the sizes of its parts.
@@ -369,7 +369,7 @@ class MCRegisterInfo {
369
369
370
370
// / Return the human-readable symbolic target-specific name for the
371
371
// / specified physical register.
372
- const char *getName (unsigned RegNo) const {
372
+ const char *getName (MCRegister RegNo) const {
373
373
return RegStrings + get (RegNo).Name ;
374
374
}
375
375
@@ -397,7 +397,7 @@ class MCRegisterInfo {
397
397
// / number. Returns -1 if there is no equivalent value. The second
398
398
// / parameter allows targets to use different numberings for EH info and
399
399
// / debugging info.
400
- int getDwarfRegNum (unsigned RegNum, bool isEH) const ;
400
+ int getDwarfRegNum (MCRegister RegNum, bool isEH) const ;
401
401
402
402
// / Map a dwarf register back to a target register.
403
403
int getLLVMRegNum (unsigned RegNum, bool isEH) const ;
@@ -413,11 +413,11 @@ class MCRegisterInfo {
413
413
414
414
// / Map a target register to an equivalent SEH register
415
415
// / number. Returns LLVM register number if there is no equivalent value.
416
- int getSEHRegNum (unsigned RegNum) const ;
416
+ int getSEHRegNum (MCRegister RegNum) const ;
417
417
418
418
// / Map a target register to an equivalent CodeView register
419
419
// / number.
420
- int getCodeViewRegNum (unsigned RegNum) const ;
420
+ int getCodeViewRegNum (MCRegister RegNum) const ;
421
421
422
422
regclass_iterator regclass_begin () const { return Classes; }
423
423
regclass_iterator regclass_end () const { return Classes+NumClasses; }
@@ -441,34 +441,34 @@ class MCRegisterInfo {
441
441
}
442
442
443
443
// / Returns the encoding for RegNo
444
- uint16_t getEncodingValue (unsigned RegNo) const {
444
+ uint16_t getEncodingValue (MCRegister RegNo) const {
445
445
assert (RegNo < NumRegs &&
446
446
" Attempting to get encoding for invalid register number!" );
447
447
return RegEncodingTable[RegNo];
448
448
}
449
449
450
450
// / Returns true if RegB is a sub-register of RegA.
451
- bool isSubRegister (unsigned RegA, unsigned RegB) const {
451
+ bool isSubRegister (MCRegister RegA, MCRegister RegB) const {
452
452
return isSuperRegister (RegB, RegA);
453
453
}
454
454
455
455
// / Returns true if RegB is a super-register of RegA.
456
- bool isSuperRegister (unsigned RegA, unsigned RegB) const ;
456
+ bool isSuperRegister (MCRegister RegA, MCRegister RegB) const ;
457
457
458
458
// / Returns true if RegB is a sub-register of RegA or if RegB == RegA.
459
- bool isSubRegisterEq (unsigned RegA, unsigned RegB) const {
459
+ bool isSubRegisterEq (MCRegister RegA, MCRegister RegB) const {
460
460
return isSuperRegisterEq (RegB, RegA);
461
461
}
462
462
463
463
// / Returns true if RegB is a super-register of RegA or if
464
464
// / RegB == RegA.
465
- bool isSuperRegisterEq (unsigned RegA, unsigned RegB) const {
465
+ bool isSuperRegisterEq (MCRegister RegA, MCRegister RegB) const {
466
466
return RegA == RegB || isSuperRegister (RegA, RegB);
467
467
}
468
468
469
469
// / Returns true if RegB is a super-register or sub-register of RegA
470
470
// / or if RegB == RegA.
471
- bool isSuperOrSubRegisterEq (unsigned RegA, unsigned RegB) const {
471
+ bool isSuperOrSubRegisterEq (MCRegister RegA, MCRegister RegB) const {
472
472
return isSubRegisterEq (RegA, RegB) || isSuperRegister (RegA, RegB);
473
473
}
474
474
};
@@ -484,8 +484,8 @@ class MCRegisterInfo {
484
484
// / If IncludeSelf is set, Reg itself is included in the list.
485
485
class MCSubRegIterator : public MCRegisterInfo ::DiffListIterator {
486
486
public:
487
- MCSubRegIterator (unsigned Reg, const MCRegisterInfo *MCRI,
488
- bool IncludeSelf = false ) {
487
+ MCSubRegIterator (MCRegister Reg, const MCRegisterInfo *MCRI,
488
+ bool IncludeSelf = false ) {
489
489
init (Reg, MCRI->DiffLists + MCRI->get (Reg).SubRegs );
490
490
// Initially, the iterator points to Reg itself.
491
491
if (!IncludeSelf)
@@ -502,13 +502,13 @@ class MCSubRegIndexIterator {
502
502
public:
503
503
// / Constructs an iterator that traverses subregisters and their
504
504
// / associated subregister indices.
505
- MCSubRegIndexIterator (unsigned Reg, const MCRegisterInfo *MCRI)
505
+ MCSubRegIndexIterator (MCRegister Reg, const MCRegisterInfo *MCRI)
506
506
: SRIter(Reg, MCRI) {
507
507
SRIndex = MCRI->SubRegIndices + MCRI->get (Reg).SubRegIndices ;
508
508
}
509
509
510
510
// / Returns current sub-register.
511
- unsigned getSubReg () const {
511
+ MCRegister getSubReg () const {
512
512
return *SRIter;
513
513
}
514
514
@@ -533,7 +533,7 @@ class MCSuperRegIterator : public MCRegisterInfo::DiffListIterator {
533
533
public:
534
534
MCSuperRegIterator () = default ;
535
535
536
- MCSuperRegIterator (unsigned Reg, const MCRegisterInfo *MCRI,
536
+ MCSuperRegIterator (MCRegister Reg, const MCRegisterInfo *MCRI,
537
537
bool IncludeSelf = false ) {
538
538
init (Reg, MCRI->DiffLists + MCRI->get (Reg).SuperRegs );
539
539
// Initially, the iterator points to Reg itself.
@@ -544,7 +544,7 @@ class MCSuperRegIterator : public MCRegisterInfo::DiffListIterator {
544
544
545
545
// Definition for isSuperRegister. Put it down here since it needs the
546
546
// iterator defined above in addition to the MCRegisterInfo class itself.
547
- inline bool MCRegisterInfo::isSuperRegister (unsigned RegA, unsigned RegB) const {
547
+ inline bool MCRegisterInfo::isSuperRegister (MCRegister RegA, MCRegister RegB) const {
548
548
for (MCSuperRegIterator I (RegA, this ); I.isValid (); ++I)
549
549
if (*I == RegB)
550
550
return true ;
@@ -571,7 +571,7 @@ class MCRegUnitIterator : public MCRegisterInfo::DiffListIterator {
571
571
// / in Reg.
572
572
MCRegUnitIterator () = default ;
573
573
574
- MCRegUnitIterator (unsigned Reg, const MCRegisterInfo *MCRI) {
574
+ MCRegUnitIterator (MCRegister Reg, const MCRegisterInfo *MCRI) {
575
575
assert (Reg && " Null register has no regunits" );
576
576
// Decode the RegUnits MCRegisterDesc field.
577
577
unsigned RU = MCRI->get (Reg).RegUnits ;
@@ -602,7 +602,7 @@ class MCRegUnitMaskIterator {
602
602
603
603
// / Constructs an iterator that traverses the register units and their
604
604
// / associated LaneMasks in Reg.
605
- MCRegUnitMaskIterator (unsigned Reg, const MCRegisterInfo *MCRI)
605
+ MCRegUnitMaskIterator (MCRegister Reg, const MCRegisterInfo *MCRI)
606
606
: RUIter(Reg, MCRI) {
607
607
uint16_t Idx = MCRI->get (Reg).RegUnitLaneMasks ;
608
608
MaskListIter = &MCRI->RegUnitMaskSequences [Idx];
@@ -669,7 +669,7 @@ class MCRegUnitRootIterator {
669
669
// / any ordering or that entries are unique.
670
670
class MCRegAliasIterator {
671
671
private:
672
- unsigned Reg;
672
+ MCRegister Reg;
673
673
const MCRegisterInfo *MCRI;
674
674
bool IncludeSelf;
675
675
@@ -678,7 +678,7 @@ class MCRegAliasIterator {
678
678
MCSuperRegIterator SI;
679
679
680
680
public:
681
- MCRegAliasIterator (unsigned Reg, const MCRegisterInfo *MCRI,
681
+ MCRegAliasIterator (MCRegister Reg, const MCRegisterInfo *MCRI,
682
682
bool IncludeSelf)
683
683
: Reg(Reg), MCRI(MCRI), IncludeSelf(IncludeSelf) {
684
684
// Initialize the iterators.
@@ -694,7 +694,7 @@ class MCRegAliasIterator {
694
694
695
695
bool isValid () const { return RI.isValid (); }
696
696
697
- unsigned operator *() const {
697
+ MCRegister operator *() const {
698
698
assert (SI.isValid () && " Cannot dereference an invalid iterator." );
699
699
return *SI;
700
700
}
0 commit comments