Changeset 2f42718 for src/CodeTools
- Timestamp:
- Feb 22, 2019, 10:43:29 AM (7 years ago)
- Branches:
- no_list
- Parents:
- 43e0949
- Location:
- src/CodeTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeTools/DeclStats.cc
r43e0949 r2f42718 183 183 } 184 184 185 void analyzeSubtypes( std:: list<DeclarationWithType*>& tys, Stats& stats,185 void analyzeSubtypes( std::vector<DeclarationWithType*>& tys, Stats& stats, 186 186 std::unordered_set<std::string>& elSeen, unsigned& n_poly, bool& seen_poly, 187 unsigned& max_depth, unsigned depth, unsigned& n_subs ) { 187 unsigned& max_depth, unsigned depth, unsigned& n_subs ) 188 { 188 189 for ( DeclarationWithType* dwt : tys ) { 189 190 Type* ty = dwt->get_type(); … … 204 205 } 205 206 206 void analyzeSubtypes( std:: list<Type*>& tys, Stats& stats,207 void analyzeSubtypes( std::vector<Type*>& tys, Stats& stats, 207 208 std::unordered_set<std::string>& elSeen, unsigned& n_poly, bool& seen_poly, 208 209 unsigned& max_depth, unsigned depth ) { … … 246 247 unsigned n_subs = 0; 247 248 analyzeSubtypes( 248 ft-> get_returnVals(), stats, elSeen, n_poly, seen_poly, max_depth, depth,249 ft->returnVals, stats, elSeen, n_poly, seen_poly, max_depth, depth, 249 250 n_subs ); 250 251 analyzeSubtypes( 251 ft-> get_parameters(), stats, elSeen, n_poly, seen_poly, max_depth, depth,252 ft->parameters, stats, elSeen, n_poly, seen_poly, max_depth, depth, 252 253 n_subs ); 253 254 ++stats.n_generic_params.at( n_subs ); … … 280 281 name, n_generic, stats.generic_type_names, stats.generic_type_decls, elSeen); 281 282 analyzeSubtypes( 282 tt-> get_types(), stats, elSeen, n_poly, seen_poly, max_depth, depth );283 tt->types, stats, elSeen, n_poly, seen_poly, max_depth, depth ); 283 284 ++stats.n_generic_params.at( tt->size() ); 284 285 } else if ( dynamic_cast<VarArgsType*>(ty) ) { … … 299 300 300 301 /// Update arg pack stats based on a declaration list 301 void analyze( Stats& stats, std::unordered_set<std::string> & seen,302 std::unordered_set<std::string> & elSeen, ArgPackStats& pstats,303 std:: list<DeclarationWithType*>& decls ) {302 void analyze( Stats& stats, std::unordered_set<std::string> & seen, 303 std::unordered_set<std::string> & elSeen, ArgPackStats & pstats, 304 std::vector<DeclarationWithType*> & decls ) { 304 305 std::unordered_set<std::string> types; 305 306 unsigned n = 0; ///< number of args/returns … … 345 346 std::unordered_set<std::string> seen; 346 347 std::unordered_set<std::string> elSeen; 347 analyze( stats, seen, elSeen, params , fnTy->get_parameters());348 analyze( stats, seen, elSeen, returns, fnTy-> get_returnVals());348 analyze( stats, seen, elSeen, params , fnTy->parameters ); 349 analyze( stats, seen, elSeen, returns, fnTy->returnVals ); 349 350 } 350 351 -
src/CodeTools/ResolvProtoDump.cc
r43e0949 r2f42718 102 102 /// builds space-separated list of types 103 103 template<typename V> 104 static void build( V& visitor, const std:: list< Type* >& tys, std::stringstream& ss,104 static void build( V& visitor, const std::vector< Type* >& tys, std::stringstream& ss, 105 105 septype mode = separated ) { 106 106 if ( tys.empty() ) return; … … 121 121 /// builds list of types wrapped as tuple type 122 122 template<typename V> 123 static void buildAsTuple( V& visitor, const std:: list< Type* >& tys,123 static void buildAsTuple( V& visitor, const std::vector< Type * > & tys, 124 124 std::stringstream& ss ) { 125 125 switch ( tys.size() ) { … … 135 135 136 136 /// gets types from DWT list 137 static std:: list< Type* > from_decls( const std::list< DeclarationWithType* >& decls ) {138 std:: list< Type* > tys;137 static std::vector< Type * > from_decls( const std::vector< DeclarationWithType * > & decls ) { 138 std::vector< Type * > tys; 139 139 for ( auto decl : decls ) { tys.emplace_back( decl->get_type() ); } 140 140 return tys; … … 142 142 143 143 /// gets types from TypeExpr list 144 static std:: list< Type* > from_exprs( const std::list< Expression* >& exprs ) {145 std:: list< Type* > tys;144 static std::vector< Type* > from_exprs( const std::list< Expression* >& exprs ) { 145 std::vector< Type* > tys; 146 146 for ( auto expr : exprs ) { 147 147 if ( TypeExpr* tyExpr = dynamic_cast<TypeExpr*>(expr) ) { … … 587 587 588 588 /// Adds all named declarations in a list to the local scope 589 void addAll( const std:: list<DeclarationWithType*>& decls ) {589 void addAll( const std::vector<DeclarationWithType*>& decls ) { 590 590 for ( auto decl : decls ) { 591 591 // skip anonymous decls … … 644 644 // add body if available 645 645 if ( decl->statements ) { 646 std::list<Type*>rtns = from_decls( decl->type->returnVals );646 auto rtns = from_decls( decl->type->returnVals ); 647 647 Type* rtn = nullptr; 648 648 if ( rtns.size() == 1 ) {
Note:
See TracChangeset
for help on using the changeset viewer.