Changes in src/ResolvExpr/SpecCost.cc [954c954:5aa4656]
- File:
-
- 1 edited
-
src/ResolvExpr/SpecCost.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/SpecCost.cc
r954c954 r5aa4656 10 10 // Created On : Tue Oct 02 15:50:00 2018 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jul 3 11:07:00 2019 13 // Update Count : 3 14 // 15 16 #include <cassert> 12 // Last Modified On : Wed Jun 19 10:43:00 2019 13 // Update Count : 2 14 // 15 17 16 #include <limits> 18 17 #include <list> … … 130 129 typename std::add_pointer<ast::Type const *(typename T::value_type const &)>::type; 131 130 132 #warning Should use a standard maybe_accept133 void maybe_accept( ast::Type const * type ) {134 if ( type ) {135 auto node = type->accept( *visitor );136 assert( node == nullptr || node == type );137 }138 }139 140 131 // Update the minimum to the new lowest non-none value. 141 132 template<typename T> … … 143 134 for ( const auto & node : list ) { 144 135 count = -1; 145 ma ybe_accept( mapper( node ));136 mapper( node )->accept( *visitor ); 146 137 if ( count != -1 && count < minimum ) minimum = count; 147 138 } … … 178 169 void previsit( const ast::FunctionType * fty ) { 179 170 int minCount = std::numeric_limits<int>::max(); 180 updateMinimumPresent( minCount, fty->params, type_deref);181 updateMinimumPresent( minCount, fty->returns, type_deref);171 updateMinimumPresent( minCount, fty->params, decl_type ); 172 updateMinimumPresent( minCount, fty->returns, decl_type ); 182 173 // Add another level to minCount if set. 183 174 count = toNoneOrInc( minCount ); … … 217 208 } 218 209 ast::Pass<SpecCounter> counter; 219 type->accept( counter );220 return counter. core.get_count();210 type->accept( *counter.pass.visitor ); 211 return counter.pass.get_count(); 221 212 } 222 213
Note:
See TracChangeset
for help on using the changeset viewer.