Changes in src/GenPoly/Box.cc [fea3faa:2a7b3ca]
- File:
-
- 1 edited
-
src/GenPoly/Box.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
rfea3faa r2a7b3ca 202 202 }; 203 203 204 /// Replaces initialization of polymorphic values with alloca, declaration of dtype/ftype with appropriate void expression, sizeof expressions of polymorphic types with the proper variable, and strips fields from generic struct declarations.204 /// Replaces initialization of polymorphic values with alloca, declaration of dtype/ftype with appropriate void expression, and sizeof expressions of polymorphic types with the proper variable 205 205 class Pass3 final : public PolyMutator { 206 206 public: … … 210 210 using PolyMutator::mutate; 211 211 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override; 212 virtual Declaration *mutate( StructDecl *structDecl ) override;213 virtual Declaration *mutate( UnionDecl *unionDecl ) override;214 212 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override; 215 213 virtual TypedefDecl *mutate( TypedefDecl *objectDecl ) override; … … 506 504 DeclarationWithType *Pass1::mutate( FunctionDecl *functionDecl ) { 507 505 if ( functionDecl->get_statements() ) { // empty routine body ? 506 // std::cerr << "mutating function: " << functionDecl->get_mangleName() << std::endl; 508 507 doBeginScope(); 509 508 scopeTyVars.beginScope(); … … 550 549 retval = oldRetval; 551 550 doEndScope(); 551 // std::cerr << "end function: " << functionDecl->get_mangleName() << std::endl; 552 552 } // if 553 553 return functionDecl; … … 1118 1118 1119 1119 Expression *Pass1::mutate( ApplicationExpr *appExpr ) { 1120 // std::cerr << "mutate appExpr: " ;1120 // std::cerr << "mutate appExpr: " << InitTweak::getFunctionName( appExpr ) << std::endl; 1121 1121 // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) { 1122 1122 // std::cerr << i->first << " "; … … 1143 1143 ReferenceToType *dynRetType = isDynRet( function, exprTyVars ); 1144 1144 1145 // std::cerr << function << std::endl; 1146 // std::cerr << "scopeTyVars: "; 1147 // printTyVarMap( std::cerr, scopeTyVars ); 1148 // std::cerr << "exprTyVars: "; 1149 // printTyVarMap( std::cerr, exprTyVars ); 1150 // std::cerr << "env: " << *env << std::endl; 1151 // std::cerr << needsAdapter( function, scopeTyVars ) << ! needsAdapter( function, exprTyVars) << std::endl; 1152 1145 1153 // NOTE: addDynRetParam needs to know the actual (generated) return type so it can make a temp variable, so pass the result type from the appExpr 1146 1154 // passTypeVars needs to know the program-text return type (i.e. the distinction between _conc_T30 and T3(int)) 1147 1155 // concRetType may not be a good name in one or both of these places. A more appropriate name change is welcome. 1148 1156 if ( dynRetType ) { 1157 // std::cerr << "dynRetType: " << dynRetType << std::endl; 1149 1158 Type *concRetType = appExpr->get_result()->isVoid() ? nullptr : appExpr->get_result(); 1150 1159 ret = addDynRetParam( appExpr, concRetType, arg ); // xxx - used to use dynRetType instead of concRetType … … 1859 1868 } 1860 1869 1861 /// Strips the members from a generic aggregate1862 void stripGenericMembers(AggregateDecl* decl) {1863 if ( ! decl->get_parameters().empty() ) decl->get_members().clear();1864 }1865 1866 Declaration *Pass3::mutate( StructDecl *structDecl ) {1867 stripGenericMembers( structDecl );1868 return structDecl;1869 }1870 1871 Declaration *Pass3::mutate( UnionDecl *unionDecl ) {1872 stripGenericMembers( unionDecl );1873 return unionDecl;1874 }1875 1876 1870 TypeDecl * Pass3::mutate( TypeDecl *typeDecl ) { 1877 1871 // Initializer *init = 0;
Note:
See TracChangeset
for help on using the changeset viewer.