Changeset 1d7b0a8 for src/ResolvExpr/Resolver.cc
- Timestamp:
- Jun 11, 2018, 2:50:06 PM (5 years ago)
- Branches:
- new-env
- Children:
- 6d53e779, 982f95d
- Parents:
- 8e18b8e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r8e18b8e r1d7b0a8 33 33 #include "ResolveTypeof.h" // for resolveTypeof 34 34 #include "Resolver.h" 35 #include "ResolvMode.h" // for ResolvMode 35 36 #include "SymTab/Autogen.h" // for SizeType 36 37 #include "SymTab/Indexer.h" // for Indexer … … 165 166 166 167 namespace { 167 void findUnfinishedKindExpression( Expression * untyped, Alternative & alt, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, bool adjust = false, bool prune = true, bool failFast = true) {168 void findUnfinishedKindExpression( Expression * untyped, Alternative & alt, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, ResolvMode mode = ResolvMode{} ) { 168 169 assertf( untyped, "expected a non-null expression." ); 169 170 … … 172 173 TypeEnvironment env; 173 174 AlternativeFinder finder( indexer, env ); 174 finder.find( untyped, adjust, prune, failFast);175 finder.find( untyped, mode ); 175 176 176 177 #if 0 … … 218 219 219 220 /// resolve `untyped` to the expression whose alternative satisfies `pred` with the lowest cost; kindStr is used for providing better error messages 220 void findKindExpression(Expression *& untyped, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, bool adjust = false, bool prune = true, bool failFast = true) {221 void findKindExpression(Expression *& untyped, const SymTab::Indexer & indexer, const std::string & kindStr, std::function<bool(const Alternative &)> pred, ResolvMode mode = ResolvMode{}) { 221 222 if ( ! untyped ) return; 222 223 Alternative choice; 223 findUnfinishedKindExpression( untyped, choice, indexer, kindStr, pred, adjust, prune, failFast);224 findUnfinishedKindExpression( untyped, choice, indexer, kindStr, pred, mode ); 224 225 finishExpr( choice.expr, choice.env, untyped->env ); 225 226 untyped = choice.expr; … … 249 250 // set up and resolve expression cast to void 250 251 Alternative choice; 251 findUnfinishedKindExpression( untyped, choice, indexer, "", standardAlternativeFilter, true);252 findUnfinishedKindExpression( untyped, choice, indexer, "", standardAlternativeFilter, ResolvMode::withAdjustment() ); 252 253 CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( choice.expr ); 253 254 env = std::move( choice.env );
Note: See TracChangeset
for help on using the changeset viewer.