Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rc884f2d r7e08acf  
    4949#include "CodeGen/OperatorTable.h"     // for isCtorDtor, isCtorDtorAssign
    5050#include "ControlStruct/Mutate.h"      // for ForExprMutator
    51 #include "Common/Stats.h"              // for Stats::Heap
    5251#include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
    5352#include "Common/ScopedMap.h"          // for ScopedMap
     
    304303                PassVisitor<FixQualifiedTypes> fixQual;
    305304
    306                 {
    307                         Stats::Heap::newPass("validate-A");
    308                         Stats::Time::BlockGuard guard("validate-A");
    309                         acceptAll( translationUnit, hoistDecls );
    310                         ReplaceTypedef::replaceTypedef( translationUnit );
    311                         ReturnTypeFixer::fix( translationUnit ); // must happen before autogen
    312                         acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes because it is an indexer and needs correct types for mangling
    313                 }
    314                 {
    315                         Stats::Heap::newPass("validate-B");
    316                         Stats::Time::BlockGuard guard("validate-B");
    317                         Stats::Time::TimeBlock("Link Reference To Types", [&]() {
    318                                 acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
    319                         });
    320                         Stats::Time::TimeBlock("Fix Qualified Types", [&]() {
    321                                 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes, because aggregate members are accessed
    322                         });
    323                         Stats::Time::TimeBlock("Hoist Structs", [&]() {
    324                                 HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order
    325                         });
    326                         Stats::Time::TimeBlock("Eliminate Typedefs", [&]() {
    327                                 EliminateTypedef::eliminateTypedef( translationUnit ); //
    328                         });
    329                 }
    330                 {
    331                         Stats::Heap::newPass("validate-C");
    332                         Stats::Time::BlockGuard guard("validate-C");
    333                         acceptAll( translationUnit, genericParams );  // check as early as possible - can't happen before LinkReferenceToTypes
    334                         VerifyCtorDtorAssign::verify( translationUnit );  // must happen before autogen, because autogen examines existing ctor/dtors
    335                         ReturnChecker::checkFunctionReturns( translationUnit );
    336                         InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen
    337                 }
    338                 {
    339                         Stats::Heap::newPass("validate-D");
    340                         Stats::Time::BlockGuard guard("validate-D");
    341                         Stats::Time::TimeBlock("Apply Concurrent Keywords", [&]() {
    342                                 Concurrency::applyKeywords( translationUnit );
    343                         });
    344                         Stats::Time::TimeBlock("Forall Pointer Decay", [&]() {
    345                                 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution
    346                         });
    347                         Stats::Time::TimeBlock("Hoist Control Declarations", [&]() {
    348                                 ControlStruct::hoistControlDecls( translationUnit );  // hoist initialization out of for statements; must happen before autogenerateRoutines
    349                         });
    350                         Stats::Time::TimeBlock("Generate Autogen routines", [&]() {
    351                                 autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay
    352                         });
    353                 }
    354                 {
    355                         Stats::Heap::newPass("validate-E");
    356                         Stats::Time::BlockGuard guard("validate-E");
    357                         Stats::Time::TimeBlock("Implement Mutex Func", [&]() {
    358                                 Concurrency::implementMutexFuncs( translationUnit );
    359                         });
    360                         Stats::Time::TimeBlock("Implement Thread Start", [&]() {
    361                                 Concurrency::implementThreadStarter( translationUnit );
    362                         });
    363                         Stats::Time::TimeBlock("Compound Literal", [&]() {
    364                                 mutateAll( translationUnit, compoundliteral );
    365                         });
    366                         Stats::Time::TimeBlock("Resolve With Expressions", [&]() {
    367                                 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables
    368                         });
    369                 }
    370                 {
    371                         Stats::Heap::newPass("validate-F");
    372                         Stats::Time::BlockGuard guard("validate-F");
    373                         Stats::Time::TimeBlock("Fix Object Type", [&]() {
    374                                 FixObjectType::fix( translationUnit );
    375                         });
    376                         Stats::Time::TimeBlock("Array Length", [&]() {
    377                                 ArrayLength::computeLength( translationUnit );
    378                         });
    379                         Stats::Time::TimeBlock("Find Special Declarations", [&]() {
    380                                 acceptAll( translationUnit, finder ); // xxx - remove this pass soon
    381                         });
    382                         Stats::Time::TimeBlock("Fix Label Address", [&]() {
    383                                 mutateAll( translationUnit, labelAddrFixer );
    384                         });
    385                         Stats::Time::TimeBlock("Handle Attributes", [&]() {
    386                                 Validate::handleAttributes( translationUnit );
    387                         });
    388                 }
     305                acceptAll( translationUnit, hoistDecls );
     306                ReplaceTypedef::replaceTypedef( translationUnit );
     307                ReturnTypeFixer::fix( translationUnit ); // must happen before autogen
     308                acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes because it is an indexer and needs correct types for mangling
     309                acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
     310                mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes, because aggregate members are accessed
     311                HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order
     312                EliminateTypedef::eliminateTypedef( translationUnit ); //
     313                acceptAll( translationUnit, genericParams );  // check as early as possible - can't happen before LinkReferenceToTypes
     314                VerifyCtorDtorAssign::verify( translationUnit );  // must happen before autogen, because autogen examines existing ctor/dtors
     315                ReturnChecker::checkFunctionReturns( translationUnit );
     316                InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen
     317                Concurrency::applyKeywords( translationUnit );
     318                acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution
     319                ControlStruct::hoistControlDecls( translationUnit );  // hoist initialization out of for statements; must happen before autogenerateRoutines
     320                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay
     321                Concurrency::implementMutexFuncs( translationUnit );
     322                Concurrency::implementThreadStarter( translationUnit );
     323                mutateAll( translationUnit, compoundliteral );
     324                ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables
     325                FixObjectType::fix( translationUnit );
     326                ArrayLength::computeLength( translationUnit );
     327                acceptAll( translationUnit, finder ); // xxx - remove this pass soon
     328                mutateAll( translationUnit, labelAddrFixer );
     329                Validate::handleAttributes( translationUnit );
    389330        }
    390331
Note: See TracChangeset for help on using the changeset viewer.