summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-31 17:52:44 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-31 17:52:44 -0700
commit2d394d4877794d19756c3760d711524dca89f772 (patch)
tree0a361b8246b5839f362d8c917f860b442deefaa6
parent25711a85c22bed305c9b52b89feb9c600d1892df (diff)
Add ir_variable::clone
-rw-r--r--ir.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/ir.h b/ir.h
index c3c5369bfc..de6f09318a 100644
--- a/ir.h
+++ b/ir.h
@@ -110,6 +110,26 @@ public:
v->visit(this);
}
+ /**
+ * Duplicate an IR variable
+ *
+ * \note
+ * This will probably be made \c virtual and moved to the base class
+ * eventually.
+ */
+ ir_variable *clone() const
+ {
+ ir_variable *var = new ir_variable(type, name);
+
+ var->read_only = this->read_only;
+ var->centroid = this->centroid;
+ var->invariant = this->invariant;
+ var->mode = this->mode;
+ var->interpolation = this->interpolation;
+
+ return var;
+ }
+
const char *name;
unsigned read_only:1;