Changeset 546e712 for src/InitTweak/FixInit.cc
- Timestamp:
- Jun 6, 2019, 3:01:46 PM (5 years ago)
- 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:
- 8c0d801, f46bfd2f
- Parents:
- 2a54479
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
r2a54479 r546e712 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 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() ); 294 296 stmtsToAdd.push_back( new DeclStmt( dtorFunc ) ); 295 297 … … 304 306 replacement = new CastExpr( replacement, base->clone() ); 305 307 } 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 } 307 313 dtorFunc->statements->push_back( strict_dynamic_cast<Statement *>( dtor ) ); 308 314
Note: See TracChangeset
for help on using the changeset viewer.