Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    rfea3faa r2a7b3ca  
    202202                };
    203203
    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
    205205                class Pass3 final : public PolyMutator {
    206206                  public:
     
    210210                        using PolyMutator::mutate;
    211211                        virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ) override;
    212                         virtual Declaration *mutate( StructDecl *structDecl ) override;
    213                         virtual Declaration *mutate( UnionDecl *unionDecl ) override;
    214212                        virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) override;
    215213                        virtual TypedefDecl *mutate( TypedefDecl *objectDecl ) override;
     
    506504                DeclarationWithType *Pass1::mutate( FunctionDecl *functionDecl ) {
    507505                        if ( functionDecl->get_statements() ) {         // empty routine body ?
     506                                // std::cerr << "mutating function: " << functionDecl->get_mangleName() << std::endl;
    508507                                doBeginScope();
    509508                                scopeTyVars.beginScope();
     
    550549                                retval = oldRetval;
    551550                                doEndScope();
     551                                // std::cerr << "end function: " << functionDecl->get_mangleName() << std::endl;
    552552                        } // if
    553553                        return functionDecl;
     
    11181118
    11191119                Expression *Pass1::mutate( ApplicationExpr *appExpr ) {
    1120                         // std::cerr << "mutate appExpr: ";
     1120                        // std::cerr << "mutate appExpr: " << InitTweak::getFunctionName( appExpr ) << std::endl;
    11211121                        // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) {
    11221122                        //      std::cerr << i->first << " ";
     
    11431143                        ReferenceToType *dynRetType = isDynRet( function, exprTyVars );
    11441144
     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
    11451153                        // 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
    11461154                        // passTypeVars needs to know the program-text return type (i.e. the distinction between _conc_T30 and T3(int))
    11471155                        // concRetType may not be a good name in one or both of these places. A more appropriate name change is welcome.
    11481156                        if ( dynRetType ) {
     1157                                // std::cerr << "dynRetType: " << dynRetType << std::endl;
    11491158                                Type *concRetType = appExpr->get_result()->isVoid() ? nullptr : appExpr->get_result();
    11501159                                ret = addDynRetParam( appExpr, concRetType, arg ); // xxx - used to use dynRetType instead of concRetType
     
    18591868                }
    18601869
    1861                 /// Strips the members from a generic aggregate
    1862                 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 
    18761870                TypeDecl * Pass3::mutate( TypeDecl *typeDecl ) {
    18771871//   Initializer *init = 0;
Note: See TracChangeset for help on using the changeset viewer.