IR_X86: Use member initializers where applicable for RegInfo

This commit is contained in:
Lioncash
2017-01-16 16:21:01 -05:00
parent bc7374a5e1
commit 43910e474b

View File

@ -54,7 +54,7 @@ struct RegInfo final : private NonCopyable
static constexpr size_t MAX_NUMBER_OF_REGS = 16; static constexpr size_t MAX_NUMBER_OF_REGS = 16;
JitIL* Jit; JitIL* Jit;
IRBuilder* Build; IRBuilder* Build = nullptr;
InstLoc FirstI; InstLoc FirstI;
// IInfo contains (per instruction) // IInfo contains (per instruction)
@ -66,22 +66,18 @@ struct RegInfo final : private NonCopyable
// and if we can clobber the operands registers. // and if we can clobber the operands registers.
// Warning, Memory instruction use these bits slightly differently. // Warning, Memory instruction use these bits slightly differently.
// Bits 15-31: Spill location // Bits 15-31: Spill location
std::vector<unsigned> IInfo; std::vector<u32> IInfo;
// The last instruction which uses the result of this instruction. Used by the register allocator. // The last instruction which uses the result of this instruction. Used by the register allocator.
std::vector<InstLoc> lastUsed; std::vector<InstLoc> lastUsed;
std::array<InstLoc, MAX_NUMBER_OF_REGS> regs; std::array<InstLoc, MAX_NUMBER_OF_REGS> regs{};
std::array<InstLoc, MAX_NUMBER_OF_REGS> fregs; std::array<InstLoc, MAX_NUMBER_OF_REGS> fregs{};
unsigned numSpills; u32 numSpills = 0;
unsigned numFSpills; u32 numFSpills = 0;
unsigned exitNumber; u32 exitNumber = 0;
RegInfo(JitIL* j, InstLoc f, unsigned insts) RegInfo(JitIL* j, InstLoc f, u32 insts) : Jit(j), FirstI(f), IInfo(insts), lastUsed(insts) {}
: Jit(j), Build(nullptr), FirstI(f), IInfo(insts), lastUsed(insts), regs(), fregs(),
numSpills(0), numFSpills(0), exitNumber(0)
{
}
}; };
static BitSet32 regsInUse(RegInfo& R) static BitSet32 regsInUse(RegInfo& R)