diff options
author | Francisco Jerez <currojerez@riseup.net> | 2013-10-09 16:54:18 -0700 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2013-10-09 18:22:48 -0700 |
commit | 9bcd5ebdfb7a83e475d1c244948969f785ba6401 (patch) | |
tree | 887493b512e055d4ab9b75866b1faa5ac3c1850e | |
parent | 9209638de2161bdf2b23e215f0331f05a688cea6 (diff) |
glsl: Remove the virtual destructor of ir_instruction.ralloc-new
ir_instruction and its derived classes are only being allocated and
destroyed using ralloc_new/delete, which already keep track of the
allocation type of an object and will always call the correct
destructor. Having a virtual empty destructor in the definition of
ir_instruction is unnecessary (because we don't call operator delete
to free it anymore, so the previous compiler warning is no longer an
issue), and inefficient (because it prevents ralloc_new() from
inferring that ir_instruction subclasses are trivially destructible
and causes two additional indirect calls every time an ir_instruction
is released). Remove it.
-rw-r--r-- | src/glsl/ir.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 9af267c2ad3..d81751cd1cf 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -93,16 +93,6 @@ 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; |