Ignore:
Timestamp:
Mar 30, 2017, 5:21:14 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
077810d, 72dc82a
Parents:
fbcde64 (diff), a4dd728 (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 plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    rfbcde64 r936a287  
    738738                                                stmtsToAddAfter.push_back( ifStmt );
    739739
    740                                                 if ( ctorInit->get_dtor() ) {
     740                                                Statement * dtor = ctorInit->get_dtor();
     741                                                objDecl->set_init( NULL );
     742                                                ctorInit->set_ctor( NULL );
     743                                                ctorInit->set_dtor( nullptr );
     744                                                if ( dtor ) {
    741745                                                        // if the object has a non-trivial destructor, have to
    742746                                                        // hoist it and the object into the global space and
    743747                                                        // call the destructor function with atexit.
    744748
    745                                                         Statement * dtorStmt = ctorInit->get_dtor()->clone();
     749                                                        Statement * dtorStmt = dtor->clone();
    746750
    747751                                                        // void __objName_dtor_atexitN(...) {...}
     
    772776                                                        objDecl->set_mangleName( SymTab::Mangler::mangle( objDecl ) );
    773777
    774                                                         objDecl->set_init( NULL );
    775                                                         ctorInit->set_ctor( NULL );
    776                                                         delete ctorInit;
    777 
    778778                                                        // xxx - temporary hack: need to return a declaration, but want to hoist the current object out of this scope
    779779                                                        // create a new object which is never used
    780780                                                        static UniqueName dummyNamer( "_dummy" );
    781781                                                        ObjectDecl * dummy = new ObjectDecl( dummyNamer.newName(), Type::StorageClasses( Type::Static ), LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), 0, std::list< Attribute * >{ new Attribute("unused") } );
     782                                                        delete ctorInit;
    782783                                                        return dummy;
    783784                                                }
Note: See TracChangeset for help on using the changeset viewer.