Changeset 37273c8 for src/InitTweak


Ignore:
Timestamp:
Nov 28, 2023, 3:01:52 PM (7 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
ab9c1b3
Parents:
4bc4b4c
Message:

Removed the old-ast-compatable FunctionDecl? constructor. However, enough cases pass nothing polymorphic along some of the uses of the constructor now go to a new monomorphic function constructor.

Location:
src/InitTweak
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixGlobalInit.cc

    r4bc4b4c r37273c8  
    8484                if (inLibrary) ctorParams.emplace_back(ast::ConstantExpr::from_int(location, 200));
    8585                auto initFunction = new ast::FunctionDecl(location,
    86                         "__global_init__", {}, {}, {},
     86                        "__global_init__", {}, {}, {}, {},
    8787                        new ast::CompoundStmt(location, std::move(fixer.core.initStmts)),
    8888                        ast::Storage::Static, ast::Linkage::C,
     
    9696                if (inLibrary) dtorParams.emplace_back(ast::ConstantExpr::from_int(location, 200));
    9797                auto destroyFunction = new ast::FunctionDecl( location,
    98                         "__global_destroy__", {}, {}, {},
     98                        "__global_destroy__", {}, {}, {}, {},
    9999                        new ast::CompoundStmt(location, std::move(fixer.core.destroyStmts)),
    100100                        ast::Storage::Static, ast::Linkage::C,
  • src/InitTweak/FixInitNew.cpp

    r4bc4b4c r37273c8  
    7474                fname,
    7575                std::move(typeParams),
     76                {},
    7677                {dstParam},
    7778                {},
     
    899900
    900901                                        // void __objName_dtor_atexitN(...) {...}
    901                                         ast::FunctionDecl * dtorCaller = new ast::FunctionDecl(loc, objDecl->mangleName + dtorCallerNamer.newName(), {}, {}, {}, new ast::CompoundStmt(loc, {dtor}), ast::Storage::Static, ast::Linkage::C );
     902                                        ast::FunctionDecl * dtorCaller = new ast::FunctionDecl(loc, objDecl->mangleName + dtorCallerNamer.newName(), {}, {}, {}, {}, new ast::CompoundStmt(loc, {dtor}), ast::Storage::Static, ast::Linkage::C );
    902903                                        dtorCaller->fixUniqueId();
    903904                                        // dtorCaller->stmts->push_back( dtor );
  • src/InitTweak/InitTweak.cc

    r4bc4b4c r37273c8  
    342342        if (!assign) {
    343343                auto td = new ast::TypeDecl(CodeLocation(), "T", {}, nullptr, ast::TypeDecl::Dtype, true);
    344                 assign = new ast::FunctionDecl(CodeLocation(), "?=?", {td},
     344                assign = new ast::FunctionDecl(CodeLocation(), "?=?", {td}, {},
    345345                { new ast::ObjectDecl(CodeLocation(), "_dst", new ast::ReferenceType(new ast::TypeInstType("T", td))),
    346346                  new ast::ObjectDecl(CodeLocation(), "_src", new ast::TypeInstType("T", td))},
Note: See TracChangeset for help on using the changeset viewer.