Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    r11df881 rb9f8274  
    1010// Created On       : Fri May 15 23:12:02 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jul 18 11:08:00 2022
    13 // Update Count     : 676
     12// Last Modified On : Tue Jul 12 12:02:00 2022
     13// Update Count     : 675
    1414//
    1515
     
    330330                Stats::Time::StopBlock();
    331331
     332                PASS( "Translate Exception Declarations", ControlStruct::translateExcept( translationUnit ) );
     333                if ( exdeclp ) {
     334                        dump( translationUnit );
     335                        return EXIT_SUCCESS;
     336                } // if
     337
     338                CodeTools::fillLocations( translationUnit );
     339
    332340                if( useNewAST ) {
     341                        CodeTools::fillLocations( translationUnit );
     342
    333343                        if (Stats::Counters::enabled) {
    334344                                ast::pass_visitor_stats.avg = Stats::Counters::build<Stats::Counters::AverageCounter<double>>("Average Depth - New");
     
    339349                        forceFillCodeLocations( transUnit );
    340350
    341                         PASS( "Translate Exception Declarations", ControlStruct::translateExcept( transUnit ) );
    342                         if ( exdeclp ) {
    343                                 dump( move( transUnit ) );
    344                                 return EXIT_SUCCESS;
    345                         }
    346 
     351                        // Must happen before auto-gen, or anything that examines ops.
    347352                        PASS( "Verify Ctor, Dtor & Assign", Validate::verifyCtorDtorAssign( transUnit ) );
     353
    348354                        PASS( "Hoist Type Decls", Validate::hoistTypeDecls( transUnit ) );
    349355                        // Hoist Type Decls pulls some declarations out of contexts where
     
    353359
    354360                        PASS( "Replace Typedefs", Validate::replaceTypedef( transUnit ) );
     361
     362                        // Must happen before auto-gen.
    355363                        PASS( "Fix Return Types", Validate::fixReturnTypes( transUnit ) );
     364
     365                        // Must happen before Link Reference to Types, it needs correct
     366                        // types for mangling.
    356367                        PASS( "Enum and Pointer Decay", Validate::decayEnumsAndPointers( transUnit ) );
    357368
     369                        // Must happen before auto-gen, because it uses the sized flag.
    358370                        PASS( "Link Reference To Types", Validate::linkReferenceToTypes( transUnit ) );
    359371
     372                        // Must happen after Link References To Types,
     373                        // because aggregate members are accessed.
    360374                        PASS( "Fix Qualified Types", Validate::fixQualifiedTypes( transUnit ) );
     375
    361376                        PASS( "Hoist Struct", Validate::hoistStruct( transUnit ) );
    362377                        PASS( "Eliminate Typedef", Validate::eliminateTypedef( transUnit ) );
     378
     379                        // Check as early as possible. Can't happen before
     380                        // LinkReferenceToType, observed failing when attempted
     381                        // before eliminateTypedef
    363382                        PASS( "Validate Generic Parameters", Validate::fillGenericParameters( transUnit ) );
     383
    364384                        PASS( "Translate Dimensions", Validate::translateDimensionParameters( transUnit ) );
    365385                        PASS( "Check Function Returns", Validate::checkReturnStatements( transUnit ) );
     386
     387                        // Must happen before Autogen.
    366388                        PASS( "Fix Return Statements", InitTweak::fixReturnStatements( transUnit ) );
     389
    367390                        PASS( "Implement Concurrent Keywords", Concurrency::implementKeywords( transUnit ) );
     391
     392                        // Must be after implement concurrent keywords; because uniqueIds
     393                        //   must be set on declaration before resolution.
     394                        // Must happen before autogen routines are added.
    368395                        PASS( "Forall Pointer Decay", Validate::decayForallPointers( transUnit ) );
     396
     397                        // Must happen before autogen routines are added.
    369398                        PASS( "Hoist Control Declarations", ControlStruct::hoistControlDecls( transUnit ) );
    370399
     400                        // Must be after enum and pointer decay.
     401                        // Must be before compound literals.
    371402                        PASS( "Generate Autogen Routines", Validate::autogenerateRoutines( transUnit ) );
    372403
     
    442473                        translationUnit = convert( move( transUnit ) );
    443474                } else {
    444                         PASS( "Translate Exception Declarations", ControlStruct::translateExcept( translationUnit ) );
    445                         if ( exdeclp ) {
    446                                 dump( translationUnit );
    447                                 return EXIT_SUCCESS;
    448                         } // if
    449 
    450475                        // add the assignment statement after the initialization of a type parameter
    451476                        PASS( "Validate", SymTab::validate( translationUnit ) );
Note: See TracChangeset for help on using the changeset viewer.