Changeset ed1065c


Ignore:
Timestamp:
Nov 26, 2015, 6:09:19 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
b0b958a, f2b2029
Parents:
7cd23d5
Message:

fixed adapter suffix naming scheme - adding the correct file this time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    r7cd23d5 red1065c  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Rob Schluntz
    12 // Last Modified On : Tue Nov 24 15:59:33 2015
    13 // Update Count     : 169
     12// Last Modified On : Thu Nov 26 17:01:55 2015
     13// Update Count     : 191
    1414//
    1515
     
    145145                        std::stringstream name;
    146146
     147                        // NOTE: this function previously used isPolyObj, which failed to produce
     148                        // the correct thing in some situations. It's not clear to me why this wasn't working.
     149
    147150                        // if the return type or a parameter type involved polymorphic types, then the adapter will need
    148151                        // to take those polymorphic types as pointers. Therefore, there can be two different functions
    149152                        // with the same mangled name, so we need to further mangle the names.
    150                         if ( isPolyRet( function, tyVars ) ) {
    151                                 name << "P";
    152                         } else {
    153                                 name << "M";
     153                        for ( std::list< DeclarationWithType *>::iterator retval = function->get_returnVals().begin(); retval != function->get_returnVals().end(); ++retval ) {
     154                                if ( isPolyVal( (*retval)->get_type(), tyVars ) ) {
     155                                        name << "P";
     156                                } else {
     157                                        name << "M";
     158                                }
    154159                        }
    155160                        name << "_";
    156161                        std::list< DeclarationWithType *> &paramList = function->get_parameters();
    157162                        for ( std::list< DeclarationWithType *>::iterator arg = paramList.begin(); arg != paramList.end(); ++arg ) {
    158                                 if ( isPolyObj( (*arg)->get_type(), tyVars ) ) {
     163                                if ( isPolyVal( (*arg)->get_type(), tyVars ) ) {
    159164                                        name << "P";
    160165                                } else {
     
    197202
    198203                void Pass1::findAssignOps( const std::list< TypeDecl *> &forall ) {
    199                         assignOps.clear();
     204                        // what if a nested function uses an assignment operator?
     205                        // assignOps.clear();
    200206                        for ( std::list< TypeDecl *>::const_iterator i = forall.begin(); i != forall.end(); ++i ) {
    201207                                for ( std::list< DeclarationWithType *>::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) {
     
    212218                                doBeginScope();
    213219                                TyVarMap oldtyVars = scopeTyVars;
     220                                std::map< std::string, DeclarationWithType *> oldassignOps = assignOps;
    214221                                DeclarationWithType *oldRetval = retval;
    215222                                bool oldUseRetval = useRetval;
     
    254261 
    255262                                scopeTyVars = oldtyVars;
     263                                assignOps = oldassignOps;
    256264                                // std::cerr << "end FunctionDecl: ";
    257265                                // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) {
Note: See TracChangeset for help on using the changeset viewer.