glsl: Add virtual function ir_instruction::as_jump()
authorPaul Berry <stereotype441@gmail.com>
Mon, 22 Apr 2013 20:59:17 +0000 (13:59 -0700)
committerPaul Berry <stereotype441@gmail.com>
Wed, 24 Apr 2013 16:57:37 +0000 (09:57 -0700)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir.h

index 3018e0fbb164f4a5b3674ee714ebd46f2d9e10b3..878a94611a77d1d58d990e8c722ff330a1861c6a 100644 (file)
@@ -131,6 +131,7 @@ public:
    virtual class ir_swizzle *           as_swizzle()          { return NULL; }
    virtual class ir_constant *          as_constant()         { return NULL; }
    virtual class ir_discard *           as_discard()          { return NULL; }
+   virtual class ir_jump *              as_jump()             { return NULL; }
    /*@}*/
 
 protected:
@@ -1298,6 +1299,12 @@ protected:
    {
       ir_type = ir_type_unset;
    }
+
+public:
+   virtual ir_jump *as_jump()
+   {
+      return this;
+   }
 };
 
 class ir_return : public ir_jump {