Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r251ce80 r46da46b  
    3838#include "AST/SymbolTable.hpp"
    3939#include "AST/Type.hpp"
    40 #include "Common/Eval.h"                 // for eval
    41 #include "Common/Iterate.hpp"            // for group_iterate
    4240#include "Common/PassVisitor.h"          // for PassVisitor
    4341#include "Common/SemanticError.h"        // for SemanticError
    4442#include "Common/Stats/ResolveTime.h"    // for ResolveTime::start(), ResolveTime::stop()
    45 #include "Common/ToString.hpp"           // for toCString
     43#include "Common/utility.h"              // for ValueGuard, group_iterate
    4644#include "InitTweak/GenInit.h"
    4745#include "InitTweak/InitTweak.h"         // for isIntrinsicSingleArgCallStmt
     
    10111009                        ast::TypeEnvironment env;
    10121010                        CandidateFinder finder( context, env );
     1011                        finder.allowVoid = true;
    10131012                        finder.find( untyped, recursion_level == 1 ? mode.atTopLevel() : mode );
    10141013                        --recursion_level;
     
    10541053
    10551054                        // promote candidate.cvtCost to .cost
    1056                         promoteCvtCost( winners );
     1055                        // promoteCvtCost( winners );
    10571056
    10581057                        // produce ambiguous errors, if applicable
     
    11081107                void removeExtraneousCast( ast::ptr<ast::Expr> & expr, const ast::SymbolTable & symtab ) {
    11091108                        if ( const ast::CastExpr * castExpr = expr.as< ast::CastExpr >() ) {
    1110                                 if ( typesCompatible( castExpr->arg->result, castExpr->result ) ) {
     1109                                if ( typesCompatible( castExpr->arg->result, castExpr->result, symtab ) ) {
    11111110                                        // cast is to the same type as its argument, remove it
    11121111                                        swap_and_save_env( expr, castExpr->arg );
     
    17301729
    17311730                        // Find all candidates for a function in canonical form
    1732                         funcFinder.find( clause.target, ResolvMode::withAdjustment() );
     1731                        funcFinder.find( clause.target_func, ResolvMode::withAdjustment() );
    17331732
    17341733                        if ( funcFinder.candidates.empty() ) {
    17351734                                stringstream ss;
    17361735                                ss << "Use of undeclared indentifier '";
    1737                                 ss << clause.target.strict_as< ast::NameExpr >()->name;
     1736                                ss << clause.target_func.strict_as< ast::NameExpr >()->name;
    17381737                                ss << "' in call to waitfor";
    17391738                                SemanticError( stmt->location, ss.str() );
     
    18341833                                                                if (
    18351834                                                                        ! unify(
    1836                                                                                 arg->expr->result, *param, resultEnv, need, have, open )
     1835                                                                                arg->expr->result, *param, resultEnv, need, have, open,
     1836                                                                                symtab )
    18371837                                                                ) {
    18381838                                                                        // Type doesn't match
     
    19211921                        auto clause2 = new ast::WaitForClause( clause.location );
    19221922
    1923                         clause2->target = funcCandidates.front()->expr;
     1923                        clause2->target_func = funcCandidates.front()->expr;
    19241924
    19251925                        clause2->target_args.reserve( clause.target_args.size() );
     
    19441944
    19451945                        // Resolve the conditions as if it were an IfStmt, statements normally
    1946                         clause2->when_cond = findSingleExpression( clause.when_cond, context );
     1946                        clause2->cond = findSingleExpression( clause.cond, context );
    19471947                        clause2->stmt = clause.stmt->accept( *visitor );
    19481948
Note: See TracChangeset for help on using the changeset viewer.