IR: Make getNumInsts return type size_t
There's no need to cast here.
This commit is contained in:
parent
459a6e73c3
commit
67fc73e82c
|
@ -77,7 +77,7 @@ struct RegInfo final : private NonCopyable
|
||||||
u32 numFSpills = 0;
|
u32 numFSpills = 0;
|
||||||
u32 exitNumber = 0;
|
u32 exitNumber = 0;
|
||||||
|
|
||||||
RegInfo(JitIL* j, InstLoc f, u32 insts) : Jit(j), FirstI(f), IInfo(insts), lastUsed(insts) {}
|
RegInfo(JitIL* j, InstLoc f, size_t insts) : Jit(j), FirstI(f), IInfo(insts), lastUsed(insts) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
static BitSet32 regsInUse(RegInfo& R)
|
static BitSet32 regsInUse(RegInfo& R)
|
||||||
|
|
|
@ -1769,15 +1769,15 @@ void IRBuilder::WriteToFile(u64 codeHash)
|
||||||
|
|
||||||
const InstLoc lastCurReadPtr = curReadPtr;
|
const InstLoc lastCurReadPtr = curReadPtr;
|
||||||
StartForwardPass();
|
StartForwardPass();
|
||||||
const unsigned numInsts = getNumInsts();
|
const size_t numInsts = getNumInsts();
|
||||||
for (unsigned int i = 0; i < numInsts; ++i)
|
for (size_t i = 0; i < numInsts; ++i)
|
||||||
{
|
{
|
||||||
const InstLoc I = ReadForward();
|
const InstLoc I = ReadForward();
|
||||||
const unsigned opcode = getOpcode(*I);
|
const unsigned opcode = getOpcode(*I);
|
||||||
const bool thisUsed = IsMarkUsed(I) || alwaysUseds.find(opcode) != alwaysUseds.end();
|
const bool thisUsed = IsMarkUsed(I) || alwaysUseds.find(opcode) != alwaysUseds.end();
|
||||||
|
|
||||||
// Line number
|
// Line number
|
||||||
fprintf(file, "%4u", i);
|
fprintf(file, "%4zu", i);
|
||||||
|
|
||||||
if (!thisUsed)
|
if (!thisUsed)
|
||||||
fprintf(file, "%*c", 32, ' ');
|
fprintf(file, "%*c", 32, ' ');
|
||||||
|
@ -1795,7 +1795,7 @@ void IRBuilder::WriteToFile(u64 codeHash)
|
||||||
if (isImm(*inst))
|
if (isImm(*inst))
|
||||||
fprintf(file, " 0x%08x", GetImmValue(inst));
|
fprintf(file, " 0x%08x", GetImmValue(inst));
|
||||||
else
|
else
|
||||||
fprintf(file, " %10u", i - (unsigned int)(I - inst));
|
fprintf(file, " %10zu", i - static_cast<size_t>(I - inst));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Op2
|
// Op2
|
||||||
|
@ -1806,7 +1806,7 @@ void IRBuilder::WriteToFile(u64 codeHash)
|
||||||
if (isImm(*inst))
|
if (isImm(*inst))
|
||||||
fprintf(file, " 0x%08x", GetImmValue(inst));
|
fprintf(file, " 0x%08x", GetImmValue(inst));
|
||||||
else
|
else
|
||||||
fprintf(file, " %10u", i - (unsigned int)(I - inst));
|
fprintf(file, " %10zu", i - static_cast<size_t>(I - inst));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extra8Regs.count(opcode))
|
if (extra8Regs.count(opcode))
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <cstddef>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
@ -379,7 +380,7 @@ public:
|
||||||
InstLoc ReadForward() { return curReadPtr++; }
|
InstLoc ReadForward() { return curReadPtr++; }
|
||||||
InstLoc ReadBackward() { return --curReadPtr; }
|
InstLoc ReadBackward() { return --curReadPtr; }
|
||||||
InstLoc getFirstInst() { return InstList.data(); }
|
InstLoc getFirstInst() { return InstList.data(); }
|
||||||
unsigned int getNumInsts() { return (unsigned int)InstList.size(); }
|
size_t getNumInsts() const { return InstList.size(); }
|
||||||
unsigned int GetImmValue(InstLoc I) const { return (u32)GetImmValue64(I); }
|
unsigned int GetImmValue(InstLoc I) const { return (u32)GetImmValue64(I); }
|
||||||
u64 GetImmValue64(InstLoc I) const;
|
u64 GetImmValue64(InstLoc I) const;
|
||||||
void SetMarkUsed(InstLoc I);
|
void SetMarkUsed(InstLoc I);
|
||||||
|
|
Loading…
Reference in New Issue