Index: src/CodeTools/DeclStats.cc
===================================================================
--- src/CodeTools/DeclStats.cc	(revision 7a560c17e09d86c2f09afb972b0b4d224a0be91c)
+++ src/CodeTools/DeclStats.cc	(revision 6215a5c52acb3ffb291c40b10544c35886b63ef9)
@@ -22,4 +22,5 @@
 
 #include "Common/VectorMap.h"
+#include "GenPoly/GenPoly.h"
 #include "Parser/LinkageSpec.h"
 #include "SynTree/Declaration.h"
@@ -39,6 +40,10 @@
 			/// Count of declarations with each number of return types
 			VectorMap<unsigned> by_returns;
-
-			Stats() : n_decls(0), mono_decls(0), poly_decls(0), by_name() {}
+			/// Count of declarations with each number of polymorphic parameters
+			VectorMap<unsigned> n_poly_params;
+			/// Count of declarations with each number of polymorphic return types
+			VectorMap<unsigned> n_poly_returns;
+
+			Stats() : n_decls(0), mono_decls(0), poly_decls(0), by_name(), by_params(), by_returns(), n_poly_params(), n_poly_returns() {}
 
 			Stats& operator+= (const Stats& o) {
@@ -61,4 +66,14 @@
 				}
 
+				n_poly_params.reserve( o.n_poly_params.size() );
+				for ( unsigned i = 0; i < o.n_poly_params.size(); ++i ) {
+					n_poly_params[i] += o.n_poly_params[i];
+				}
+
+				n_poly_returns.reserve( o.n_poly_returns.size() );
+				for ( unsigned i = 0; i < o.n_poly_returns.size(); ++i ) {
+					n_poly_returns[i] += o.n_poly_returns[i];
+				}
+
 				return *this;
 			}
@@ -86,10 +101,20 @@
 
 			unsigned n_params = 0;
-			for ( auto pdecl : fnTy->get_parameters() ) { n_params += pdecl->get_type()->size(); }
+			unsigned n_poly_params = 0;
+			for ( auto pdecl : fnTy->get_parameters() ) {
+				n_params += pdecl->get_type()->size();
+				if ( GenPoly::hasPolyBase( pdecl->get_type() ) ) ++n_poly_params;
+			}
 			++stats.by_params.at( n_params );
+			++stats.n_poly_params.at( n_poly_params );
 
 			unsigned n_returns = 0;
-			for ( auto rdecl : fnTy->get_returnVals() ) { n_returns += rdecl->get_type()->size(); }
+			unsigned n_poly_returns = 0;
+			for ( auto rdecl : fnTy->get_returnVals() ) {
+				n_returns += rdecl->get_type()->size();
+				if ( GenPoly::hasPolyBase( rdecl->get_type() ) ) ++n_poly_returns;
+			}
 			++stats.by_returns.at( n_returns );
+			++stats.n_poly_returns.at( n_poly_returns );
 		}
 
@@ -156,5 +181,7 @@
 
 			printAllHisto("overloads", [](const Stats& stats) { return stats.by_name; });
+			printAllMap("n_poly_params", [](const Stats& stats) { return stats.n_poly_params; });
 			printAllMap("n_params", [](const Stats& stats) { return stats.by_params; });
+			printAllMap("n_poly_returns", [](const Stats& stats) { return stats.n_poly_returns; });
 			printAllMap("n_returns", [](const Stats& stats) { return stats.by_returns; });
 		}
