Changeset f18a711
- Timestamp:
- Aug 10, 2016, 2:29:40 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 3078643
- Parents:
- ce76eb9
- Location:
- src/GenPoly
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
rce76eb9 rf18a711 2054 2054 2055 2055 DeclClass *ret = static_cast< DeclClass *>( Mutator::mutate( decl ) ); 2056 ScrubTyVars::scrub Dynamic( decl, scopeTyVars );2056 ScrubTyVars::scrub( decl, scopeTyVars ); 2057 2057 2058 2058 scopeTyVars.endScope(); -
src/GenPoly/InstantiateGeneric.cc
rce76eb9 rf18a711 173 173 void insert( UnionInstType *inst, const std::list< TypeExpr* > &typeSubs, UnionDecl *decl ) { instantiations.insert( inst->get_baseUnion(), typeSubs, decl ); } 174 174 175 /// If this is an instance of a type already determined to be dtype-static, strips the instances's type parameters and returns true176 bool stripInstParams( AggregateDecl *base, ReferenceToType *inst );177 178 175 /// Strips a dtype-static aggregate decl of its type parameters, marks it as stripped 179 176 void stripDtypeParams( AggregateDecl *base, std::list< TypeDecl* >& baseParams, const std::list< TypeExpr* >& typeSubs ); … … 240 237 } 241 238 242 bool GenericInstantiator::stripInstParams( AggregateDecl *base, ReferenceToType *inst ) { 243 if ( dtypeStatics.find( base ) == dtypeStatics.end() ) return false; 244 239 /// Strips the instances's type parameters 240 void stripInstParams( ReferenceToType *inst ) { 245 241 deleteAll( inst->get_parameters() ); 246 242 inst->get_parameters().clear(); 247 248 return true;249 243 } 250 244 … … 268 262 269 263 // check for an already-instantiatiated dtype-static type 270 if ( stripInstParams( inst->get_baseStruct(), inst ) ) return inst; 264 if ( dtypeStatics.find( inst->get_baseStruct() ) != dtypeStatics.end() ) { 265 stripInstParams( inst ); 266 return inst; 267 } 271 268 272 269 // check if type can be concretely instantiated; put substitutions into typeSubs … … 277 274 case genericType::dtypeStatic: 278 275 stripDtypeParams( inst->get_baseStruct(), *inst->get_baseParameters(), typeSubs ); 276 stripInstParams( inst ); 279 277 break; 280 278 … … 316 314 317 315 // check for an already-instantiatiated dtype-static type 318 if ( stripInstParams( inst->get_baseUnion(), inst ) ) return inst; 316 if ( dtypeStatics.find( inst->get_baseUnion() ) != dtypeStatics.end() ) { 317 stripInstParams( inst ); 318 return inst; 319 } 319 320 320 321 // check if type can be concretely instantiated; put substitutions into typeSubs … … 325 326 case genericType::dtypeStatic: 326 327 stripDtypeParams( inst->get_baseUnion(), *inst->get_baseParameters(), typeSubs ); 328 stripInstParams( inst ); 327 329 break; 328 330
Note: See TracChangeset
for help on using the changeset viewer.