Changeset 0ddb713 for src/GenPoly
- Timestamp:
- Dec 2, 2015, 11:58:59 AM (10 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, stuck-waitfor-destruct, with_gc
- Children:
- 9cb8e88d
- Parents:
- 9ed3237 (diff), f2b2029 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/GenPoly
- Files:
-
- 2 added
- 5 edited
-
Box.cc (modified) (19 diffs)
-
Box.h (modified) (1 diff)
-
GenPoly.cc (modified) (2 diffs)
-
GenPoly.h (modified) (2 diffs)
-
InstantiateGeneric.cc (added)
-
InstantiateGeneric.h (added)
-
module.mk (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r9ed3237 r0ddb713 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Aug 11 16:22:35201513 // Update Count : 8912 // Last Modified On : Wed Dec 02 11:52:37 2015 13 // Update Count : 201 14 14 // 15 15 … … 47 47 namespace { 48 48 const std::list<Label> noLabels; 49 50 FunctionType *makeAdapterType( FunctionType *adaptee, const TyVarMap &tyVars ); 49 51 50 52 class Pass1 : public PolyMutator { … … 78 80 ObjectDecl *makeTemporary( Type *type ); 79 81 80 typedef std::map< std::string, FunctionDecl*> AdapterMap;82 typedef std::map< std::string, DeclarationWithType *> AdapterMap; 81 83 std::map< std::string, DeclarationWithType *> assignOps; 82 84 std::stack< AdapterMap > adapters; … … 140 142 141 143 namespace { 144 std::string makePolyMonoSuffix( FunctionType * function, const TyVarMap &tyVars ) { 145 std::stringstream name; 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 150 // if the return type or a parameter type involved polymorphic types, then the adapter will need 151 // to take those polymorphic types as pointers. Therefore, there can be two different functions 152 // with the same mangled name, so we need to further mangle the names. 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 } 159 } 160 name << "_"; 161 std::list< DeclarationWithType *> ¶mList = function->get_parameters(); 162 for ( std::list< DeclarationWithType *>::iterator arg = paramList.begin(); arg != paramList.end(); ++arg ) { 163 if ( isPolyVal( (*arg)->get_type(), tyVars ) ) { 164 name << "P"; 165 } else { 166 name << "M"; 167 } 168 } // for 169 return name.str(); 170 } 171 172 std::string mangleAdapterName( FunctionType * function, const TyVarMap &tyVars ) { 173 return SymTab::Mangler::mangle( function ) + makePolyMonoSuffix( function, tyVars ); 174 } 175 142 176 std::string makeAdapterName( const std::string &mangleName ) { 143 177 return "_adapter" + mangleName; 144 178 } 145 179 146 bool isPolyRet( FunctionType *function, std::string &name, const TyVarMap &otherTyVars ) {147 bool doTransform = false;148 if ( ! function->get_returnVals().empty() ) {149 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType *>( function->get_returnVals().front()->get_type() ) ) {150 151 // figure out if the return type is specified by a type parameter152 for ( std::list< TypeDecl *>::const_iterator tyVar = function->get_forall().begin(); tyVar != function->get_forall().end(); ++tyVar ) {153 if ( (*tyVar)->get_name() == typeInst->get_name() ) {154 doTransform = true;155 name = typeInst->get_name();156 break;157 } // if158 } // for159 if ( ! doTransform && otherTyVars.find( typeInst->get_name() ) != otherTyVars.end() ) {160 doTransform = true;161 } // if162 } // if163 } // if164 return doTransform;165 }166 167 bool isPolyRet( FunctionType *function, std::string &name ) {168 TyVarMap dummyTyVars;169 return isPolyRet( function, name, dummyTyVars );170 }171 172 bool isPolyRet( FunctionType *function, const TyVarMap &otherTyVars ) {173 std::string dummyString;174 return isPolyRet( function, dummyString, otherTyVars );175 }176 177 180 Pass1::Pass1() 178 181 : useRetval( false ), tempNamer( "_temp" ) { 179 } 180 182 adapters.push(AdapterMap()); 183 } 184 185 // returns true if the given declaration is: (*?=?)(T *, T) for some T (return not checked, but maybe should be) 181 186 bool checkAssignment( DeclarationWithType *decl, std::string &name ) { 182 187 if ( decl->get_name() == "?=?" ) { … … 198 203 199 204 void Pass1::findAssignOps( const std::list< TypeDecl *> &forall ) { 200 assignOps.clear(); 205 // what if a nested function uses an assignment operator? 206 // assignOps.clear(); 201 207 for ( std::list< TypeDecl *>::const_iterator i = forall.begin(); i != forall.end(); ++i ) { 202 208 for ( std::list< DeclarationWithType *>::const_iterator assert = (*i)->get_assertions().begin(); assert != (*i)->get_assertions().end(); ++assert ) { … … 210 216 211 217 DeclarationWithType *Pass1::mutate( FunctionDecl *functionDecl ) { 212 if ( functionDecl->get_statements() ) { 218 if ( functionDecl->get_statements() ) { // empty routine body ? 219 doBeginScope(); 213 220 TyVarMap oldtyVars = scopeTyVars; 221 std::map< std::string, DeclarationWithType *> oldassignOps = assignOps; 214 222 DeclarationWithType *oldRetval = retval; 215 223 bool oldUseRetval = useRetval; 216 224 225 // process polymorphic return value 217 226 retval = 0; 218 227 std::string typeName; … … 227 236 } // if 228 237 229 scopeTyVars.clear(); 230 /// std::cerr << "clear\n"; 238 FunctionType *functionType = functionDecl->get_functionType(); 231 239 makeTyVarMap( functionDecl->get_functionType(), scopeTyVars ); 232 240 findAssignOps( functionDecl->get_functionType()->get_forall() ); 241 242 std::list< DeclarationWithType *> ¶mList = functionType->get_parameters(); 243 std::list< FunctionType *> functions; 244 for ( std::list< TypeDecl *>::iterator tyVar = functionType->get_forall().begin(); tyVar != functionType->get_forall().end(); ++tyVar ) { 245 for ( std::list< DeclarationWithType *>::iterator assert = (*tyVar)->get_assertions().begin(); assert != (*tyVar)->get_assertions().end(); ++assert ) { 246 findFunction( (*assert)->get_type(), functions, scopeTyVars, needsAdapter ); 247 } // for 248 } // for 249 for ( std::list< DeclarationWithType *>::iterator arg = paramList.begin(); arg != paramList.end(); ++arg ) { 250 findFunction( (*arg)->get_type(), functions, scopeTyVars, needsAdapter ); 251 } // for 252 AdapterMap & adapters = Pass1::adapters.top(); 253 for ( std::list< FunctionType *>::iterator funType = functions.begin(); funType != functions.end(); ++funType ) { 254 std::string mangleName = mangleAdapterName( *funType, scopeTyVars ); 255 if ( adapters.find( mangleName ) == adapters.end() ) { 256 std::string adapterName = makeAdapterName( mangleName ); 257 adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, new ObjectDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) ) ); 258 } // if 259 } // for 260 233 261 functionDecl->set_statements( functionDecl->get_statements()->acceptMutator( *this ) ); 234 262 235 263 scopeTyVars = oldtyVars; 236 /// std::cerr << "end FunctionDecl: "; 237 /// for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) { 238 /// std::cerr << i->first << " "; 239 /// } 240 /// std::cerr << "\n"; 264 assignOps = oldassignOps; 265 // std::cerr << "end FunctionDecl: "; 266 // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) { 267 // std::cerr << i->first << " "; 268 // } 269 // std::cerr << "\n"; 241 270 retval = oldRetval; 242 271 useRetval = oldUseRetval; 243 //doEndScope();272 doEndScope(); 244 273 } // if 245 274 return functionDecl; … … 348 377 ret = addRetParam( appExpr, function, function->get_returnVals().front()->get_type(), arg ); 349 378 } // if 350 std::string mangleName = SymTab::Mangler::mangle( function);379 std::string mangleName = mangleAdapterName( function, tyVars ); 351 380 std::string adapterName = makeAdapterName( mangleName ); 352 381 … … 457 486 /// return new CastExpr( new VariableExpr( param ), arg->get_type()->clone() ); 458 487 /// } else { 459 UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) ); 460 deref->get_args().push_back( new CastExpr( new VariableExpr( param ), new PointerType( Type::Qualifiers(), arg->get_type()->clone() ) ) ); 461 deref->get_results().push_back( arg->get_type()->clone() ); 462 return deref; 488 if ( dynamic_cast<TypeInstType *>(arg->get_type()) == NULL ) { 489 UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) ); 490 deref->get_args().push_back( new CastExpr( new VariableExpr( param ), new PointerType( Type::Qualifiers(), arg->get_type()->clone() ) ) ); 491 deref->get_results().push_back( arg->get_type()->clone() ); 492 return deref; 493 } // if 463 494 /// } 464 495 } // if … … 544 575 } // for 545 576 546 // parameter function types for which an appropriate adapter has been generated. 547 // we cannot use the types after applying substitutions, since two different 548 // parameter types may be unified to the same type 577 // parameter function types for which an appropriate adapter has been generated. we cannot use the types 578 // after applying substitutions, since two different parameter types may be unified to the same type 549 579 std::set< std::string > adaptersDone; 550 580 … … 554 584 std::string mangleName = SymTab::Mangler::mangle( realFunction ); 555 585 556 // only attempt to create an adapter or pass one as a parameter if we haven't 557 // already done so for thispre-substitution parameter function type.586 // only attempt to create an adapter or pass one as a parameter if we haven't already done so for this 587 // pre-substitution parameter function type. 558 588 if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) { 559 std::string mangleName = SymTab::Mangler::mangle( realFunction );560 589 adaptersDone.insert( adaptersDone.begin(), mangleName ); 561 590 562 // apply substitution to type variables to figure out what the 563 // adapter's type should look like 591 // apply substitution to type variables to figure out what the adapter's type should look like 564 592 assert( env ); 565 593 env->apply( realFunction ); 566 mangleName = SymTab::Mangler::mangle( realFunction ); 567 568 if ( needsAdapter( realFunction, exprTyVars, true ) ) { 569 // the function still contains type variables, which means we are in a polymorphic 570 // context and the adapter function is a parameter - call the parameter and don't 571 // create a new adapter. 572 appExpr->get_args().push_front( new NameExpr( makeAdapterName ( mangleName ) ) ); 573 } else { 574 if ( isPolyRet( originalFunction, exprTyVars ) ) { 575 // if the return type involved polymorphic types, then 576 // the adapter will need to take those polymorphic types 577 // as pointers. Therefore, there can be two different 578 // functions with the same mangled name, so we need two adapter map 579 // stacks and also we need the mangled names to be different. 580 mangleName += "polyret_"; 581 } 582 583 AdapterMap & adapters = Pass1::adapters.top(); 584 AdapterMap::iterator adapter = adapters.find( mangleName ); 585 if ( adapter == adapters.end() ) { 586 // adapter has not been created yet in the current scope, so define it 587 FunctionDecl *newAdapter = makeAdapter( *funType, realFunction, mangleName, exprTyVars ); 588 adapter = adapters.insert( adapters.begin(), std::pair< std::string, FunctionDecl *>( mangleName, newAdapter ) ); 589 stmtsToAdd.push_back( new DeclStmt( noLabels, newAdapter ) ); 590 } // if 591 assert( adapter != adapters.end() ); 592 593 // add the appropriate adapter as a parameter 594 appExpr->get_args().push_front( new VariableExpr( adapter->second ) ); 594 mangleName = SymTab::Mangler::mangle( realFunction ); 595 mangleName += makePolyMonoSuffix( originalFunction, exprTyVars ); 596 597 AdapterMap & adapters = Pass1::adapters.top(); 598 AdapterMap::iterator adapter = adapters.find( mangleName ); 599 if ( adapter == adapters.end() ) { 600 // adapter has not been created yet in the current scope, so define it 601 FunctionDecl *newAdapter = makeAdapter( *funType, realFunction, mangleName, exprTyVars ); 602 adapter = adapters.insert( adapters.begin(), std::pair< std::string, DeclarationWithType *>( mangleName, newAdapter ) ); 603 stmtsToAdd.push_back( new DeclStmt( noLabels, newAdapter ) ); 595 604 } // if 605 assert( adapter != adapters.end() ); 606 607 // add the appropriate adapter as a parameter 608 appExpr->get_args().push_front( new VariableExpr( adapter->second ) ); 596 609 } // if 597 610 } // for 598 } 611 } // passAdapters 599 612 600 613 TypeInstType *isPolyPtr( Type *type, const TypeSubstitution *env, const TyVarMap &tyVars ) { … … 656 669 TypeInstType *typeInst1 = isPolyPtr( appExpr->get_args().front()->get_results().front(), env, scopeTyVars ); 657 670 TypeInstType *typeInst2 = isPolyPtr( appExpr->get_args().back()->get_results().front(), env, scopeTyVars ); 658 assert( ! typeInst1 || ! typeInst2 ); 671 assert( ! typeInst1 || ! typeInst2 ); // the arguments cannot both be polymorphic pointers 659 672 UntypedExpr *ret = 0; 660 if ( typeInst1 || typeInst2 ) { 673 if ( typeInst1 || typeInst2 ) { // one of the arguments is a polymorphic pointer 661 674 ret = new UntypedExpr( new NameExpr( "?+?" ) ); 662 675 } // if … … 769 782 770 783 Expression *Pass1::mutate( ApplicationExpr *appExpr ) { 771 ///std::cerr << "mutate appExpr: ";772 ///for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) {773 ///std::cerr << i->first << " ";774 ///}775 ///std::cerr << "\n";784 // std::cerr << "mutate appExpr: "; 785 // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) { 786 // std::cerr << i->first << " "; 787 // } 788 // std::cerr << "\n"; 776 789 bool oldUseRetval = useRetval; 777 790 useRetval = false; … … 799 812 ret = addPolyRetParam( appExpr, function, typeName, arg ); 800 813 } else if ( needsAdapter( function, scopeTyVars ) ) { 801 ///std::cerr << "needs adapter: ";802 ///for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) {803 ///std::cerr << i->first << " ";804 ///}805 ///std::cerr << "\n";814 // std::cerr << "needs adapter: "; 815 // for ( TyVarMap::iterator i = scopeTyVars.begin(); i != scopeTyVars.end(); ++i ) { 816 // std::cerr << i->first << " "; 817 // } 818 // std::cerr << "\n"; 806 819 // change the application so it calls the adapter rather than the passed function 807 820 ret = applyAdapter( appExpr, function, arg, scopeTyVars ); … … 854 867 855 868 Statement * Pass1::mutate(ReturnStmt *retStmt) { 856 // a cast expr on a polymorphic return value is either redundant or invalid869 // by this point, a cast expr on a polymorphic return value is redundant 857 870 while ( CastExpr *castExpr = dynamic_cast< CastExpr *>( retStmt->get_expr() ) ) { 858 871 retStmt->set_expr( castExpr->get_arg() ); … … 911 924 912 925 void Pass1::doBeginScope() { 913 // actually, maybe this could (should?) push 914 // a copy of the current map 915 adapters.push(AdapterMap()); 926 // push a copy of the current map 927 adapters.push(adapters.top()); 916 928 } 917 929 … … 934 946 std::set< std::string > adaptersDone; 935 947 for ( std::list< FunctionType *>::iterator funType = functions.begin(); funType != functions.end(); ++funType ) { 936 std::string mangleName = SymTab::Mangler::mangle( *funType);948 std::string mangleName = mangleAdapterName( *funType, scopeTyVars ); 937 949 if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) { 938 950 std::string adapterName = makeAdapterName( mangleName ); … … 1000 1012 for ( std::list< TypeDecl *>::const_iterator tyParm = funcType->get_forall().begin(); tyParm != funcType->get_forall().end(); ++tyParm ) { 1001 1013 ObjectDecl *thisParm; 1014 // add all size parameters to parameter list 1002 1015 if ( (*tyParm)->get_kind() == TypeDecl::Any ) { 1003 1016 thisParm = newObj->clone(); … … 1006 1019 ++last; 1007 1020 } 1021 // move all assertions into parameter list 1008 1022 for ( std::list< DeclarationWithType *>::iterator assert = (*tyParm)->get_assertions().begin(); assert != (*tyParm)->get_assertions().end(); ++assert ) { 1009 1023 /// *assert = (*assert)->acceptMutator( *this ); -
src/GenPoly/Box.h
r9ed3237 r0ddb713 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue May 19 07:32:33201513 // Update Count : 212 // Last Modified On : Thu Nov 19 17:24:01 2015 13 // Update Count : 5 14 14 // 15 15 -
src/GenPoly/GenPoly.cc
r9ed3237 r0ddb713 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Tue May 19 07:37:46201513 // Update Count : 1 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Nov 24 15:23:08 2015 13 // Update Count : 11 14 14 // 15 15 … … 21 21 22 22 namespace GenPoly { 23 // interface functions 24 bool isPolyVal( Type *type, const TyVarMap &tyVars ) { 25 return isPolyVal( type, tyVars, false ); 23 // A function needs an adapter if it returns a polymorphic value or if any of its 24 // parameters have polymorphic type 25 bool needsAdapter( FunctionType *adaptee, const TyVarMap &tyVars ) { 26 if ( ! adaptee->get_returnVals().empty() && isPolyVal( adaptee->get_returnVals().front()->get_type(), tyVars ) ) { 27 return true; 28 } // if 29 for ( std::list< DeclarationWithType* >::const_iterator innerArg = adaptee->get_parameters().begin(); innerArg != adaptee->get_parameters().end(); ++innerArg ) { 30 if ( isPolyVal( (*innerArg)->get_type(), tyVars ) ) { 31 return true; 32 } // if 33 } // for 34 return false; 26 35 } 27 36 28 bool needsAdapter( FunctionType *adaptee, const TyVarMap &tyVars ) { 29 return needsAdapter( adaptee, tyVars, false ); 37 bool isPolyRet( FunctionType *function, std::string &name, const TyVarMap &otherTyVars ) { 38 bool doTransform = false; 39 if ( ! function->get_returnVals().empty() ) { 40 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType *>( function->get_returnVals().front()->get_type() ) ) { 41 42 // figure out if the return type is specified by a type parameter 43 for ( std::list< TypeDecl *>::const_iterator tyVar = function->get_forall().begin(); tyVar != function->get_forall().end(); ++tyVar ) { 44 if ( (*tyVar)->get_name() == typeInst->get_name() ) { 45 doTransform = true; 46 name = typeInst->get_name(); 47 break; 48 } // if 49 } // for 50 if ( ! doTransform && otherTyVars.find( typeInst->get_name() ) != otherTyVars.end() ) { 51 doTransform = true; 52 } // if 53 } // if 54 } // if 55 return doTransform; 30 56 } 31 57 32 bool isPolyVal( Type *type, const TyVarMap &tyVars, bool considerAllTyVars ) { 33 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) { 58 bool isPolyRet( FunctionType *function, std::string &name ) { 59 TyVarMap dummyTyVars; 60 return isPolyRet( function, name, dummyTyVars ); 61 } 62 63 bool isPolyRet( FunctionType *function, const TyVarMap &otherTyVars ) { 64 std::string dummyString; 65 return isPolyRet( function, dummyString, otherTyVars ); 66 } 67 68 bool isPolyVal( Type *type, const TyVarMap &tyVars ) { 69 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( type ) ) { 34 70 if ( tyVars.find( typeInst->get_name() ) != tyVars.end() ) { 35 71 return true; 36 72 } // if 37 return considerAllTyVars;38 73 } // if 39 74 return false; 40 75 } 41 76 42 // A function needs an adapter if it returns a polymorphic value or if any of its 43 // parameters have polymorphic type 44 bool needsAdapter( FunctionType *adaptee, const TyVarMap &tyVars, bool considerAllTyVars ) { 45 bool needsAdapter = false; 46 if ( ! adaptee->get_returnVals().empty() && isPolyVal( adaptee->get_returnVals().front()->get_type(), tyVars, considerAllTyVars ) ) { 47 needsAdapter = true; 48 } // if 49 for ( std::list< DeclarationWithType* >::const_iterator innerArg = adaptee->get_parameters().begin(); ! needsAdapter && innerArg != adaptee->get_parameters().end(); ++innerArg ) { 50 if ( isPolyVal( (*innerArg)->get_type(), tyVars, considerAllTyVars ) ) { 51 needsAdapter = true; 52 } // if 53 } // for 54 return needsAdapter; 77 bool isPolyObj( Type *type, const TyVarMap &tyVars ) { 78 if ( isPolyVal( type, tyVars ) ) { 79 return true; 80 } else if ( PointerType *pt = dynamic_cast<PointerType*>( type ) ) { 81 return isPolyObj( pt->get_base(), tyVars ); 82 } else { 83 return false; 84 } 55 85 } 56 86 -
src/GenPoly/GenPoly.h
r9ed3237 r0ddb713 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Tue May 19 07:38:34201513 // Update Count : 111 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Nov 24 15:24:38 2015 13 // Update Count : 6 14 14 // 15 15 … … 25 25 typedef std::map< std::string, TypeDecl::Kind > TyVarMap; 26 26 27 // considerAllTyVars allows ignoring the contents of the TyVarMap parameter, for the situations where 28 // it is important only that a TypeInstType node exists. 27 bool needsAdapter( FunctionType *adaptee, const TyVarMap &tyVarr ); 28 bool isPolyRet( FunctionType *function, std::string &name, const TyVarMap &otherTyVars ); 29 bool isPolyRet( FunctionType *function, std::string &name ); 30 bool isPolyRet( FunctionType *function, const TyVarMap &otherTyVars ); 31 // bool isPolyFun( FunctionType *fun, const TyVarMap &tyVars ); 32 bool isPolyVal( Type *type, const TyVarMap &tyVars ); 29 33 30 bool needsAdapter( FunctionType *adaptee, const TyVarMap &tyVarr ); 31 bool needsAdapter( FunctionType *adaptee, const TyVarMap &tyVars, bool considerAllTyVars ); 32 bool isPolyFun( FunctionType *fun, const TyVarMap &tyVars ); 33 bool isPolyVal( Type *type, const TyVarMap &tyVars ); 34 bool isPolyVal( Type *type, const TyVarMap &tyVars, bool considerAllTyVars ); 34 // true if type variable or any number of pointers to type variable 35 bool isPolyObj( Type *type, const TyVarMap &tyVars ); 35 36 void printTyVarMap( std::ostream &os, const TyVarMap &tyVarMap ); 36 37 } // namespace GenPoly -
src/GenPoly/module.mk
r9ed3237 r0ddb713 22 22 GenPoly/Specialize.cc \ 23 23 GenPoly/CopyParams.cc \ 24 GenPoly/FindFunction.cc 24 GenPoly/FindFunction.cc \ 25 GenPoly/InstantiateGeneric.cc
Note:
See TracChangeset
for help on using the changeset viewer.