Changeset 68fe946e for src/CodeTools
- Timestamp:
- Oct 8, 2021, 11:38:22 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- fe8c31e
- Parents:
- 237df76
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeTools/DeclStats.cc
r237df76 r68fe946e 156 156 /// number of counting bins for linkages 157 157 static const unsigned n_named_specs = 8; 158 /// map from total number of specs to bins 159 static const unsigned ind_for_linkage[16]; 158 /// Mapping function from linkage to bin. 159 static unsigned linkage_index( LinkageSpec::Spec spec ) { 160 switch ( spec ) { 161 case LinkageSpec::Intrinsic: return 0; 162 case LinkageSpec::C: return 1; 163 case LinkageSpec::Cforall: return 2; 164 case LinkageSpec::AutoGen: return 3; 165 case LinkageSpec::Compiler: return 4; 166 case LinkageSpec::BuiltinCFA: return 5; 167 case LinkageSpec::BuiltinC: return 6; 168 default: return 7; 169 } 170 } 160 171 161 172 Stats for_linkage[n_named_specs]; ///< Stores separate stats per linkage … … 366 377 const std::string& mangleName = decl->get_mangleName().empty() ? decl->name : decl->get_mangleName(); 367 378 if ( seen_names.insert( mangleName ).second ) { 368 Stats& stats = for_linkage[ ind_for_linkage[ decl->linkage ]];379 Stats& stats = for_linkage[ linkage_index( decl->linkage ) ]; 369 380 370 381 ++stats.n_decls; … … 527 538 }; 528 539 529 const unsigned DeclStats::ind_for_linkage[]530 = { 7, 7, 2, 1, 7, 7, 7, 3, 4, 7, 6, 5, 7, 7, 7, 0 };531 532 540 void printDeclStats( std::list< Declaration * > &translationUnit ) { 533 541 PassVisitor<DeclStats> stats;
Note: See TracChangeset
for help on using the changeset viewer.