Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r46da46b r251ce80  
    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
    4042#include "Common/PassVisitor.h"          // for PassVisitor
    4143#include "Common/SemanticError.h"        // for SemanticError
    4244#include "Common/Stats/ResolveTime.h"    // for ResolveTime::start(), ResolveTime::stop()
    43 #include "Common/utility.h"              // for ValueGuard, group_iterate
     45#include "Common/ToString.hpp"           // for toCString
    4446#include "InitTweak/GenInit.h"
    4547#include "InitTweak/InitTweak.h"         // for isIntrinsicSingleArgCallStmt
     
    10091011                        ast::TypeEnvironment env;
    10101012                        CandidateFinder finder( context, env );
    1011                         finder.allowVoid = true;
    10121013                        finder.find( untyped, recursion_level == 1 ? mode.atTopLevel() : mode );
    10131014                        --recursion_level;
     
    10531054
    10541055                        // promote candidate.cvtCost to .cost
    1055                         // promoteCvtCost( winners );
     1056                        promoteCvtCost( winners );
    10561057
    10571058                        // produce ambiguous errors, if applicable
     
    11071108                void removeExtraneousCast( ast::ptr<ast::Expr> & expr, const ast::SymbolTable & symtab ) {
    11081109                        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 ) ) {
    11101111                                        // cast is to the same type as its argument, remove it
    11111112                                        swap_and_save_env( expr, castExpr->arg );
     
    17291730
    17301731                        // Find all candidates for a function in canonical form
    1731                         funcFinder.find( clause.target_func, ResolvMode::withAdjustment() );
     1732                        funcFinder.find( clause.target, ResolvMode::withAdjustment() );
    17321733
    17331734                        if ( funcFinder.candidates.empty() ) {
    17341735                                stringstream ss;
    17351736                                ss << "Use of undeclared indentifier '";
    1736                                 ss << clause.target_func.strict_as< ast::NameExpr >()->name;
     1737                                ss << clause.target.strict_as< ast::NameExpr >()->name;
    17371738                                ss << "' in call to waitfor";
    17381739                                SemanticError( stmt->location, ss.str() );
     
    18331834                                                                if (
    18341835                                                                        ! unify(
    1835                                                                                 arg->expr->result, *param, resultEnv, need, have, open,
    1836                                                                                 symtab )
     1836                                                                                arg->expr->result, *param, resultEnv, need, have, open )
    18371837                                                                ) {
    18381838                                                                        // Type doesn't match
     
    19211921                        auto clause2 = new ast::WaitForClause( clause.location );
    19221922
    1923                         clause2->target_func = funcCandidates.front()->expr;
     1923                        clause2->target = 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->cond = findSingleExpression( clause.cond, context );
     1946                        clause2->when_cond = findSingleExpression( clause.when_cond, context );
    19471947                        clause2->stmt = clause.stmt->accept( *visitor );
    19481948
Note: See TracChangeset for help on using the changeset viewer.