Ignore:
Timestamp:
Feb 23, 2024, 3:59:35 PM (5 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
1761046
Parents:
d06273c
Message:

Clean-up of GenImplicitCall? module. Changing the return type for consistency spilled out into some other files, but that should also saves some operations. The other big one is the template instances were reduced to one and then the templates removed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Validate/Autogen.cpp

    rd06273c r4e2f1b2  
    134134        /// (constructor call, destructor call, assignment call)
    135135        // This is managed because it uses another helper that returns a ast::ptr.
    136         ast::ptr<ast::Stmt> makeMemberOp(
     136        const ast::Stmt * makeMemberOp(
    137137                const CodeLocation& location,
    138138                const ast::ObjectDecl * dstParam, const ast::Expr * src,
     
    524524}
    525525
    526 ast::ptr<ast::Stmt> StructFuncGenerator::makeMemberOp(
     526const ast::Stmt * StructFuncGenerator::makeMemberOp(
    527527                const CodeLocation& location, const ast::ObjectDecl * dstParam,
    528528                const ast::Expr * src, const ast::ObjectDecl * field,
     
    539539                )
    540540        );
    541         auto stmt = genImplicitCall(
     541        const ast::Stmt * stmt = genImplicitCall(
    542542                srcParam, dstSelect, location, func->name,
    543543                field, direction
     
    597597                        location, field, new ast::VariableExpr( location, srcParam )
    598598                ) : nullptr;
    599                 ast::ptr<ast::Stmt> stmt =
     599                const ast::Stmt * stmt =
    600600                        makeMemberOp( location, dstParam, srcSelect, field, func, direction );
    601601
    602602                if ( nullptr != stmt ) {
    603                         stmts->kids.push_back( stmt );
     603                        stmts->kids.emplace_back( stmt );
    604604                }
    605605        }
     
    622622        for ( auto param = params.begin() + 1 ; current != end ; ++current ) {
    623623                const ast::ptr<ast::Decl> & member = *current;
    624                 ast::ptr<ast::Stmt> stmt = nullptr;
     624                const ast::Stmt * stmt = nullptr;
    625625                auto field = member.as<ast::ObjectDecl>();
    626626                // Not sure why it could be null.
     
    640640
    641641                if ( nullptr != stmt ) {
    642                         stmts->kids.push_back( stmt );
     642                        stmts->kids.emplace_back( stmt );
    643643                }
    644644        }
Note: See TracChangeset for help on using the changeset viewer.