Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r60c3b06c r522363e  
    5656#include "FixFunction.h"               // for FixFunction
    5757#include "Indexer.h"                   // for Indexer
    58 #include "InitTweak/GenInit.h"         // for fixReturnStatements
    5958#include "InitTweak/InitTweak.h"       // for isCtorDtorAssign
    6059#include "Parser/LinkageSpec.h"        // for C
     
    151150        /// Replaces array and function types in forall lists by appropriate pointer type and assigns each Object and Function declaration a unique ID.
    152151        struct ForallPointerDecay final {
    153                 void previsit( ObjectDecl * object );
    154                 void previsit( FunctionDecl * func );
     152                void previsit( ObjectDecl *object );
     153                void previsit( FunctionDecl *func );
    155154        };
    156155
     
    580579
    581580        /// Fix up assertions - flattens assertion lists, removing all trait instances
    582         void forallFixer( std::list< TypeDecl * > & forall, BaseSyntaxNode * node ) {
    583                 for ( TypeDecl * type : forall ) {
     581        void forallFixer( Type * func ) {
     582                for ( TypeDecl * type : func->get_forall() ) {
    584583                        std::list< DeclarationWithType * > asserts;
    585584                        asserts.splice( asserts.end(), type->assertions );
     
    600599                                assertion = assertion->acceptMutator( fixer );
    601600                                if ( fixer.get_isVoid() ) {
    602                                         throw SemanticError( "invalid type void in assertion of function ", node );
     601                                        throw SemanticError( "invalid type void in assertion of function ", func );
    603602                                } // if
    604603                        } // for
     
    608607
    609608        void ForallPointerDecay::previsit( ObjectDecl *object ) {
    610                 forallFixer( object->type->forall, object );
    611                 if ( PointerType *pointer = dynamic_cast< PointerType * >( object->type ) ) {
    612                         forallFixer( pointer->base->forall, object );
     609                forallFixer( object->get_type() );
     610                if ( PointerType *pointer = dynamic_cast< PointerType * >( object->get_type() ) ) {
     611                        forallFixer( pointer->get_base() );
    613612                } // if
    614613                object->fixUniqueId();
     
    616615
    617616        void ForallPointerDecay::previsit( FunctionDecl *func ) {
    618                 forallFixer( func->type->forall, func );
     617                forallFixer( func->get_type() );
    619618                func->fixUniqueId();
    620619        }
Note: See TracChangeset for help on using the changeset viewer.