Changeset 68f9c43 for src/Common


Ignore:
Timestamp:
Mar 16, 2018, 5:15:02 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
8d7bef2
Parents:
6171841
git-author:
Aaron Moss <a3moss@…> (03/16/18 17:04:24)
git-committer:
Aaron Moss <a3moss@…> (03/16/18 17:15:02)
Message:

First pass at delete removal

Location:
src/Common
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.h

    r6171841 r68f9c43  
    152152        virtual void visit( Attribute * attribute ) override final;
    153153
     154        virtual void visit( TypeSubstitution * sub ) final;
     155
    154156        virtual DeclarationWithType * mutate( ObjectDecl * objectDecl ) override final;
    155157        virtual DeclarationWithType * mutate( FunctionDecl * functionDecl ) override final;
  • src/Common/PassVisitor.impl.h

    r6171841 r68f9c43  
    25562556// TypeSubstitution
    25572557template< typename pass_type >
     2558void PassVisitor< pass_type >::visit( TypeSubstitution * node ) {
     2559        VISIT_START( node );
     2560
     2561        for ( auto & p : node->typeEnv ) {
     2562                indexerScopedAccept( p.second, *this );
     2563        }
     2564        for ( auto & p : node->varEnv ) {
     2565                indexerScopedAccept( p.second, *this );
     2566        }
     2567
     2568        VISIT_END( node );
     2569}
     2570
     2571template< typename pass_type >
    25582572TypeSubstitution * PassVisitor< pass_type >::mutate( TypeSubstitution * node ) {
    25592573        MUTATE_START( node );
  • src/Common/module.mk

    r6171841 r68f9c43  
    1818       Common/UniqueName.cc \
    1919       Common/DebugMalloc.cc \
     20       Common/GC.cc \
    2021       Common/Assert.cc
  • src/Common/utility.h

    r6171841 r68f9c43  
    190190
    191191template <typename E, typename UnaryPredicate, template< typename, typename...> class Container, typename... Args >
    192 void filter( Container< E *, Args... > & container, UnaryPredicate pred, bool doDelete ) {
     192void filter( Container< E *, Args... > & container, UnaryPredicate pred ) {
    193193        auto i = begin( container );
    194194        while ( i != end( container ) ) {
    195195                auto it = next( i );
    196196                if ( pred( *i ) ) {
    197                         if ( doDelete ) {
    198                                 delete *i;
    199                         } // if
    200197                        container.erase( i );
    201198                } // if
Note: See TracChangeset for help on using the changeset viewer.