Ignore:
Timestamp:
Jan 18, 2019, 3:49:02 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
4cf2472, c018b85
Parents:
95b8aa7
Message:

Add type-environment cached deferred resolution

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Mangler.cc

    r95b8aa7 re1f7eef  
    6969                                typedef std::map< std::string, std::pair< std::string, int > > VarMapType;
    7070                                VarMapType varNums;             ///< Map of type variables to indices
     71                                int nextVarNum;                 ///< Next type variable index
    7172                                const ResolvExpr::TypeEnvironment* env;  ///< optional environment for substitutions
    72                                 int nextVarNum;                 ///< Next type variable index
    7373                                bool isTopLevel;                ///< Is the Mangler at the top level
    7474                                bool mangleOverridable;         ///< Specially mangle overridable built-in methods
     
    7878                                bool inQualifiedType = false;   ///< Add start/end delimiters around qualified type
    7979
     80                          public:
    8081                                Mangler( bool mangleOverridable, bool typeMode, bool mangleGenericParams,
    8182                                        int nextVarNum, const ResolvExpr::TypeEnvironment* env,
    8283                                        const VarMapType& varNums );
    8384
     85                          private:
    8486                                void mangleDecl( DeclarationWithType *declaration );
    8587                                void mangleRef( ReferenceToType *refType, std::string prefix );
     
    127129                                int nextVarNum, const ResolvExpr::TypeEnvironment* env,
    128130                                const VarMapType& varNums )
    129                                 : nextVarNum( nextVarNum ), varNums( varNums ), env( env ), isTopLevel( false ),
     131                                : varNums( varNums ), nextVarNum( nextVarNum ), env( env ), isTopLevel( false ),
    130132                                mangleOverridable( mangleOverridable ), typeMode( typeMode ),
    131133                                mangleGenericParams( mangleGenericParams ) {}
     
    359361                                                // replace type with substitution name if environment is available and bound
    360362                                                if ( env ) {
    361                                                         const EqvClass* varClass = env->lookup( (*i)->name );
     363                                                        const ResolvExpr::EqvClass* varClass = env->lookup( (*i)->name );
    362364                                                        if ( varClass && varClass->type ) {
    363365                                                                PassVisitor<Mangler> sub_mangler(
Note: See TracChangeset for help on using the changeset viewer.