[RISCV] Use 'unsigned' instead of Register in getRegForInlineAsmConstraint. NFC

The return value of this interface still uses an 'unsigned' on all
targets. So we convert Register back to unsigned at the end.

I'm hoping this will prevent the issue that caused the revert of
D90322.
This commit is contained in:
Craig Topper 2020-11-01 10:16:50 -08:00
parent 6ec56467cb
commit a76cd10fcd
1 changed files with 3 additions and 3 deletions

View File

@ -2674,7 +2674,7 @@ RISCVTargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
// official names. However, other frontends like `rustc` do not. This allows
// users of these frontends to use the ABI names for registers in LLVM-style
// register constraints.
Register XRegFromAlias = StringSwitch<Register>(Constraint.lower())
unsigned XRegFromAlias = StringSwitch<unsigned>(Constraint.lower())
.Case("{zero}", RISCV::X0)
.Case("{ra}", RISCV::X1)
.Case("{sp}", RISCV::X2)
@ -2719,8 +2719,8 @@ RISCVTargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
// The second case is the ABI name of the register, so that frontends can also
// use the ABI names in register constraint lists.
if (Subtarget.hasStdExtF() || Subtarget.hasStdExtD()) {
std::pair<Register, Register> FReg =
StringSwitch<std::pair<Register, Register>>(Constraint.lower())
std::pair<unsigned, unsigned> FReg =
StringSwitch<std::pair<unsigned, unsigned>>(Constraint.lower())
.Cases("{f0}", "{ft0}", {RISCV::F0_F, RISCV::F0_D})
.Cases("{f1}", "{ft1}", {RISCV::F1_F, RISCV::F1_D})
.Cases("{f2}", "{ft2}", {RISCV::F2_F, RISCV::F2_D})