Ignore:
Timestamp:
Jun 19, 2023, 1:57:11 PM (3 years ago)
Author:
caparson <caparson@…>
Branches:
master
Children:
adc73a5
Parents:
fa5e1aa5 (diff), 33d4bc8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    rfa5e1aa5 rb7b3e41  
    10111011                        ast::TypeEnvironment env;
    10121012                        CandidateFinder finder( context, env );
     1013                        finder.allowVoid = true;
    10131014                        finder.find( untyped, recursion_level == 1 ? mode.atTopLevel() : mode );
    10141015                        --recursion_level;
     
    10541055
    10551056                        // promote candidate.cvtCost to .cost
    1056                         promoteCvtCost( winners );
     1057                        // promoteCvtCost( winners );
    10571058
    10581059                        // produce ambiguous errors, if applicable
     
    11061107
    11071108                /// Removes cast to type of argument (unlike StripCasts, also handles non-generated casts)
    1108                 void removeExtraneousCast( ast::ptr<ast::Expr> & expr, const ast::SymbolTable & symtab ) {
     1109                void removeExtraneousCast( ast::ptr<ast::Expr> & expr ) {
    11091110                        if ( const ast::CastExpr * castExpr = expr.as< ast::CastExpr >() ) {
    11101111                                if ( typesCompatible( castExpr->arg->result, castExpr->result ) ) {
     
    11961197                ast::ptr< ast::Expr > castExpr = new ast::CastExpr{ untyped, type };
    11971198                ast::ptr< ast::Expr > newExpr = findSingleExpression( castExpr, context );
    1198                 removeExtraneousCast( newExpr, context.symtab );
     1199                removeExtraneousCast( newExpr );
    11991200                return newExpr;
    12001201        }
     
    12611262                static size_t traceId;
    12621263                Resolver_new( const ast::TranslationGlobal & global ) :
     1264                        ast::WithSymbolTable(ast::SymbolTable::ErrorDetection::ValidateOnAdd),
    12631265                        context{ symtab, global } {}
    12641266                Resolver_new( const ResolveContext & context ) :
     
    13401342                                        auto mutAttr = mutate(attr);
    13411343                                        mutAttr->params.front() = resolved;
    1342                                         if (! result.second) {
     1344                                        if (! result.hasKnownValue) {
    13431345                                                SemanticWarning(loc, Warning::GccAttributes,
    13441346                                                        toCString( name, " priorities must be integers from 0 to 65535 inclusive: ", arg ) );
    13451347                                        }
    13461348                                        else {
    1347                                                 auto priority = result.first;
     1349                                                auto priority = result.knownValue;
    13481350                                                if (priority < 101) {
    13491351                                                        SemanticWarning(loc, Warning::GccAttributes,
     
    20402042                const ast::Type * initContext = currentObject.getCurrentType();
    20412043
    2042                 removeExtraneousCast( newExpr, symtab );
     2044                removeExtraneousCast( newExpr );
    20432045
    20442046                // check if actual object's type is char[]
Note: See TracChangeset for help on using the changeset viewer.