Changes in src/SymTab/Autogen.cc [c0aa336:207c7e1d]
- File:
-
- 1 edited
-
src/SymTab/Autogen.cc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
rc0aa336 r207c7e1d 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Feb 2 18:04:40 201713 // Update Count : 1112 // Last Modified On : Tue Jul 12 17:47:17 2016 13 // Update Count : 2 14 14 // 15 15 … … 43 43 44 44 class AutogenerateRoutines final : public Visitor { 45 template< typename Visitor >46 friend void acceptAndAdd( std::list< Declaration * > &translationUnit, Visitor &visitor );47 template< typename Visitor >48 friend void addVisitStatementList( std::list< Statement* > &stmts, Visitor &visitor );49 45 public: 50 46 std::list< Declaration * > &get_declsToAdd() { return declsToAdd; } … … 71 67 template< typename StmtClass > void visitStatement( StmtClass *stmt ); 72 68 73 std::list< Declaration * > declsToAdd , declsToAddAfter;69 std::list< Declaration * > declsToAdd; 74 70 std::set< std::string > structsDone; 75 71 unsigned int functionNesting = 0; // current level of nested functions … … 102 98 void autogenerateRoutines( std::list< Declaration * > &translationUnit ) { 103 99 AutogenerateRoutines generator; 104 acceptAndAdd( translationUnit, generator );100 acceptAndAdd( translationUnit, generator, false ); 105 101 106 102 // needs to be done separately because AutogenerateRoutines skips types that appear as function arguments, etc. … … 571 567 EnumInstType *enumInst = new EnumInstType( Type::Qualifiers(), enumDecl->get_name() ); 572 568 // enumInst->set_baseEnum( enumDecl ); 573 makeEnumFunctions( enumDecl, enumInst, functionNesting, declsToAddAfter ); 569 // declsToAdd.push_back( 570 makeEnumFunctions( enumDecl, enumInst, functionNesting, declsToAdd ); 574 571 } 575 572 } … … 584 581 } 585 582 structInst.set_baseStruct( structDecl ); 586 makeStructFunctions( structDecl, &structInst, functionNesting, declsToAdd After, data );583 makeStructFunctions( structDecl, &structInst, functionNesting, declsToAdd, data ); 587 584 structsDone.insert( structDecl->get_name() ); 588 585 } // if … … 596 593 unionInst.get_parameters().push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), typeDecl ) ) ); 597 594 } 598 makeUnionFunctions( unionDecl, &unionInst, functionNesting, declsToAdd After);595 makeUnionFunctions( unionDecl, &unionInst, functionNesting, declsToAdd ); 599 596 } // if 600 597 } … … 621 618 FunctionDecl *func = genFunc( "?=?", type, functionNesting ); 622 619 func->get_statements()->get_kids() = stmts; 623 declsToAdd After.push_back( func );620 declsToAdd.push_back( func ); 624 621 } 625 622 … … 766 763 } 767 764 } // SymTab 768 769 // Local Variables: //770 // tab-width: 4 //771 // mode: c++ //772 // compile-command: "make install" //773 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.