Changes in src/ResolvExpr/Resolver.cc [46da46b:251ce80]
- File:
-
- 1 edited
-
src/ResolvExpr/Resolver.cc (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r46da46b r251ce80 38 38 #include "AST/SymbolTable.hpp" 39 39 #include "AST/Type.hpp" 40 #include "Common/Eval.h" // for eval 41 #include "Common/Iterate.hpp" // for group_iterate 40 42 #include "Common/PassVisitor.h" // for PassVisitor 41 43 #include "Common/SemanticError.h" // for SemanticError 42 44 #include "Common/Stats/ResolveTime.h" // for ResolveTime::start(), ResolveTime::stop() 43 #include "Common/ utility.h" // for ValueGuard, group_iterate45 #include "Common/ToString.hpp" // for toCString 44 46 #include "InitTweak/GenInit.h" 45 47 #include "InitTweak/InitTweak.h" // for isIntrinsicSingleArgCallStmt … … 1009 1011 ast::TypeEnvironment env; 1010 1012 CandidateFinder finder( context, env ); 1011 finder.allowVoid = true;1012 1013 finder.find( untyped, recursion_level == 1 ? mode.atTopLevel() : mode ); 1013 1014 --recursion_level; … … 1053 1054 1054 1055 // promote candidate.cvtCost to .cost 1055 //promoteCvtCost( winners );1056 promoteCvtCost( winners ); 1056 1057 1057 1058 // produce ambiguous errors, if applicable … … 1107 1108 void removeExtraneousCast( ast::ptr<ast::Expr> & expr, const ast::SymbolTable & symtab ) { 1108 1109 if ( const ast::CastExpr * castExpr = expr.as< ast::CastExpr >() ) { 1109 if ( typesCompatible( castExpr->arg->result, castExpr->result , symtab) ) {1110 if ( typesCompatible( castExpr->arg->result, castExpr->result ) ) { 1110 1111 // cast is to the same type as its argument, remove it 1111 1112 swap_and_save_env( expr, castExpr->arg ); … … 1729 1730 1730 1731 // Find all candidates for a function in canonical form 1731 funcFinder.find( clause.target _func, ResolvMode::withAdjustment() );1732 funcFinder.find( clause.target, ResolvMode::withAdjustment() ); 1732 1733 1733 1734 if ( funcFinder.candidates.empty() ) { 1734 1735 stringstream ss; 1735 1736 ss << "Use of undeclared indentifier '"; 1736 ss << clause.target _func.strict_as< ast::NameExpr >()->name;1737 ss << clause.target.strict_as< ast::NameExpr >()->name; 1737 1738 ss << "' in call to waitfor"; 1738 1739 SemanticError( stmt->location, ss.str() ); … … 1833 1834 if ( 1834 1835 ! unify( 1835 arg->expr->result, *param, resultEnv, need, have, open, 1836 symtab ) 1836 arg->expr->result, *param, resultEnv, need, have, open ) 1837 1837 ) { 1838 1838 // Type doesn't match … … 1921 1921 auto clause2 = new ast::WaitForClause( clause.location ); 1922 1922 1923 clause2->target _func= funcCandidates.front()->expr;1923 clause2->target = funcCandidates.front()->expr; 1924 1924 1925 1925 clause2->target_args.reserve( clause.target_args.size() ); … … 1944 1944 1945 1945 // Resolve the conditions as if it were an IfStmt, statements normally 1946 clause2-> cond = findSingleExpression( clause.cond, context );1946 clause2->when_cond = findSingleExpression( clause.when_cond, context ); 1947 1947 clause2->stmt = clause.stmt->accept( *visitor ); 1948 1948
Note:
See TracChangeset
for help on using the changeset viewer.