Changeset ed1065c
- Timestamp:
- Nov 26, 2015, 6:09:19 PM (9 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r7cd23d5 red1065c 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : T ue Nov 24 15:59:33201513 // Update Count : 1 6912 // Last Modified On : Thu Nov 26 17:01:55 2015 13 // Update Count : 191 14 14 // 15 15 … … 145 145 std::stringstream name; 146 146 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 147 150 // if the return type or a parameter type involved polymorphic types, then the adapter will need 148 151 // to take those polymorphic types as pointers. Therefore, there can be two different functions 149 152 // 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 } 154 159 } 155 160 name << "_"; 156 161 std::list< DeclarationWithType *> ¶mList = function->get_parameters(); 157 162 for ( std::list< DeclarationWithType *>::iterator arg = paramList.begin(); arg != paramList.end(); ++arg ) { 158 if ( isPoly Obj( (*arg)->get_type(), tyVars ) ) {163 if ( isPolyVal( (*arg)->get_type(), tyVars ) ) { 159 164 name << "P"; 160 165 } else { … … 197 202 198 203 void Pass1::findAssignOps( const std::list< TypeDecl *> &forall ) { 199 assignOps.clear(); 204 // what if a nested function uses an assignment operator? 205 // assignOps.clear(); 200 206 for ( std::list< TypeDecl *>::const_iterator i = forall.begin(); i != forall.end(); ++i ) { 201 207 for ( std::list< DeclarationWithType *>::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) { … … 212 218 doBeginScope(); 213 219 TyVarMap oldtyVars = scopeTyVars; 220 std::map< std::string, DeclarationWithType *> oldassignOps = assignOps; 214 221 DeclarationWithType *oldRetval = retval; 215 222 bool oldUseRetval = useRetval; … … 254 261 255 262 scopeTyVars = oldtyVars; 263 assignOps = oldassignOps; 256 264 // std::cerr << "end FunctionDecl: "; 257 265 // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) {
Note: See TracChangeset
for help on using the changeset viewer.