Changes in / [a25f64b:2b2f59d]


Ignore:
Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInitNew.cpp

    ra25f64b r2b2f59d  
    413413        void SelfAssignChecker::previsit( const ast::ApplicationExpr * appExpr ) {
    414414                auto function = getFunction( appExpr );
    415                 // Doesn't use isAssignment, because ?+=?, etc. should not count as self-assignment.
    416                 if ( function->name == "?=?" && appExpr->args.size() == 2
    417                                 // Check for structural similarity (same variable use, ignore casts, etc.
    418                                 // (but does not look too deeply, anything looking like a function is off limits).
    419                                 && structurallySimilar( appExpr->args.front(), appExpr->args.back() ) ) {
    420                         SemanticWarning( appExpr->location, Warning::SelfAssignment, toCString( appExpr->args.front() ) );
     415                if ( function->name == "?=?" ) { // doesn't use isAssignment, because ?+=?, etc. should not count as self-assignment
     416                        if ( appExpr->args.size() == 2 ) {
     417                                // check for structural similarity (same variable use, ignore casts, etc. - but does not look too deeply, anything looking like a function is off limits)
     418                                if ( structurallySimilar( appExpr->args.front(), appExpr->args.back() ) ) {
     419                                        SemanticWarning( appExpr->location, Warning::SelfAssignment, toCString( appExpr->args.front() ) );
     420                                }
     421                        }
    421422                }
    422423        }
  • src/ResolvExpr/Resolver.cc

    ra25f64b r2b2f59d  
    14711471                                auto newDecl = fixObjectType(objectDecl, symtab);
    14721472                                auto mutDecl = mutate(newDecl);
    1473 
     1473                               
    14741474                                // generate CtorInit wrapper when necessary.
    14751475                                // in certain cases, fixObjectType is called before reaching
     
    14891489                        currentObject = ast::CurrentObject{ objectDecl->location, objectDecl->get_type() };
    14901490                }
    1491 
     1491               
    14921492                return objectDecl;
    14931493        }
  • src/main.cc

    ra25f64b r2b2f59d  
    99// Author           : Peter Buhr and Rob Schluntz
    1010// Created On       : Fri May 15 23:12:02 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Dec  1 14:52:00 2020
    13 // Update Count     : 638
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Oct  8 18:17:46 2020
     13// Update Count     : 637
    1414//
    1515
     
    340340                } // if
    341341
    342                 if( useNewAST ) {
     342                if( useNewAST) {
    343343                        if (Stats::Counters::enabled) {
    344344                                ast::pass_visitor_stats.avg = Stats::Counters::build<Stats::Counters::AverageCounter<double>>("Average Depth - New");
     
    352352                                return EXIT_SUCCESS;
    353353                        } // if
    354 
    355                         // TODO: This is a quick fix to get the build working.
    356                         // Get rid of fillLocations or at least make a new-ast version.
    357                         translationUnit = convert( move( transUnit ) );
    358                         CodeTools::fillLocations( translationUnit );
    359                         transUnit = convert( move( translationUnit ) );
    360354
    361355                        PASS( "Fix Init", InitTweak::fix(transUnit, buildingLibrary()));
Note: See TracChangeset for help on using the changeset viewer.