summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-05-14 16:48:47 -0700
committerEric Anholt <eric@anholt.net>2012-06-08 12:42:38 -0700
commita018747ac8230f0dfb9f5f49a44d78fe97df84a0 (patch)
treee677024762d67d705d6dccf23c0d3fcd1c088e15
parentea055e19c2757dfe97dd13c1deee2bfa177eae3f (diff)
glsl: Clean up warnings about deleting classes without virtual destructors.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/glsl/ir.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 2c4723627f..a3f9f05886 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -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;