From 2d394d4877794d19756c3760d711524dca89f772 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 31 Mar 2010 17:52:44 -0700 Subject: [PATCH] Add ir_variable::clone --- ir.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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; -- 2.30.2