[41a7137] | 1 | //
|
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
|
---|
| 3 | //
|
---|
| 4 | // The contents of this file are covered under the licence agreement in the
|
---|
| 5 | // file "LICENCE" distributed with Cforall.
|
---|
| 6 | //
|
---|
| 7 | // DeclStats.cc --
|
---|
| 8 | //
|
---|
| 9 | // Author : Aaron Moss
|
---|
| 10 | // Created On : Wed Jan 31 16:40:00 2016
|
---|
| 11 | // Last Modified By : Aaron Moss
|
---|
| 12 | // Last Modified On : Wed Jan 31 16:40:00 2016
|
---|
| 13 | // Update Count : 1
|
---|
| 14 | //
|
---|
| 15 |
|
---|
| 16 | #include "DeclStats.h"
|
---|
| 17 |
|
---|
[bf2438c] | 18 | #include <iostream> // for operator<<, basic_ostream, cout
|
---|
| 19 | #include <map> // for map
|
---|
| 20 | #include <string> // for string, operator+, operator<<, cha...
|
---|
| 21 | #include <unordered_map> // for unordered_map
|
---|
| 22 | #include <unordered_set> // for unordered_set
|
---|
| 23 | #include <utility> // for pair, make_pair
|
---|
| 24 |
|
---|
| 25 | #include "Common/SemanticError.h" // for SemanticError
|
---|
| 26 | #include "Common/VectorMap.h" // for VectorMap
|
---|
| 27 | #include "GenPoly/GenPoly.h" // for hasPolyBase
|
---|
| 28 | #include "Parser/LinkageSpec.h" // for ::NoOfSpecs, Spec
|
---|
| 29 | #include "SynTree/Declaration.h" // for FunctionDecl, TypeDecl, Declaration
|
---|
| 30 | #include "SynTree/Expression.h" // for UntypedExpr, Expression
|
---|
| 31 | #include "SynTree/Statement.h" // for CompoundStmt
|
---|
| 32 | #include "SynTree/Type.h" // for Type, FunctionType, PointerType
|
---|
| 33 | #include "SynTree/Visitor.h" // for maybeAccept, Visitor, acceptAll
|
---|
[41a7137] | 34 |
|
---|
| 35 | namespace CodeTools {
|
---|
[bf2438c] | 36 |
|
---|
[fa2de95] | 37 | class DeclStats : public Visitor {
|
---|
[424931d] | 38 | template<typename T>
|
---|
| 39 | static void sum(T& a, const T& b) { a += b; }
|
---|
[6a5f0e7] | 40 |
|
---|
[424931d] | 41 | static void sum(VectorMap<unsigned>& a, const VectorMap<unsigned>& b) {
|
---|
| 42 | a.reserve( b.size() );
|
---|
| 43 | for ( unsigned i = 0; i < b.size(); ++i ) {
|
---|
| 44 | a[i] += b[i];
|
---|
| 45 | }
|
---|
| 46 | }
|
---|
[fa2de95] | 47 |
|
---|
[424931d] | 48 | template<typename K>
|
---|
| 49 | static void sum(std::map<K, unsigned>& a, const std::map<K, unsigned>& b) {
|
---|
| 50 | for ( const auto& entry : b ) {
|
---|
| 51 | a[ entry.first ] += entry.second;
|
---|
[6a5f0e7] | 52 | }
|
---|
[424931d] | 53 | }
|
---|
[6215a5c] | 54 |
|
---|
[424931d] | 55 | template<typename K>
|
---|
| 56 | static void sum(std::unordered_map<K, unsigned>& a, const std::unordered_map<K, unsigned>& b) {
|
---|
| 57 | for ( const auto& entry : b ) {
|
---|
| 58 | a[ entry.first ] += entry.second;
|
---|
[6a5f0e7] | 59 | }
|
---|
[424931d] | 60 | }
|
---|
[6215a5c] | 61 |
|
---|
[424931d] | 62 | struct ArgPackStats {
|
---|
| 63 | VectorMap<unsigned> n; ///< Count of decls with each number of elements
|
---|
| 64 | VectorMap<unsigned> n_basic; ///< Count of decls with each number of basic type elements
|
---|
| 65 | VectorMap<unsigned> n_poly; ///< Count of decls with each number of polymorphic elements
|
---|
| 66 | std::map<unsigned, unsigned> p_basic; ///< Count of decls with each percentage of basic type elements
|
---|
| 67 | std::map<unsigned, unsigned> p_poly; ///< Count of decls with each percentage of polymorphic elements
|
---|
[eed5e48] | 68 | VectorMap<unsigned> n_types; ///< Count of decls with each number of distinct types in the pack
|
---|
[131dbb3] | 69 | /// Count of decls with each percentage of new types in lists.
|
---|
| 70 | /// Types used in the parameter list that recur in the return list are not considered to be new.
|
---|
| 71 | std::map<unsigned, unsigned> p_new;
|
---|
[424931d] | 72 |
|
---|
| 73 | ArgPackStats& operator+= (const ArgPackStats& o) {
|
---|
| 74 | sum(n, o.n);
|
---|
| 75 | sum(n_basic, o.n_basic);
|
---|
| 76 | sum(n_poly, o.n_poly);
|
---|
| 77 | sum(p_basic, o.p_basic);
|
---|
| 78 | sum(p_poly, o.p_poly);
|
---|
[eed5e48] | 79 | sum(n_types, o.n_types);
|
---|
[131dbb3] | 80 | sum(p_new, o.p_new);
|
---|
[bf2438c] | 81 |
|
---|
[424931d] | 82 | return *this;
|
---|
| 83 | }
|
---|
| 84 | };
|
---|
[bf2438c] | 85 |
|
---|
[424931d] | 86 | struct Stats {
|
---|
| 87 | unsigned n_decls; ///< Total number of declarations
|
---|
| 88 | /// Count of declarations with each number of assertion parameters
|
---|
| 89 | VectorMap<unsigned> n_type_params;
|
---|
| 90 | /// Count of declarations with each name
|
---|
| 91 | std::unordered_map<std::string, unsigned> by_name;
|
---|
[f923b5f] | 92 | /// Count of uses of each basic type
|
---|
| 93 | std::unordered_map<std::string, unsigned> basic_type_names;
|
---|
| 94 | /// Count of uses of each non-basic type
|
---|
| 95 | std::unordered_map<std::string, unsigned> compound_type_names;
|
---|
[131dbb3] | 96 | /// Count of decls using each basic type
|
---|
| 97 | std::unordered_map<std::string, unsigned> basic_type_decls;
|
---|
| 98 | /// Count of decls using each compound type
|
---|
| 99 | std::unordered_map<std::string, unsigned> compound_type_decls;
|
---|
[424931d] | 100 | /// Stats for the parameter list
|
---|
| 101 | ArgPackStats params;
|
---|
| 102 | /// Stats for the return list
|
---|
| 103 | ArgPackStats returns;
|
---|
[bf2438c] | 104 |
|
---|
[424931d] | 105 | /// Count of declarations with each number of assertions
|
---|
| 106 | std::map<unsigned, unsigned> n_assns;
|
---|
| 107 | /// Stats for the assertions' parameters
|
---|
| 108 | ArgPackStats assn_params;
|
---|
| 109 | /// Stats for the assertions' return types
|
---|
| 110 | ArgPackStats assn_returns;
|
---|
[bf2438c] | 111 |
|
---|
[131dbb3] | 112 | Stats() : n_decls(0), n_type_params(), by_name(), basic_type_names(), compound_type_names(), basic_type_decls(), compound_type_decls(), params(), returns(), n_assns(), assn_params(), assn_returns() {}
|
---|
[567903e] | 113 |
|
---|
[6a5f0e7] | 114 | public:
|
---|
| 115 | Stats& operator+= (const Stats& o) {
|
---|
| 116 | sum( n_decls, o.n_decls );
|
---|
| 117 | sum( n_type_params, o.n_type_params );
|
---|
| 118 | sum( by_name, o.by_name );
|
---|
[f923b5f] | 119 | sum( basic_type_names, o.basic_type_names );
|
---|
| 120 | sum( compound_type_names, o.compound_type_names );
|
---|
[131dbb3] | 121 | sum( basic_type_decls, o.basic_type_decls );
|
---|
| 122 | sum( compound_type_decls, o.compound_type_decls );
|
---|
[424931d] | 123 | sum( params, o.params );
|
---|
| 124 | sum( returns, o.returns );
|
---|
| 125 | sum( n_assns, o.n_assns );
|
---|
| 126 | sum( assn_params, o.assn_params );
|
---|
| 127 | sum( assn_returns, o.assn_returns );
|
---|
[bf2438c] | 128 |
|
---|
[fa2de95] | 129 | return *this;
|
---|
| 130 | }
|
---|
| 131 | };
|
---|
| 132 |
|
---|
| 133 | Stats for_linkage[LinkageSpec::NoOfSpecs]; ///< Stores separate stats per linkage
|
---|
| 134 | std::unordered_set<std::string> seen_names; ///< Stores manglenames already seen to avoid double-counting
|
---|
| 135 | Stats total;
|
---|
[31868da] | 136 | /// Count of expressions with (depth, fanout)
|
---|
| 137 | std::map<std::pair<unsigned, unsigned>, unsigned> exprs_by_fanout_at_depth;
|
---|
[fa2de95] | 138 |
|
---|
[f923b5f] | 139 | /// Update arg pack stats based on a declaration list
|
---|
[131dbb3] | 140 | void analyze( Stats& stats, std::unordered_set<std::string>& seen, ArgPackStats& pstats, std::list<DeclarationWithType*>& decls ) {
|
---|
[eed5e48] | 141 | std::unordered_set<std::string> types;
|
---|
[131dbb3] | 142 | unsigned n = 0; ///< number of args/returns
|
---|
| 143 | unsigned n_basic = 0; ///< number of basic types
|
---|
| 144 | unsigned n_poly = 0; ///< number of polymorphic types
|
---|
| 145 | unsigned n_new = 0; ///< number of new types
|
---|
[f923b5f] | 146 | for ( auto decl : decls ) {
|
---|
[eed5e48] | 147 | Type* dt = decl->get_type();
|
---|
| 148 |
|
---|
| 149 | n += dt->size();
|
---|
[bf2438c] | 150 |
|
---|
[eed5e48] | 151 | std::stringstream ss;
|
---|
| 152 | dt->print( ss );
|
---|
| 153 | types.insert( ss.str() );
|
---|
[131dbb3] | 154 | bool this_new = seen.insert( ss.str() ).second;
|
---|
| 155 | if ( this_new ) { ++n_new; }
|
---|
[eed5e48] | 156 |
|
---|
| 157 | if ( dynamic_cast<BasicType*>( dt ) ) {
|
---|
[f923b5f] | 158 | ++n_basic;
|
---|
| 159 | ++stats.basic_type_names[ ss.str() ];
|
---|
[131dbb3] | 160 | if ( this_new ) {
|
---|
| 161 | ++stats.basic_type_decls[ ss.str() ];
|
---|
| 162 | }
|
---|
[eed5e48] | 163 | } else if ( GenPoly::hasPolyBase( dt ) ) {
|
---|
[f923b5f] | 164 | ++n_poly;
|
---|
| 165 | } else {
|
---|
| 166 | ++stats.compound_type_names[ ss.str() ];
|
---|
[131dbb3] | 167 | if ( this_new ) {
|
---|
| 168 | ++stats.compound_type_decls[ ss.str() ];
|
---|
| 169 | }
|
---|
[f923b5f] | 170 | }
|
---|
| 171 | }
|
---|
| 172 | ++pstats.n.at( n );
|
---|
| 173 | ++pstats.n_basic.at( n_basic );
|
---|
| 174 | ++pstats.n_poly.at( n_poly );
|
---|
| 175 | if ( n > 0 ) {
|
---|
| 176 | ++pstats.p_basic[ n_basic*100/n ];
|
---|
| 177 | ++pstats.p_poly[ n_poly*100/n ];
|
---|
[131dbb3] | 178 | ++pstats.p_new[ n_new*100/n ];
|
---|
[f923b5f] | 179 | }
|
---|
[eed5e48] | 180 | ++pstats.n_types.at( types.size() );
|
---|
[f923b5f] | 181 | }
|
---|
[bf2438c] | 182 |
|
---|
[f923b5f] | 183 | void analyzeFunc( FunctionType* fnTy, Stats& stats, ArgPackStats& params, ArgPackStats& returns ) {
|
---|
[131dbb3] | 184 | std::unordered_set<std::string> seen;
|
---|
| 185 | analyze( stats, seen, params, fnTy->get_parameters() );
|
---|
| 186 | analyze( stats, seen, returns, fnTy->get_returnVals() );
|
---|
[6a5f0e7] | 187 | }
|
---|
| 188 |
|
---|
[31868da] | 189 | void analyzeExpr( UntypedExpr *expr, unsigned depth ) {
|
---|
| 190 | auto& args = expr->get_args();
|
---|
| 191 | unsigned fanout = args.size();
|
---|
[bf2438c] | 192 |
|
---|
[31868da] | 193 | ++exprs_by_fanout_at_depth[ std::make_pair(depth, fanout) ];
|
---|
| 194 | for ( Expression* arg : args ) {
|
---|
| 195 | if ( UntypedExpr *uearg = dynamic_cast<UntypedExpr*>(arg) ) {
|
---|
| 196 | analyzeExpr( uearg, depth+1 );
|
---|
| 197 | }
|
---|
| 198 | }
|
---|
| 199 | }
|
---|
| 200 |
|
---|
[fa2de95] | 201 | public:
|
---|
| 202 | using Visitor::visit;
|
---|
| 203 |
|
---|
| 204 | virtual void visit( FunctionDecl *decl ) {
|
---|
| 205 | // skip if already seen declaration for this function
|
---|
| 206 | const std::string& mangleName = decl->get_mangleName().empty() ? decl->get_name() : decl->get_mangleName();
|
---|
[1e6b350] | 207 | if ( ! seen_names.insert( mangleName ).second ) {
|
---|
| 208 | maybeAccept( decl->get_statements(), *this );
|
---|
| 209 | return;
|
---|
| 210 | }
|
---|
[bf2438c] | 211 |
|
---|
[fa2de95] | 212 | Stats& stats = for_linkage[ decl->get_linkage() ];
|
---|
| 213 |
|
---|
| 214 | ++stats.n_decls;
|
---|
| 215 | FunctionType* fnTy = decl->get_functionType();
|
---|
[6a5f0e7] | 216 | const Type::ForallList& forall = fnTy->get_forall();
|
---|
| 217 | ++stats.n_type_params.at( forall.size() );
|
---|
[424931d] | 218 | unsigned n_assns = 0;
|
---|
[6a5f0e7] | 219 | for ( TypeDecl* fdecl : forall ) {
|
---|
[424931d] | 220 | n_assns += fdecl->get_assertions().size();
|
---|
[6a5f0e7] | 221 | for ( DeclarationWithType* assn : fdecl->get_assertions() ) {
|
---|
| 222 | FunctionType *assnTy = 0;
|
---|
| 223 | if ( ObjectDecl *assnObj = dynamic_cast<ObjectDecl*>(assn) ) {
|
---|
| 224 | if ( PointerType *ptrTy = dynamic_cast<PointerType*>(assnObj->get_type()) ) {
|
---|
| 225 | assnTy = dynamic_cast<FunctionType*>(ptrTy->get_base());
|
---|
| 226 | } else assnTy = dynamic_cast<FunctionType*>(assnObj->get_type());
|
---|
| 227 | } else if ( FunctionDecl *assnDecl = dynamic_cast<FunctionDecl*>(assn) ) {
|
---|
| 228 | assnTy = assnDecl->get_functionType();
|
---|
| 229 | }
|
---|
[f923b5f] | 230 | if ( assnTy ) analyzeFunc( assnTy, stats, stats.assn_params, stats.assn_returns );
|
---|
[6a5f0e7] | 231 | }
|
---|
| 232 | }
|
---|
[424931d] | 233 | ++stats.n_assns[ n_assns ];
|
---|
[fa2de95] | 234 |
|
---|
| 235 | ++stats.by_name[ decl->get_name() ];
|
---|
| 236 |
|
---|
[f923b5f] | 237 | analyzeFunc( fnTy, stats, stats.params, stats.returns );
|
---|
[1e6b350] | 238 |
|
---|
| 239 | // analyze expressions in decl statements
|
---|
| 240 | maybeAccept( decl->get_statements(), *this );
|
---|
[fa2de95] | 241 | }
|
---|
| 242 |
|
---|
[31868da] | 243 | virtual void visit( UntypedExpr *expr ) {
|
---|
| 244 | analyzeExpr( expr, 0 );
|
---|
| 245 | }
|
---|
| 246 |
|
---|
[fa2de95] | 247 | private:
|
---|
| 248 | template<typename F>
|
---|
[424931d] | 249 | void printAll( const std::string& name, F extract ) {
|
---|
[fa2de95] | 250 | std::cout << "\"" << name << "\",";
|
---|
| 251 | for ( const auto& stats : for_linkage ) {
|
---|
| 252 | std::cout << "," << extract(stats);
|
---|
| 253 | }
|
---|
| 254 | std::cout << "," << extract(total) << std::endl;
|
---|
| 255 | }
|
---|
| 256 |
|
---|
| 257 | template<typename F>
|
---|
[424931d] | 258 | void printAllMap( const std::string& name, F extract ) {
|
---|
[fa2de95] | 259 | for ( const auto& entry : extract(total) ) {
|
---|
| 260 | const auto& key = entry.first;
|
---|
| 261 | std::cout << "\"" << name << "\"," << key;
|
---|
| 262 | for ( const auto& stats : for_linkage ) {
|
---|
| 263 | const auto& map = extract(stats);
|
---|
| 264 | auto it = map.find( key );
|
---|
| 265 | if ( it == map.end() ) std::cout << ",0";
|
---|
| 266 | else std::cout << "," << it->second;
|
---|
| 267 | }
|
---|
| 268 | std::cout << "," << entry.second << std::endl;
|
---|
| 269 | }
|
---|
| 270 | }
|
---|
| 271 |
|
---|
| 272 | template<typename F>
|
---|
[424931d] | 273 | void printAllHisto( const std::string& name, F extract ) {
|
---|
[fa2de95] | 274 | VectorMap<unsigned> histos[LinkageSpec::NoOfSpecs];
|
---|
| 275 | VectorMap<unsigned> thisto;
|
---|
| 276 |
|
---|
| 277 | for ( const auto& entry : extract(total) ) { ++thisto.at( entry.second ); }
|
---|
| 278 |
|
---|
| 279 | for ( unsigned i = 0; i < LinkageSpec::NoOfSpecs; ++i ) {
|
---|
| 280 | // can't be a higher count in one of the sub-histograms than the total
|
---|
| 281 | histos[i].reserve( thisto.size() );
|
---|
| 282 |
|
---|
| 283 | for ( const auto& entry : extract(for_linkage[i]) ) { ++histos[i][entry.second]; }
|
---|
| 284 | }
|
---|
| 285 |
|
---|
| 286 | for ( unsigned i = 0; i < thisto.size(); ++i ) {
|
---|
| 287 | std::cout << "\"" << name << "\"," << i;
|
---|
| 288 | for ( const auto& histo : histos ) {
|
---|
| 289 | std::cout << "," << histo[i];
|
---|
| 290 | }
|
---|
| 291 | std::cout << "," << thisto[i] << std::endl;
|
---|
| 292 | }
|
---|
| 293 | }
|
---|
[6a5f0e7] | 294 |
|
---|
| 295 | template<typename F>
|
---|
[424931d] | 296 | void printAllSparseHisto( const std::string& name, F extract ) {
|
---|
[6a5f0e7] | 297 | std::map<unsigned, unsigned> histos[LinkageSpec::NoOfSpecs];
|
---|
| 298 | std::map<unsigned, unsigned> thisto;
|
---|
| 299 |
|
---|
| 300 | for ( const auto& entry : extract(total) ) { ++thisto[ entry.second ]; }
|
---|
| 301 |
|
---|
| 302 | for ( unsigned i = 0; i < LinkageSpec::NoOfSpecs; ++i ) {
|
---|
| 303 | for ( const auto& entry : extract(for_linkage[i]) ) { ++histos[i][entry.second]; }
|
---|
| 304 | }
|
---|
| 305 |
|
---|
| 306 | for ( const auto& entry : thisto ) {
|
---|
| 307 | const auto& key = entry.first;
|
---|
| 308 | std::cout << "\"" << name << "\"," << key;
|
---|
| 309 | for ( unsigned i = 0; i < LinkageSpec::NoOfSpecs; ++i ) {
|
---|
| 310 | auto it = histos[i].find( key );
|
---|
| 311 | if ( it == histos[i].end() ) std::cout << ",0";
|
---|
| 312 | else std::cout << "," << it->second;
|
---|
| 313 | }
|
---|
| 314 | std::cout << "," << entry.second << std::endl;
|
---|
| 315 | }
|
---|
| 316 | }
|
---|
[424931d] | 317 |
|
---|
| 318 | template<typename F>
|
---|
| 319 | void printAllPack( const std::string& name, F extract ) {
|
---|
| 320 | printAllMap("n_basic_" + name, [&extract](const Stats& stats) { return extract(stats).n_basic; });
|
---|
| 321 | printAllMap("n_poly_" + name, [&extract](const Stats& stats) { return extract(stats).n_poly; });
|
---|
| 322 | printAllMap("n_" + name, [&extract](const Stats& stats) { return extract(stats).n; });
|
---|
| 323 | printAllMap("%_basic_" + name, [&extract](const Stats& stats) { return extract(stats).p_basic; });
|
---|
| 324 | printAllMap("%_poly_" + name, [&extract](const Stats& stats) { return extract(stats).p_poly; });
|
---|
[eed5e48] | 325 | printAllMap("n_distinct_types_" + name, [&extract](const Stats& stats) { return extract(stats).n_types; });
|
---|
[131dbb3] | 326 | printAllMap("%_new_types_in_" + name, [&extract](const Stats& stats) { return extract(stats).p_new; });
|
---|
[424931d] | 327 | }
|
---|
[31868da] | 328 |
|
---|
[bf2438c] | 329 | void printPairMap( const std::string& name,
|
---|
[31868da] | 330 | const std::map<std::pair<unsigned, unsigned>, unsigned>& map ) {
|
---|
| 331 | for ( const auto& entry : map ) {
|
---|
| 332 | const auto& key = entry.first;
|
---|
[bf2438c] | 333 | std::cout << "\"" << name << "\"," << key.first << "," << key.second << ","
|
---|
[31868da] | 334 | << entry.second << std::endl;
|
---|
| 335 | }
|
---|
| 336 | }
|
---|
[bf2438c] | 337 |
|
---|
[fa2de95] | 338 | public:
|
---|
| 339 | void print() {
|
---|
| 340 | for ( auto& stats : for_linkage ) {
|
---|
| 341 | total += stats;
|
---|
| 342 | }
|
---|
| 343 |
|
---|
| 344 | std::cout << ",,\"intrinsic\",\"Cforall\",\"C\",\"autogen\",\"builtin\",\"TOTAL\"" << std::endl;
|
---|
| 345 |
|
---|
[6a5f0e7] | 346 | printAllMap("n_type_params", [](const Stats& stats) { return stats.n_type_params; });
|
---|
[fa2de95] | 347 | printAll("n_decls", [](const Stats& stats) { return stats.n_decls; });
|
---|
| 348 | printAll("unique_names", [](const Stats& stats) { return stats.by_name.size(); });
|
---|
[6a5f0e7] | 349 | printAllSparseHisto("overloads", [](const Stats& stats) { return stats.by_name; });
|
---|
[f923b5f] | 350 | printAll("basic_type_names", [](const Stats& stats) { return stats.basic_type_names.size(); });
|
---|
[97d246d] | 351 | printAllSparseHisto("basic_type_uses", [](const Stats& stats) { return stats.basic_type_names; });
|
---|
[131dbb3] | 352 | printAllSparseHisto("decls_using_basic_type", [](const Stats& stats) { return stats.basic_type_decls; });
|
---|
[f923b5f] | 353 | printAll("compound_type_names", [](const Stats& stats) { return stats.compound_type_names.size(); });
|
---|
[97d246d] | 354 | printAllSparseHisto("compound_type_uses", [](const Stats& stats) { return stats.compound_type_names; });
|
---|
[131dbb3] | 355 | printAllSparseHisto("decls_using_compound_type", [](const Stats& stats) { return stats.compound_type_decls; });
|
---|
[424931d] | 356 | printAllPack("params", [](const Stats& stats) { return stats.params; });
|
---|
| 357 | printAllPack("returns", [](const Stats& stats) { return stats.returns; });
|
---|
| 358 | printAllMap("n_assns", [](const Stats& stats) { return stats.n_assns; });
|
---|
| 359 | printAllPack("assn_params", [](const Stats& stats) { return stats.assn_params; });
|
---|
| 360 | printAllPack("assn_returns", [](const Stats& stats) { return stats.assn_returns; });
|
---|
[31868da] | 361 | std::cout << std::endl;
|
---|
| 362 |
|
---|
| 363 | printPairMap("exprs_by_depth+fanout", exprs_by_fanout_at_depth);
|
---|
[fa2de95] | 364 | }
|
---|
| 365 | };
|
---|
[41a7137] | 366 |
|
---|
| 367 | void printDeclStats( std::list< Declaration * > &translationUnit ) {
|
---|
[fa2de95] | 368 | DeclStats stats;
|
---|
| 369 | acceptAll( translationUnit, stats );
|
---|
| 370 | stats.print();
|
---|
[41a7137] | 371 | }
|
---|
[bf2438c] | 372 |
|
---|
[41a7137] | 373 | } // namespace CodeTools
|
---|
| 374 |
|
---|
| 375 | // Local Variables: //
|
---|
| 376 | // tab-width: 4 //
|
---|
| 377 | // mode: c++ //
|
---|
| 378 | // compile-command: "make install" //
|
---|
| 379 | // End: //
|
---|