Mesa (master): nv50/ir: fix a couple of warnings
Christoph Bumiller
chrisbmr at kemper.freedesktop.org
Sat Jan 19 19:55:23 UTC 2013
Module: Mesa
Branch: master
Commit: b0863c26d43a9ed135c8db980fb0bc9bca35548c
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0863c26d43a9ed135c8db980fb0bc9bca35548c
Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date: Sat Jan 12 17:37:34 2013 +0100
nv50/ir: fix a couple of warnings
---
.../drivers/nv50/codegen/nv50_ir_from_tgsi.cpp | 4 +++-
src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp | 11 ++++++-----
src/gallium/drivers/nv50/codegen/nv50_ir_target.h | 2 ++
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp
index cf483d0..5078eb4 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp
@@ -722,7 +722,9 @@ bool Source::scanSource()
if (info->io.genUserClip > 0) {
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++;
info->out[i].id = i;
info->out[i].sn = TGSI_SEMANTIC_CLIPDIST;
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp
index 714837e..9947c04 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_ra.cpp
@@ -263,7 +263,7 @@ public:
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; }
private:
@@ -1384,7 +1384,7 @@ GCRA::cleanup(const bool success)
}
Symbol *
-SpillCodeInserter::assignSlot(const Interval &livei, unsigned int size)
+SpillCodeInserter::assignSlot(const Interval &livei, const unsigned int size)
{
SpillSlot slot;
int32_t offsetBase = stackSize;
@@ -1397,21 +1397,22 @@ SpillCodeInserter::assignSlot(const Interval &livei, unsigned int size)
slot.sym = NULL;
for (offset = offsetBase; offset < stackSize; offset += size) {
+ const int32_t entryEnd = offset + size;
while (it != slots.end() && it->offset < offset)
++it;
if (it == slots.end()) // no slots left
break;
std::list<SpillSlot>::iterator bgn = it;
- while (it != slots.end() && it->offset < (offset + size)) {
+ while (it != slots.end() && it->offset < entryEnd) {
it->occup.print();
if (it->occup.overlaps(livei))
break;
++it;
}
- if (it == slots.end() || it->offset >= (offset + size)) {
+ if (it == slots.end() || it->offset >= entryEnd) {
// fits
- for (; bgn != slots.end() && bgn->offset < (offset + size); ++bgn) {
+ for (; bgn != slots.end() && bgn->offset < entryEnd; ++bgn) {
bgn->occup.insert(livei);
if (bgn->size() == size)
slot.sym = bgn->sym;
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_target.h b/src/gallium/drivers/nv50/codegen/nv50_ir_target.h
index c60ee02..757f4f9 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_target.h
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_target.h
@@ -62,6 +62,7 @@ class CodeEmitter
{
public:
CodeEmitter(const Target *);
+ virtual ~CodeEmitter();
// returns whether the instruction was encodable and written
virtual bool emitInstruction(Instruction *) = 0;
@@ -117,6 +118,7 @@ class Target
{
public:
Target(bool j, bool s) : joinAnterior(j), hasSWSched(s) { }
+ virtual ~Target();
static Target *create(uint32_t chipset);
static void destroy(Target *);
More information about the mesa-commit
mailing list