Ignore:
Timestamp:
Oct 28, 2019, 4:28:37 PM (4 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:
8364209
Parents:
c921712 (diff), 9bdb8b7 (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

    rc921712 rc3a2007  
    8181#include "SynTree/Label.h"             // for operator==, Label
    8282#include "SynTree/Mutator.h"           // for Mutator
    83 #include "SynTree/TopLvalue.h"         // for assertTopLvalue, clearInnerLvalue
    8483#include "SynTree/Type.h"              // for Type, TypeInstType, EnumInstType
    8584#include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
     
    309308                PassVisitor<FixQualifiedTypes> fixQual;
    310309
    311                 assertTopLvalue( translationUnit );
    312310                {
    313311                        Stats::Heap::newPass("validate-A");
     
    318316                        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
    319317                }
    320                 assertTopLvalue( translationUnit );
    321318                {
    322319                        Stats::Heap::newPass("validate-B");
    323320                        Stats::Time::BlockGuard guard("validate-B");
    324                         assertTopLvalue( translationUnit );
    325321                        Stats::Time::TimeBlock("Link Reference To Types", [&]() {
    326322                                acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
    327323                        });
    328                         clearInnerLvalue( translationUnit );
    329                         assertTopLvalue( translationUnit );
    330324                        Stats::Time::TimeBlock("Fix Qualified Types", [&]() {
    331325                                mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes_old, because aggregate members are accessed
    332326                        });
    333                         assertTopLvalue( translationUnit );
    334327                        Stats::Time::TimeBlock("Hoist Structs", [&]() {
    335328                                HoistStruct::hoistStruct( translationUnit ); // must happen after EliminateTypedef, so that aggregate typedefs occur in the correct order
    336329                        });
    337                         assertTopLvalue( translationUnit );
    338330                        Stats::Time::TimeBlock("Eliminate Typedefs", [&]() {
    339331                                EliminateTypedef::eliminateTypedef( translationUnit ); //
    340332                        });
    341333                }
    342                 assertTopLvalue( translationUnit );
    343334                {
    344335                        Stats::Heap::newPass("validate-C");
     
    349340                        InitTweak::fixReturnStatements( translationUnit ); // must happen before autogen
    350341                }
    351                 assertTopLvalue( translationUnit );
    352342                {
    353343                        Stats::Heap::newPass("validate-D");
    354344                        Stats::Time::BlockGuard guard("validate-D");
    355                         assertTopLvalue( translationUnit );
    356345                        Stats::Time::TimeBlock("Apply Concurrent Keywords", [&]() {
    357346                                Concurrency::applyKeywords( translationUnit );
    358347                        });
    359                         clearInnerLvalue( translationUnit );
    360                         assertTopLvalue( translationUnit );
    361348                        Stats::Time::TimeBlock("Forall Pointer Decay", [&]() {
    362349                                acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines, after Concurrency::applyKeywords because uniqueIds must be set on declaration before resolution
    363350                        });
    364                         assertTopLvalue( translationUnit );
    365351                        Stats::Time::TimeBlock("Hoist Control Declarations", [&]() {
    366352                                ControlStruct::hoistControlDecls( translationUnit );  // hoist initialization out of for statements; must happen before autogenerateRoutines
    367353                        });
    368                         assertTopLvalue( translationUnit );
    369354                        Stats::Time::TimeBlock("Generate Autogen routines", [&]() {
    370355                                autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecay_old
    371356                        });
    372                         clearInnerLvalue( translationUnit );
    373                 }
    374                 assertTopLvalue( translationUnit );
     357                }
    375358                {
    376359                        Stats::Heap::newPass("validate-E");
    377360                        Stats::Time::BlockGuard guard("validate-E");
    378                         assertTopLvalue( translationUnit );
    379361                        Stats::Time::TimeBlock("Implement Mutex Func", [&]() {
    380362                                Concurrency::implementMutexFuncs( translationUnit );
    381363                        });
    382                         clearInnerLvalue( translationUnit );
    383                         assertTopLvalue( translationUnit );
    384364                        Stats::Time::TimeBlock("Implement Thread Start", [&]() {
    385365                                Concurrency::implementThreadStarter( translationUnit );
    386366                        });
    387                         assertTopLvalue( translationUnit );
    388367                        Stats::Time::TimeBlock("Compound Literal", [&]() {
    389368                                mutateAll( translationUnit, compoundliteral );
    390369                        });
    391                         assertTopLvalue( translationUnit );
    392370                        Stats::Time::TimeBlock("Resolve With Expressions", [&]() {
    393371                                ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables
    394372                        });
    395                         clearInnerLvalue( translationUnit );
    396                 }
    397                 assertTopLvalue( translationUnit );
     373                }
    398374                {
    399375                        Stats::Heap::newPass("validate-F");
    400376                        Stats::Time::BlockGuard guard("validate-F");
    401                         assertTopLvalue( translationUnit );
    402377                        Stats::Time::TimeBlock("Fix Object Type", [&]() {
    403378                                FixObjectType::fix( translationUnit );
    404379                        });
    405                         assertTopLvalue( translationUnit );
    406380                        Stats::Time::TimeBlock("Array Length", [&]() {
    407381                                ArrayLength::computeLength( translationUnit );
    408382                        });
    409                         clearInnerLvalue( translationUnit );
    410                         assertTopLvalue( translationUnit );
    411383                        Stats::Time::TimeBlock("Find Special Declarations", [&]() {
    412384                                Validate::findSpecialDecls( translationUnit );
    413385                        });
    414                         assertTopLvalue( translationUnit );
    415386                        Stats::Time::TimeBlock("Fix Label Address", [&]() {
    416387                                mutateAll( translationUnit, labelAddrFixer );
    417388                        });
    418                         assertTopLvalue( translationUnit );
    419389                        Stats::Time::TimeBlock("Handle Attributes", [&]() {
    420390                                Validate::handleAttributes( translationUnit );
    421391                        });
    422392                }
    423                 assertTopLvalue( translationUnit );
    424393        }
    425394
     
    13341303        void FixObjectType::previsit( ObjectDecl * objDecl ) {
    13351304                Type * new_type = ResolvExpr::resolveTypeof( objDecl->get_type(), indexer );
    1336                 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type
    13371305                objDecl->set_type( new_type );
    13381306        }
     
    13401308        void FixObjectType::previsit( FunctionDecl * funcDecl ) {
    13411309                Type * new_type = ResolvExpr::resolveTypeof( funcDecl->type, indexer );
    1342                 new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type
    13431310                funcDecl->set_type( new_type );
    13441311        }
     
    13471314                if ( typeDecl->get_base() ) {
    13481315                        Type * new_type = ResolvExpr::resolveTypeof( typeDecl->get_base(), indexer );
    1349                         new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type
    13501316                        typeDecl->set_base( new_type );
    13511317                } // if
Note: See TracChangeset for help on using the changeset viewer.