Changeset 084184b
- Timestamp:
- May 26, 2016, 8:12:56 PM (8 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, with_gc
- Children:
- e24955a
- Parents:
- d9f1b2d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/TypeSubstitution.cc
rd9f1b2d r084184b 72 72 Type *TypeSubstitution::lookup( std::string formalType ) const { 73 73 TypeEnvType::const_iterator i = typeEnv.find( formalType ); 74 75 // break on not in substitution set 76 if ( i == typeEnv.end() ) return 0; 77 78 // attempt to transitively follow TypeInstType links. 79 while ( TypeInstType *actualType = dynamic_cast< TypeInstType* >( i->second ) ) { 80 const std::string& typeName = actualType->get_name(); 81 82 // break cycles in the transitive follow 83 if ( formalType == typeName ) break; 84 85 // Look for the type this maps to, returning previous mapping if none-such 86 i = typeEnv.find( typeName ); 87 if ( i == typeEnv.end() ) return actualType; 88 } 89 90 // return type from substitution set 91 return i->second; 92 93 #if 0 74 94 if ( i == typeEnv.end() ) { 75 95 return 0; … … 77 97 return i->second; 78 98 } // if 99 #endif 79 100 } 80 101
Note: See TracChangeset
for help on using the changeset viewer.