Changeset 7664fad
- Timestamp:
- Oct 4, 2017, 11:30:57 AM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- adb4a3a
- Parents:
- bb9d8e8
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rbb9d8e8 r7664fad 109 109 110 110 namespace { 111 void finishExpr( Expression *expr, const TypeEnvironment &env ) {112 expr-> set_env( new TypeSubstitution );111 void finishExpr( Expression *expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) { 112 expr->env = oldenv ? oldenv->clone() : new TypeSubstitution; 113 113 env.makeSubstitution( *expr->get_env() ); 114 114 } … … 119 119 TypeEnvironment env; 120 120 Expression *newExpr = resolveInVoidContext( untyped, indexer, env ); 121 finishExpr( newExpr, env );121 finishExpr( newExpr, env, untyped->env ); 122 122 return newExpr; 123 123 } … … 129 129 #if 0 130 130 if ( finder.get_alternatives().size() != 1 ) { 131 std::c out<< "untyped expr is ";132 untyped->print( std::c out);133 std::c out<< std::endl << "alternatives are:";134 for ( std::list< Alternative >::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i) {135 i->print( std::cout);131 std::cerr << "untyped expr is "; 132 untyped->print( std::cerr ); 133 std::cerr << std::endl << "alternatives are:"; 134 for ( const Alternative & alt : finder.get_alternatives() ) { 135 alt.print( std::cerr ); 136 136 } // for 137 137 } // if … … 140 140 Alternative &choice = finder.get_alternatives().front(); 141 141 Expression *newExpr = choice.expr->clone(); 142 finishExpr( newExpr, choice.env );142 finishExpr( newExpr, choice.env, untyped->env ); 143 143 return newExpr; 144 144 } … … 186 186 throw SemanticError( "No interpretations for case control expression", untyped ); 187 187 } // if 188 finishExpr( newExpr, *newEnv );188 finishExpr( newExpr, *newEnv, untyped->env ); 189 189 return newExpr; 190 190 } -
src/SymTab/Validate.cc
rbb9d8e8 r7664fad 276 276 ReturnChecker::checkFunctionReturns( translationUnit ); 277 277 mutateAll( translationUnit, compoundliteral ); 278 acceptAll( translationUnit, fpd ); 278 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines 279 279 ArrayLength::computeLength( translationUnit ); 280 280 acceptAll( translationUnit, finder );
Note: See TracChangeset
for help on using the changeset viewer.