1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

CodeGen: Add constexpr to Register constructors

This commit is contained in:
Matt Arsenault 2020-03-11 18:20:00 -04:00 committed by Matt Arsenault
parent 2e64fe9bf7
commit d824eb8a0e
2 changed files with 5 additions and 5 deletions

View File

@ -20,8 +20,8 @@ class Register {
unsigned Reg;
public:
Register(unsigned Val = 0): Reg(Val) {}
Register(MCRegister Val): Reg(Val) {}
constexpr Register(unsigned Val = 0): Reg(Val) {}
constexpr Register(MCRegister Val): Reg(Val) {}
// Register numbers can represent physical registers, virtual registers, and
// sometimes stack slots. The unsigned values are divided into these ranges:
@ -102,7 +102,7 @@ public:
return virtReg2Index(Reg);
}
operator unsigned() const {
constexpr operator unsigned() const {
return Reg;
}

View File

@ -23,7 +23,7 @@ class MCRegister {
unsigned Reg;
public:
MCRegister(unsigned Val = 0): Reg(Val) {}
constexpr MCRegister(unsigned Val = 0): Reg(Val) {}
// Register numbers can represent physical registers, virtual registers, and
// sometimes stack slots. The unsigned values are divided into these ranges:
@ -60,7 +60,7 @@ public:
return isPhysicalRegister(Reg);
}
operator unsigned() const {
constexpr operator unsigned() const {
return Reg;
}