From: Ian Romanick Date: Thu, 1 Apr 2010 00:52:44 +0000 (-0700) Subject: Add ir_variable::clone X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2d394d4877794d19756c3760d711524dca89f772;p=mesa.git Add ir_variable::clone --- diff --git a/ir.h b/ir.h index c3c5369bfc0..de6f09318ad 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;