From: Mikko Rasa Date: Fri, 5 Mar 2021 19:03:48 +0000 (+0200) Subject: Mark function return types as used X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ff00056daddbce2e6e16f7c09dcfcb5cde66e85c;p=libs%2Fgl.git Mark function return types as used --- diff --git a/source/glsl/optimize.cpp b/source/glsl/optimize.cpp index 88a32399..9d9464e4 100644 --- a/source/glsl/optimize.cpp +++ b/source/glsl/optimize.cpp @@ -653,6 +653,12 @@ void UnusedTypeRemover::visit(VariableDeclaration &var) unused_nodes.erase(var.type_declaration); } +void UnusedTypeRemover::visit(FunctionDeclaration &func) +{ + unused_nodes.erase(func.return_type_declaration); + TraversingVisitor::visit(func); +} + UnusedVariableRemover::UnusedVariableRemover(): aggregate(0), diff --git a/source/glsl/optimize.h b/source/glsl/optimize.h index 85f11780..92e19c8c 100644 --- a/source/glsl/optimize.h +++ b/source/glsl/optimize.h @@ -179,6 +179,7 @@ private: virtual void visit(ImageTypeDeclaration &); virtual void visit(StructDeclaration &); virtual void visit(VariableDeclaration &); + virtual void visit(FunctionDeclaration &); }; /** Removes variable declarations with no references to them. Assignment