nv50/ir: fix a couple of warnings

This commit is contained in:
Christoph Bumiller 2013-01-12 17:37:34 +01:00 committed by Christoph Bumiller
parent f59a3a0fe2
commit b0863c26d4
3 changed files with 11 additions and 6 deletions

View file

@ -722,7 +722,9 @@ bool Source::scanSource()
if (info->io.genUserClip > 0) { if (info->io.genUserClip > 0) {
info->io.clipDistanceMask = (1 << info->io.genUserClip) - 1; info->io.clipDistanceMask = (1 << info->io.genUserClip) - 1;
for (unsigned int n = 0; n < ((info->io.genUserClip + 3) / 4); ++n) { const unsigned int nOut = (info->io.genUserClip + 3) / 4;
for (unsigned int n = 0; n < nOut; ++n) {
unsigned int i = info->numOutputs++; unsigned int i = info->numOutputs++;
info->out[i].id = i; info->out[i].id = i;
info->out[i].sn = TGSI_SEMANTIC_CLIPDIST; info->out[i].sn = TGSI_SEMANTIC_CLIPDIST;

View file

@ -263,7 +263,7 @@ public:
bool run(const std::list<ValuePair>&); bool run(const std::list<ValuePair>&);
Symbol *assignSlot(const Interval&, unsigned int size); Symbol *assignSlot(const Interval&, const unsigned int size);
inline int32_t getStackSize() const { return stackSize; } inline int32_t getStackSize() const { return stackSize; }
private: private:
@ -1384,7 +1384,7 @@ GCRA::cleanup(const bool success)
} }
Symbol * Symbol *
SpillCodeInserter::assignSlot(const Interval &livei, unsigned int size) SpillCodeInserter::assignSlot(const Interval &livei, const unsigned int size)
{ {
SpillSlot slot; SpillSlot slot;
int32_t offsetBase = stackSize; int32_t offsetBase = stackSize;
@ -1397,21 +1397,22 @@ SpillCodeInserter::assignSlot(const Interval &livei, unsigned int size)
slot.sym = NULL; slot.sym = NULL;
for (offset = offsetBase; offset < stackSize; offset += size) { for (offset = offsetBase; offset < stackSize; offset += size) {
const int32_t entryEnd = offset + size;
while (it != slots.end() && it->offset < offset) while (it != slots.end() && it->offset < offset)
++it; ++it;
if (it == slots.end()) // no slots left if (it == slots.end()) // no slots left
break; break;
std::list<SpillSlot>::iterator bgn = it; std::list<SpillSlot>::iterator bgn = it;
while (it != slots.end() && it->offset < (offset + size)) { while (it != slots.end() && it->offset < entryEnd) {
it->occup.print(); it->occup.print();
if (it->occup.overlaps(livei)) if (it->occup.overlaps(livei))
break; break;
++it; ++it;
} }
if (it == slots.end() || it->offset >= (offset + size)) { if (it == slots.end() || it->offset >= entryEnd) {
// fits // fits
for (; bgn != slots.end() && bgn->offset < (offset + size); ++bgn) { for (; bgn != slots.end() && bgn->offset < entryEnd; ++bgn) {
bgn->occup.insert(livei); bgn->occup.insert(livei);
if (bgn->size() == size) if (bgn->size() == size)
slot.sym = bgn->sym; slot.sym = bgn->sym;

View file

@ -62,6 +62,7 @@ class CodeEmitter
{ {
public: public:
CodeEmitter(const Target *); CodeEmitter(const Target *);
virtual ~CodeEmitter();
// returns whether the instruction was encodable and written // returns whether the instruction was encodable and written
virtual bool emitInstruction(Instruction *) = 0; virtual bool emitInstruction(Instruction *) = 0;
@ -117,6 +118,7 @@ class Target
{ {
public: public:
Target(bool j, bool s) : joinAnterior(j), hasSWSched(s) { } Target(bool j, bool s) : joinAnterior(j), hasSWSched(s) { }
virtual ~Target();
static Target *create(uint32_t chipset); static Target *create(uint32_t chipset);
static void destroy(Target *); static void destroy(Target *);