Changes in src/InitTweak/FixInit.cc [4741dfe:f46bfd2f]
- File:
-
- 1 edited
-
src/InitTweak/FixInit.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
r4741dfe rf46bfd2f 262 262 // unwrap implicit statement wrapper 263 263 Statement * dtor = input; 264 if ( ImplicitCtorDtorStmt * implicit = dynamic_cast< ImplicitCtorDtorStmt * >( input ) ) {265 // dtor = implicit->callStmt;266 // implicit->callStmt = nullptr;267 }268 264 assert( dtor ); 269 265 std::list< Expression * > matches; … … 291 287 // wraps the more complicated code. 292 288 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 FunctionDecl * dtorFunc = FunctionDecl::newFunction( name, SymTab::genDefaultType( objDecl->type->stripReferences(), false ), new CompoundStmt() ); 294 291 stmtsToAdd.push_back( new DeclStmt( dtorFunc ) ); 295 292 … … 304 301 replacement = new CastExpr( replacement, base->clone() ); 305 302 } 306 DeclReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } ); 303 size_t replaced = DeclReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } ); 304 if(replaced == 0) { 305 objDecl->print(std::cerr); 306 std::cerr << "-----" << std::endl; 307 dtor->print(std::cerr); 308 std::cerr << "Failed to replace " << objDecl << std::endl; 309 abort(); 310 } 307 311 dtorFunc->statements->push_back( strict_dynamic_cast<Statement *>( dtor ) ); 308 312
Note:
See TracChangeset
for help on using the changeset viewer.