glsl: Clean up warnings about deleting classes without virtual destructors.
authorEric Anholt <eric@anholt.net>
Mon, 14 May 2012 23:48:47 +0000 (16:48 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 8 Jun 2012 19:42:38 +0000 (12:42 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir.h

index 2c4723627f77e2d76faaa5d75f498d44587fda63..a3f9f058863c42bbbc6937206e5c712a64fa1aba 100644 (file)
@@ -89,6 +89,16 @@ class ir_instruction : public exec_node {
 public:
    enum ir_node_type ir_type;
 
+   /**
+    * GCC 4.7+ and clang warn when deleting an ir_instruction unless
+    * there's a virtual destructor present.  Because we almost
+    * universally use ralloc for our memory management of
+    * ir_instructions, the destructor doesn't need to do any work.
+    */
+   virtual ~ir_instruction()
+   {
+   }
+
    /** ir_print_visitor helper for debugging. */
    void print(void) const;