Ignore:
Timestamp:
Aug 12, 2019, 11:05:36 AM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
dee1f89
Parents:
cc4218f (diff), 4f5a8a2 (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/SymTab/Validate.cc

    rcc4218f rb3976bf  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 21:50:04 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Aug 28 13:47:23 2017
    13 // Update Count     : 359
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Aug  7 6:42:00 2019
     13// Update Count     : 360
    1414//
    1515
     
    8181#include "SynTree/Label.h"             // for operator==, Label
    8282#include "SynTree/Mutator.h"           // for Mutator
     83#include "SynTree/TopLvalue.h"         // for assertTopLvalue, clearInnerLvalue
    8384#include "SynTree/Type.h"              // for Type, TypeInstType, EnumInstType
    8485#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
     
    308309                PassVisitor<FixQualifiedTypes> fixQual;
    309310
     311                assertTopLvalue( translationUnit );
    310312                {
    311313                        Stats::Heap::newPass("validate-A");
     
    316318                        acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist; before LinkReferenceToTypes_old because it is an indexer and needs correct types for mangling
    317319                }
     320                assertTopLvalue( translationUnit );
    318321                {
    319322                        Stats::Heap::newPass("validate-B");
    320323                        Stats::Time::BlockGuard guard("validate-B");
     324                        assertTopLvalue( translationUnit );
    321325                        Stats::Time::TimeBlock("Link Reference To Types", [&]() {
    322326                                acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
    323327                        });
     328                        clearInnerLvalue( translationUnit );
     329                        assertTopLvalue( translationUnit );
    324330                        Stats::Time::TimeBlock("Fix Qualified Types", [&]() {
    325331                                mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes_old, because aggregate members are accessed
    326332                        });
     333                        assertTopLvalue( translationUnit );
    327334                        Stats::Time::TimeBlock("Hoist Structs", [&]() {
    328335                                HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order
    329336                        });
     337                        assertTopLvalue( translationUnit );
    330338                        Stats::Time::TimeBlock("Eliminate Typedefs", [&]() {
    331339                                EliminateTypedef::eliminateTypedef( translationUnit ); //
    332340                        });
    333341                }
     342                assertTopLvalue( translationUnit );
    334343                {
    335344                        Stats::Heap::newPass("validate-C");
     
    340349                        InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen
    341350                }
     351                assertTopLvalue( translationUnit );
    342352                {
    343353                        Stats::Heap::newPass("validate-D");
    344354                        Stats::Time::BlockGuard guard("validate-D");
     355                        assertTopLvalue( translationUnit );
    345356                        Stats::Time::TimeBlock("Apply Concurrent Keywords", [&]() {
    346357                                Concurrency::applyKeywords( translationUnit );
    347358                        });
     359                        clearInnerLvalue( translationUnit );
     360                        assertTopLvalue( translationUnit );
    348361                        Stats::Time::TimeBlock("Forall Pointer Decay", [&]() {
    349362                                acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution
    350363                        });
     364                        assertTopLvalue( translationUnit );
    351365                        Stats::Time::TimeBlock("Hoist Control Declarations", [&]() {
    352366                                ControlStruct::hoistControlDecls( translationUnit );  // hoist initialization out of for statements; must happen before autogenerateRoutines
    353367                        });
     368                        assertTopLvalue( translationUnit );
    354369                        Stats::Time::TimeBlock("Generate Autogen routines", [&]() {
    355370                                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay_old
    356371                        });
    357                 }
     372                        clearInnerLvalue( translationUnit );
     373                }
     374                assertTopLvalue( translationUnit );
    358375                {
    359376                        Stats::Heap::newPass("validate-E");
    360377                        Stats::Time::BlockGuard guard("validate-E");
     378                        assertTopLvalue( translationUnit );
    361379                        Stats::Time::TimeBlock("Implement Mutex Func", [&]() {
    362380                                Concurrency::implementMutexFuncs( translationUnit );
    363381                        });
     382                        clearInnerLvalue( translationUnit );
     383                        assertTopLvalue( translationUnit );
    364384                        Stats::Time::TimeBlock("Implement Thread Start", [&]() {
    365385                                Concurrency::implementThreadStarter( translationUnit );
    366386                        });
     387                        assertTopLvalue( translationUnit );
    367388                        Stats::Time::TimeBlock("Compound Literal", [&]() {
    368389                                mutateAll( translationUnit, compoundliteral );
    369390                        });
     391                        assertTopLvalue( translationUnit );
    370392                        Stats::Time::TimeBlock("Resolve With Expressions", [&]() {
    371393                                ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables
    372394                        });
    373                 }
     395                        clearInnerLvalue( translationUnit );
     396                }
     397                assertTopLvalue( translationUnit );
    374398                {
    375399                        Stats::Heap::newPass("validate-F");
    376400                        Stats::Time::BlockGuard guard("validate-F");
     401                        assertTopLvalue( translationUnit );
    377402                        Stats::Time::TimeBlock("Fix Object Type", [&]() {
    378403                                FixObjectType::fix( translationUnit );
    379404                        });
     405                        assertTopLvalue( translationUnit );
    380406                        Stats::Time::TimeBlock("Array Length", [&]() {
    381407                                ArrayLength::computeLength( translationUnit );
    382408                        });
     409                        clearInnerLvalue( translationUnit );
     410                        assertTopLvalue( translationUnit );
    383411                        Stats::Time::TimeBlock("Find Special Declarations", [&]() {
    384412                                Validate::findSpecialDecls( translationUnit );
    385413                        });
     414                        assertTopLvalue( translationUnit );
    386415                        Stats::Time::TimeBlock("Fix Label Address", [&]() {
    387416                                mutateAll( translationUnit, labelAddrFixer );
    388417                        });
     418                        assertTopLvalue( translationUnit );
    389419                        Stats::Time::TimeBlock("Handle Attributes", [&]() {
    390420                                Validate::handleAttributes( translationUnit );
    391421                        });
    392422                }
     423                assertTopLvalue( translationUnit );
    393424        }
    394425
Note: See TracChangeset for help on using the changeset viewer.