Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r522363e r8b11840  
    5656#include "FixFunction.h"               // for FixFunction
    5757#include "Indexer.h"                   // for Indexer
     58#include "InitTweak/GenInit.h"         // for fixReturnStatements
    5859#include "InitTweak/InitTweak.h"       // for isCtorDtorAssign
    5960#include "Parser/LinkageSpec.h"        // for C
     
    150151        /// Replaces array and function types in forall lists by appropriate pointer type and assigns each Object and Function declaration a unique ID.
    151152        struct ForallPointerDecay final {
    152                 void previsit( ObjectDecl *object );
    153                 void previsit( FunctionDecl *func );
     153                void previsit( ObjectDecl * object );
     154                void previsit( FunctionDecl * func );
    154155        };
    155156
     
    268269                acceptAll( translationUnit, genericParams );  // check as early as possible - can't happen before LinkReferenceToTypes
    269270                acceptAll( translationUnit, epc ); // must happen before VerifyCtorDtorAssign, because void return objects should not exist
     271                acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines
    270272                VerifyCtorDtorAssign::verify( translationUnit );  // must happen before autogen, because autogen examines existing ctor/dtors
    271273                Concurrency::applyKeywords( translationUnit );
     
    275277                ReturnChecker::checkFunctionReturns( translationUnit );
    276278                mutateAll( translationUnit, compoundliteral );
    277                 acceptAll( translationUnit, fpd );
    278279                ArrayLength::computeLength( translationUnit );
    279280                acceptAll( translationUnit, finder );
     
    579580
    580581        /// Fix up assertions - flattens assertion lists, removing all trait instances
    581         void forallFixer( Type * func ) {
    582                 for ( TypeDecl * type : func->get_forall() ) {
     582        void forallFixer( std::list< TypeDecl * > & forall, BaseSyntaxNode * node ) {
     583                for ( TypeDecl * type : forall ) {
    583584                        std::list< DeclarationWithType * > asserts;
    584585                        asserts.splice( asserts.end(), type->assertions );
     
    599600                                assertion = assertion->acceptMutator( fixer );
    600601                                if ( fixer.get_isVoid() ) {
    601                                         throw SemanticError( "invalid type void in assertion of function ", func );
     602                                        throw SemanticError( "invalid type void in assertion of function ", node );
    602603                                } // if
    603604                        } // for
     
    607608
    608609        void ForallPointerDecay::previsit( ObjectDecl *object ) {
    609                 forallFixer( object->get_type() );
    610                 if ( PointerType *pointer = dynamic_cast< PointerType * >( object->get_type() ) ) {
    611                         forallFixer( pointer->get_base() );
     610                forallFixer( object->type->forall, object );
     611                if ( PointerType *pointer = dynamic_cast< PointerType * >( object->type ) ) {
     612                        forallFixer( pointer->base->forall, object );
    612613                } // if
    613614                object->fixUniqueId();
     
    615616
    616617        void ForallPointerDecay::previsit( FunctionDecl *func ) {
    617                 forallFixer( func->get_type() );
     618                forallFixer( func->type->forall, func );
    618619                func->fixUniqueId();
    619620        }
Note: See TracChangeset for help on using the changeset viewer.