Changeset 8c0d801 for src/InitTweak


Ignore:
Timestamp:
Jun 6, 2019, 3:40:56 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
1a4323e
Parents:
b7d92b96 (diff), 546e712 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    rb7d92b96 r8c0d801  
    262262                        // unwrap implicit statement wrapper
    263263                        Statement * dtor = input;
    264                         if ( ImplicitCtorDtorStmt * implicit = dynamic_cast< ImplicitCtorDtorStmt * >( input ) ) {
    265                                 // dtor = implicit->callStmt;
    266                                 // implicit->callStmt = nullptr;
    267                         }
    268264                        assert( dtor );
    269265                        std::list< Expression * > matches;
     
    291287                        // wraps the more complicated code.
    292288                        static UniqueName dtorNamer( "__cleanup_dtor" );
    293                         FunctionDecl * dtorFunc = FunctionDecl::newFunction( dtorNamer.newName(), SymTab::genDefaultType( objDecl->type->stripReferences(), false ), new CompoundStmt() );
     289                        std::string name = dtorNamer.newName();
     290                        if(name == "__cleanup_dtor8") {
     291                                objDecl->print(std::cerr);
     292                                std::cerr << "-----" << std::endl;
     293                                dtor->print(std::cerr);
     294                        }
     295                        FunctionDecl * dtorFunc = FunctionDecl::newFunction( name, SymTab::genDefaultType( objDecl->type->stripReferences(), false ), new CompoundStmt() );
    294296                        stmtsToAdd.push_back( new DeclStmt( dtorFunc ) );
    295297
     
    304306                                replacement = new CastExpr( replacement, base->clone() );
    305307                        }
    306                         DeclReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } );
     308                        size_t replaced = DeclReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } );
     309                        if(replaced == 0) {
     310                                std::cerr << "Failed to replace " << objDecl << std::endl;
     311                                abort();
     312                        }
    307313                        dtorFunc->statements->push_back( strict_dynamic_cast<Statement *>( dtor ) );
    308314
Note: See TracChangeset for help on using the changeset viewer.