Ignore:
Timestamp:
Jul 27, 2018, 2:41:34 PM (5 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env
Children:
6fa409e
Parents:
5a3e1f1
Message:

Fix open var handling in BF assn resolution; memory usage reasonable again

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/TypeEnvironment.h

    r5a3e1f1 r1a59641  
    7878        typedef std::map< std::string, TypeDecl::Data > OpenVarSet;
    7979
     80        /// merges one set of open vars into another
     81        static inline void mergeOpenVars( OpenVarSet& dst, const OpenVarSet& src ) {
     82                for ( const auto& entry : src ) { dst[ entry.first ] = entry.second; }
     83        }
     84
    8085        void printAssertionSet( const AssertionSet &, std::ostream &, int indent = 0 );
    8186        void printOpenVarSet( const OpenVarSet &, std::ostream &, int indent = 0 );
     
    138143        };
    139144
     145        //#define EXPENSIVE_ENV_VALIDATION
     146        #ifdef EXPENSIVE_ENV_VALIDATION
    140147        class ValidateGuard;
     148        #endif
    141149
    142150        class TypeEnvironment {
     
    156164                Bindings* bindings;
    157165
    158                 // for debugging
     166                #ifdef EXPENSIVE_ENV_VALIDATION
     167                /// for debugging
    159168                friend ValidateGuard;
    160169                const char* last_fn = "<none>";
     170                #endif
    161171
    162172                /// Merges the classes rooted at root1 and root2, returning a pair containing the root and
     
    225235                /// from the same initial environment.
    226236                /// Returns false if unsuccessful, but does NOT roll back partial changes
    227                 bool combine( const TypeEnvironment& o, const SymTab::Indexer& indexer );
     237                bool combine( const TypeEnvironment& o, OpenVarSet& openVars,
     238                        const SymTab::Indexer& indexer );
    228239       
    229240                void extractOpenVars( OpenVarSet &openVars ) const;
Note: See TracChangeset for help on using the changeset viewer.