Changeset f9feab8


Ignore:
Timestamp:
Dec 5, 2017, 3:06:31 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
arm-eh, cleanup-dtors, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr
Children:
90152a4
Parents:
c13e8dc8
Message:

Remove labels from statement constructors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    rc13e8dc8 rf9feab8  
    679679                        // wraps the more complicated code.
    680680                        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 ) );
    683683
    684684                        // the original code contains uses of objDecl - replace them with the newly generated 'this' parameter.
     
    10561056
    10571057                                                                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 ) );
    10591059                                                                destructor->attributes.push_back( new Attribute( "cleanup", { new VariableExpr( dtorStructDestroy ) } ) );
    10601060
Note: See TracChangeset for help on using the changeset viewer.