Ignore:
Timestamp:
Oct 19, 2017, 2:20:53 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
72f85de
Parents:
6840e7c
Message:

Fix cleanup function generation to always generate monomorphic functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    r6840e7c r837ce06  
    653653                        // wraps the more complicated code.
    654654                        static UniqueName dtorNamer( "__cleanup_dtor" );
    655                         FunctionDecl * dtorFunc = FunctionDecl::newFunction( dtorNamer.newName(), SymTab::genDefaultType( objDecl->type ), new CompoundStmt( noLabels ) );
     655                        FunctionDecl * dtorFunc = FunctionDecl::newFunction( dtorNamer.newName(), SymTab::genDefaultType( objDecl->type, false ), new CompoundStmt( noLabels ) );
    656656                        stmtsToAddBefore.push_back( new DeclStmt( noLabels, dtorFunc ) );
    657657
    658658                        // the original code contains uses of objDecl - replace them with the newly generated 'this' parameter.
    659                         ObjectDecl * thisParam = getThisParam( dtorFunc->type );
     659                        ObjectDecl * thisParam = getParamThis( dtorFunc->type );
    660660                        VarExprReplacer::replace( dtor, { std::make_pair( objDecl, thisParam ) } );
    661661                        dtorFunc->statements->push_back( dtor );
Note: See TracChangeset for help on using the changeset viewer.