Changeset 4604bf5


Ignore:
Timestamp:
Oct 12, 2023, 10:35:47 AM (14 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
02c5880
Parents:
cf3da24
Message:

Clean-up of some names and comments. Removed some TODO comments which are too old to do anything with.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/BoxNew.cpp

    rcf3da24 r4604bf5  
    9494
    9595/// Adds parameters for otype size and alignment to a function type.
    96 void addOTypeParams(
     96void addSTypeParams(
    9797                ast::FunctionDecl * decl,
    9898                ast::vector<ast::TypeDecl> const & sizedParams ) {
     
    246246        ast::ObjectDecl const * offsetofParam = layout.offsetofParam;
    247247        assert( nullptr != layout.offsetofParam );
    248         addOTypeParams( layoutDecl, sizedParams );
     248        addSTypeParams( layoutDecl, sizedParams );
    249249
    250250        // Calculate structure layout in function body.
     
    320320        ast::ObjectDecl const * alignofParam = layout.alignofParam;
    321321        assert( nullptr == layout.offsetofParam );
    322         addOTypeParams( layoutDecl, sizedParams );
     322        addSTypeParams( layoutDecl, sizedParams );
    323323
    324324        // Calculate union layout in function body.
     
    641641        // the variable can be reused as a parameter to the call rather than
    642642        // 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.
    647645        // Essentially, looking for pattern:
    648646        // (x=f(...), x)
     
    689687        // the distinction between _conc_T30 and T3(int)) concRetType may not be
    690688        // a good name in one or both of these places.
    691         // TODO A more appropriate name change is welcome.
    692689        if ( dynRetType ) {
    693690                ast::Type const * result = mutExpr->result;
     
    698695        } else if ( needsAdapter( function, scopeTypeVars )
    699696                        && !needsAdapter( function, exprTypeVars ) ) {
    700                 // TODO:
    701                 // The !needsAdapter check may be incorrect. It seems there is some
    702                 // situation where an adapter is applied where it shouldn't be,
    703                 // and this fixes it for some case. More investigation is needed.
    704 
    705697                // Change the application so it calls the adapter rather than the
    706698                // passed function.
     
    17741766        /// Adds type parameters to the layout call; will generate the
    17751767        /// appropriate parameters if needed.
    1776         void addOTypeParamsToLayoutCall(
     1768        void addSTypeParamsToLayoutCall(
    17771769                ast::UntypedExpr * layoutCall,
    17781770                const ast::vector<ast::Type> & otypeParams );
     
    20142006                ast::MemberExpr const * expr ) {
    20152007        // Only mutate member expressions for polymorphic types.
    2016         int typeDepth;
    20172008        ast::Type const * objectType = hasPolyBase(
    2018                 expr->aggregate->result, scopeTypeVars, &typeDepth
     2009                expr->aggregate->result, scopeTypeVars
    20192010        );
    20202011        if ( !objectType ) return expr;
     
    20942085        }
    20952086        // MemberExpr was converted to pointer + offset; and it is not valid C to
    2096         // take the address of an addition, so stript the address-of.
     2087        // take the address of an addition, so strip away the address-of.
    20972088        // It also preserves the env value.
    20982089        return ast::mutate_field( expr->arg.get(), &ast::Expr::env, expr->env );
     
    22952286                                } );
    22962287
    2297                         addOTypeParamsToLayoutCall( layoutCall, sizedParams );
     2288                        addSTypeParamsToLayoutCall( layoutCall, sizedParams );
    22982289
    22992290                        stmtsToAddBefore.emplace_back(
     
    23362327                        } );
    23372328
    2338                 addOTypeParamsToLayoutCall( layoutCall, sizedParams );
     2329                addSTypeParamsToLayoutCall( layoutCall, sizedParams );
    23392330
    23402331                stmtsToAddBefore.emplace_back(
     
    23462337}
    23472338
    2348 void PolyGenericCalculator::addOTypeParamsToLayoutCall(
     2339void PolyGenericCalculator::addSTypeParamsToLayoutCall(
    23492340                ast::UntypedExpr * layoutCall,
    23502341                const ast::vector<ast::Type> & otypeParams ) {
Note: See TracChangeset for help on using the changeset viewer.