Changeset b82d140 for src/SymTab


Ignore:
Timestamp:
Nov 10, 2020, 12:44:44 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
080b0a1, 883c4d9, f33eab7
Parents:
82a2fed (diff), cdacb73 (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

Location:
src/SymTab
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r82a2fed rb82d140  
    3838#include "SynTree/Type.h"          // for FunctionType, Type, TypeInstType
    3939#include "SynTree/Visitor.h"       // for maybeAccept, Visitor, acceptAll
     40#include "CompilationState.h"
    4041
    4142class Attribute;
     
    346347        void FuncGenerator::resolve( FunctionDecl * dcl ) {
    347348                try {
    348                         ResolvExpr::resolveDecl( dcl, indexer );
     349                        if (!useNewAST) // attempt to delay resolver call
     350                                ResolvExpr::resolveDecl( dcl, indexer );
    349351                        if ( functionNesting == 0 ) {
    350352                                // forward declare if top-level struct, so that
  • src/SymTab/Autogen.h

    r82a2fed rb82d140  
    167167                fExpr->args.emplace_back( dstParam );
    168168
    169                 const ast::Stmt * listInit = srcParam.buildListInit( fExpr );
     169                ast::ptr<ast::Stmt> listInit = srcParam.buildListInit( fExpr );
    170170
    171171                // fetch next set of arguments
  • src/SymTab/Validate.cc

    r82a2fed rb82d140  
    6464#include "Common/UniqueName.h"         // for UniqueName
    6565#include "Common/utility.h"            // for operator+, cloneAll, deleteAll
     66#include "CompilationState.h"          // skip some passes in new-ast build
    6667#include "Concurrency/Keywords.h"      // for applyKeywords
    6768#include "FixFunction.h"               // for FixFunction
     
    368369                                mutateAll( translationUnit, compoundliteral );
    369370                        });
    370                         Stats::Time::TimeBlock("Resolve With Expressions", [&]() {
    371                                 ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables
    372                         });
     371                        if (!useNewAST) {
     372                                Stats::Time::TimeBlock("Resolve With Expressions", [&]() {
     373                                        ResolvExpr::resolveWithExprs( translationUnit ); // must happen before FixObjectType because user-code is resolved and may contain with variables
     374                                });
     375                        }
    373376                }
    374377                {
    375378                        Stats::Heap::newPass("validate-F");
    376379                        Stats::Time::BlockGuard guard("validate-F");
    377                         Stats::Time::TimeCall("Fix Object Type",
    378                                 FixObjectType::fix, translationUnit);
     380                        if (!useNewAST) {
     381                                Stats::Time::TimeCall("Fix Object Type",
     382                                        FixObjectType::fix, translationUnit);
     383                        }
    379384                        Stats::Time::TimeCall("Array Length",
    380385                                ArrayLength::computeLength, translationUnit);
     
    383388                        Stats::Time::TimeCall("Fix Label Address",
    384389                                mutateAll<LabelAddressFixer>, translationUnit, labelAddrFixer);
    385                         Stats::Time::TimeCall("Handle Attributes",
    386                                 Validate::handleAttributes, translationUnit);
     390                        if (!useNewAST) {
     391                                Stats::Time::TimeCall("Handle Attributes",
     392                                        Validate::handleAttributes, translationUnit);
     393                        }
    387394                }
    388395        }
     
    13401347
    13411348        void ArrayLength::previsit( ArrayType * type ) {
    1342                 if ( type->dimension ) {
    1343                         // need to resolve array dimensions early so that constructor code can correctly determine
    1344                         // if a type is a VLA (and hence whether its elements need to be constructed)
    1345                         ResolvExpr::findSingleExpression( type->dimension, Validate::SizeType->clone(), indexer );
    1346 
    1347                         // must re-evaluate whether a type is a VLA, now that more information is available
    1348                         // (e.g. the dimension may have been an enumerator, which was unknown prior to this step)
    1349                         type->isVarLen = ! InitTweak::isConstExpr( type->dimension );
     1349                if (!useNewAST) {
     1350                        if ( type->dimension ) {
     1351                                // need to resolve array dimensions early so that constructor code can correctly determine
     1352                                // if a type is a VLA (and hence whether its elements need to be constructed)
     1353                                ResolvExpr::findSingleExpression( type->dimension, Validate::SizeType->clone(), indexer );
     1354
     1355                                // must re-evaluate whether a type is a VLA, now that more information is available
     1356                                // (e.g. the dimension may have been an enumerator, which was unknown prior to this step)
     1357                                type->isVarLen = ! InitTweak::isConstExpr( type->dimension );
     1358                        }
    13501359                }
    13511360        }
Note: See TracChangeset for help on using the changeset viewer.