IR: Make trivial helper functions constexpr

This commit is contained in:
Lioncash 2017-01-17 19:42:36 -05:00
parent d1f39185dd
commit d3aed03563
1 changed files with 4 additions and 4 deletions

View File

@ -185,22 +185,22 @@ enum Opcode
using Inst = u32; using Inst = u32;
using InstLoc = Inst*; using InstLoc = Inst*;
unsigned inline getOpcode(Inst i) constexpr u32 getOpcode(Inst i)
{ {
return i & 255; return i & 255;
} }
unsigned inline isImm(Inst i) constexpr bool isImm(Inst i)
{ {
return getOpcode(i) >= CInt16 && getOpcode(i) <= CInt32; return getOpcode(i) >= CInt16 && getOpcode(i) <= CInt32;
} }
unsigned inline isICmp(Inst i) constexpr bool isICmp(Inst i)
{ {
return getOpcode(i) >= ICmpEq && getOpcode(i) <= ICmpSle; return getOpcode(i) >= ICmpEq && getOpcode(i) <= ICmpSle;
} }
unsigned inline isFResult(Inst i) constexpr bool isFResult(Inst i)
{ {
return getOpcode(i) > FResult_Start && getOpcode(i) < FResult_End; return getOpcode(i) > FResult_Start && getOpcode(i) < FResult_End;
} }