Changeset f9feab8
- Timestamp:
- Dec 5, 2017, 3:06:31 PM (5 years ago)
- Branches:
- ADT, arm-eh, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 90152a4
- Parents:
- c13e8dc8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
rc13e8dc8 rf9feab8 679 679 // wraps the more complicated code. 680 680 static UniqueName dtorNamer( "__cleanup_dtor" ); 681 FunctionDecl * dtorFunc = FunctionDecl::newFunction( dtorNamer.newName(), SymTab::genDefaultType( objDecl->type->stripReferences(), false ), new CompoundStmt( noLabels) );682 stmtsToAdd.push_back( new DeclStmt( noLabels,dtorFunc ) );681 FunctionDecl * dtorFunc = FunctionDecl::newFunction( dtorNamer.newName(), SymTab::genDefaultType( objDecl->type->stripReferences(), false ), new CompoundStmt() ); 682 stmtsToAdd.push_back( new DeclStmt( dtorFunc ) ); 683 683 684 684 // the original code contains uses of objDecl - replace them with the newly generated 'this' parameter. … … 1056 1056 1057 1057 ObjectDecl * destructor = ObjectDecl::newObject( memberDtorNamer.newName(), new StructInstType( Type::Qualifiers(), dtorStruct ), new ListInit( { new SingleInit( thisExpr ), new SingleInit( new CastExpr( dtorExpr, dtorType ) ) } ) ); 1058 function->statements->push_front( new DeclStmt( noLabels,destructor ) );1058 function->statements->push_front( new DeclStmt( destructor ) ); 1059 1059 destructor->attributes.push_back( new Attribute( "cleanup", { new VariableExpr( dtorStructDestroy ) } ) ); 1060 1060
Note: See TracChangeset
for help on using the changeset viewer.