Skip to content

Commit b1eb7fa

Browse files
authored
[PowerPC] Use MCRegister instead of unsigned. NFC (#167602)
I'm considering a operator>(MCRegister, unsigned) and operator<(MCRegister, unsigned) so I have not updated those lines. Such comparisons are common on MCRegister.
1 parent 124bfdf commit b1eb7fa

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,11 +619,11 @@ bool PPCInstPrinter::showRegistersWithPercentPrefix(const char *RegName) const {
619619
/// getVerboseConditionalRegName - This method expands the condition register
620620
/// when requested explicitly or targetting Darwin.
621621
const char *
622-
PPCInstPrinter::getVerboseConditionRegName(unsigned RegNum,
622+
PPCInstPrinter::getVerboseConditionRegName(MCRegister Reg,
623623
unsigned RegEncoding) const {
624624
if (!FullRegNames && !MAI.useFullRegisterNames())
625625
return nullptr;
626-
if (RegNum < PPC::CR0EQ || RegNum > PPC::CR7UN)
626+
if (Reg < PPC::CR0EQ || Reg > PPC::CR7UN)
627627
return nullptr;
628628
const char *CRBits[] = {
629629
"lt", "gt", "eq", "un",

llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PPCInstPrinter : public MCInstPrinter {
2323
private:
2424
bool showRegistersWithPercentPrefix(const char *RegName) const;
2525
bool showRegistersWithPrefix() const;
26-
const char *getVerboseConditionRegName(unsigned RegNum,
26+
const char *getVerboseConditionRegName(MCRegister Reg,
2727
unsigned RegEncoding) const;
2828

2929
public:

llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,11 @@ using llvm::MCPhysReg;
287287

288288
namespace llvm {
289289
namespace PPC {
290-
static inline bool isVFRegister(unsigned Reg) {
290+
static inline bool isVFRegister(MCRegister Reg) {
291291
return Reg >= PPC::VF0 && Reg <= PPC::VF31;
292292
}
293293

294-
static inline bool isVRRegister(unsigned Reg) {
294+
static inline bool isVRRegister(MCRegister Reg) {
295295
return Reg >= PPC::V0 && Reg <= PPC::V31;
296296
}
297297

0 commit comments

Comments
 (0)