Changes in src/InitTweak/FixInitNew.cpp [7d651a66:6a036eb]
- File:
-
- 1 edited
-
src/InitTweak/FixInitNew.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInitNew.cpp
r7d651a66 r6a036eb 179 179 /// expand each object declaration to use its constructor after it is declared. 180 180 struct FixInit : public ast::WithStmtsToAdd<> { 181 static void fixInitializers( ast::TranslationUnit&translationUnit );181 static void fixInitializers( std::list< ast::ptr<ast::Decl> > &translationUnit ); 182 182 183 183 const ast::DeclWithType * postvisit( const ast::ObjectDecl *objDecl ); … … 225 225 } // namespace 226 226 227 void fix( ast::TranslationUnit& translationUnit, bool inLibrary ) {227 void fix( std::list< ast::ptr<ast::Decl> > & translationUnit, bool inLibrary ) { 228 228 ast::Pass<SelfAssignChecker>::run( translationUnit ); 229 229 … … 308 308 } 309 309 310 void FixInit::fixInitializers( ast::TranslationUnit& translationUnit ) {310 void FixInit::fixInitializers( std::list< ast::ptr<ast::Decl> > & translationUnit ) { 311 311 ast::Pass<FixInit> fixer; 312 312 … … 314 314 // can't use DeclMutator, because sometimes need to insert IfStmt, etc. 315 315 SemanticErrorException errors; 316 for ( auto i = translationUnit. decls.begin(); i != translationUnit.decls.end(); ++i ) {316 for ( auto i = translationUnit.begin(); i != translationUnit.end(); ++i ) { 317 317 try { 318 318 // maybeAccept( *i, fixer ); translationUnit should never contain null 319 319 *i = (*i)->accept(fixer); 320 translationUnit. decls.splice( i, fixer.core.staticDtorDecls );320 translationUnit.splice( i, fixer.core.staticDtorDecls ); 321 321 } catch( SemanticErrorException &e ) { 322 322 errors.append( e ); … … 864 864 if ( const ast::Stmt * ctor = ctorInit->ctor ) { 865 865 if ( objDecl->storage.is_static ) { 866 addDataSectionAttribute(objDecl);867 866 // originally wanted to take advantage of gcc nested functions, but 868 867 // we get memory errors with this approach. To remedy this, the static … … 948 947 objDecl->name = objDecl->name + staticNamer.newName(); 949 948 objDecl->mangleName = Mangle::mangle( objDecl ); 950 objDecl->init = nullptr;951 949 952 950 // xxx - temporary hack: need to return a declaration, but want to hoist the current object out of this scope
Note:
See TracChangeset
for help on using the changeset viewer.