Changeset 4604bf5
- Timestamp:
- Oct 12, 2023, 10:35:47 AM (14 months ago)
- Branches:
- master
- Children:
- 02c5880
- Parents:
- cf3da24
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/BoxNew.cpp
rcf3da24 r4604bf5 94 94 95 95 /// Adds parameters for otype size and alignment to a function type. 96 void add OTypeParams(96 void addSTypeParams( 97 97 ast::FunctionDecl * decl, 98 98 ast::vector<ast::TypeDecl> const & sizedParams ) { … … 246 246 ast::ObjectDecl const * offsetofParam = layout.offsetofParam; 247 247 assert( nullptr != layout.offsetofParam ); 248 add OTypeParams( layoutDecl, sizedParams );248 addSTypeParams( layoutDecl, sizedParams ); 249 249 250 250 // Calculate structure layout in function body. … … 320 320 ast::ObjectDecl const * alignofParam = layout.alignofParam; 321 321 assert( nullptr == layout.offsetofParam ); 322 add OTypeParams( layoutDecl, sizedParams );322 addSTypeParams( layoutDecl, sizedParams ); 323 323 324 324 // Calculate union layout in function body. … … 641 641 // the variable can be reused as a parameter to the call rather than 642 642 // creating a new temporary variable. Previously this step was an 643 // optimization, but 644 // ... 645 // with the introduction of tuples and UniqueExprs, it is necessary to 646 // ensure that they use the same variable. 643 // optimization, but with the introduction of tuples and UniqueExprs, 644 // it is necessary to ensure that they use the same variable. 647 645 // Essentially, looking for pattern: 648 646 // (x=f(...), x) … … 689 687 // the distinction between _conc_T30 and T3(int)) concRetType may not be 690 688 // a good name in one or both of these places. 691 // TODO A more appropriate name change is welcome.692 689 if ( dynRetType ) { 693 690 ast::Type const * result = mutExpr->result; … … 698 695 } else if ( needsAdapter( function, scopeTypeVars ) 699 696 && !needsAdapter( function, exprTypeVars ) ) { 700 // TODO:701 // The !needsAdapter check may be incorrect. It seems there is some702 // situation where an adapter is applied where it shouldn't be,703 // and this fixes it for some case. More investigation is needed.704 705 697 // Change the application so it calls the adapter rather than the 706 698 // passed function. … … 1774 1766 /// Adds type parameters to the layout call; will generate the 1775 1767 /// appropriate parameters if needed. 1776 void add OTypeParamsToLayoutCall(1768 void addSTypeParamsToLayoutCall( 1777 1769 ast::UntypedExpr * layoutCall, 1778 1770 const ast::vector<ast::Type> & otypeParams ); … … 2014 2006 ast::MemberExpr const * expr ) { 2015 2007 // Only mutate member expressions for polymorphic types. 2016 int typeDepth;2017 2008 ast::Type const * objectType = hasPolyBase( 2018 expr->aggregate->result, scopeTypeVars , &typeDepth2009 expr->aggregate->result, scopeTypeVars 2019 2010 ); 2020 2011 if ( !objectType ) return expr; … … 2094 2085 } 2095 2086 // MemberExpr was converted to pointer + offset; and it is not valid C to 2096 // take the address of an addition, so strip tthe address-of.2087 // take the address of an addition, so strip away the address-of. 2097 2088 // It also preserves the env value. 2098 2089 return ast::mutate_field( expr->arg.get(), &ast::Expr::env, expr->env ); … … 2295 2286 } ); 2296 2287 2297 add OTypeParamsToLayoutCall( layoutCall, sizedParams );2288 addSTypeParamsToLayoutCall( layoutCall, sizedParams ); 2298 2289 2299 2290 stmtsToAddBefore.emplace_back( … … 2336 2327 } ); 2337 2328 2338 add OTypeParamsToLayoutCall( layoutCall, sizedParams );2329 addSTypeParamsToLayoutCall( layoutCall, sizedParams ); 2339 2330 2340 2331 stmtsToAddBefore.emplace_back( … … 2346 2337 } 2347 2338 2348 void PolyGenericCalculator::add OTypeParamsToLayoutCall(2339 void PolyGenericCalculator::addSTypeParamsToLayoutCall( 2349 2340 ast::UntypedExpr * layoutCall, 2350 2341 const ast::vector<ast::Type> & otypeParams ) {
Note: See TracChangeset
for help on using the changeset viewer.