]> git.tdb.fi Git - libs/gl.git/commitdiff
Mark function return types as used
authorMikko Rasa <tdb@tdb.fi>
Fri, 5 Mar 2021 19:03:48 +0000 (21:03 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 5 Mar 2021 23:00:31 +0000 (01:00 +0200)
source/glsl/optimize.cpp
source/glsl/optimize.h

index 88a323992636b0642d05d4134ee81d68bdebce9c..9d9464e4107869b758ca5e0fe8b15e09973bd47c 100644 (file)
@@ -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),
index 85f11780baf45a8b77401aecccee255215a0bb2f..92e19c8c9be08a8a649586929c0755607e558fab 100644 (file)
@@ -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