Changeset 4a8c875 for src/SynTree
- Timestamp:
- May 27, 2016, 2:38:19 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:
- 2a7e29b
- Parents:
- 9554d9b (diff), e24955a (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/TypeSubstitution.cc
r9554d9b r4a8c875 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.