glsl: Add virtual function ir_instruction::as_jump() 80/6180/1
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 3018e0f..878a946 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 {