Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.h

    rc8837e5 r3606fe4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Oct  7 15:06:00 2022
    13 // Update Count     : 9
     12// Last Modified On : Fri Aug 19 16:03:00 2022
     13// Update Count     : 8
    1414//
    1515
     
    2020
    2121#include "ErasableScopedMap.h"    // for ErasableScopedMap
    22 #include "AST/Decl.hpp"           // for TypeDecl::Data
    23 #include "AST/Fwd.hpp"            // for ApplicationExpr, BaseInstType, Func...
     22#include "AST/Fwd.hpp"
    2423#include "SymTab/Mangler.h"       // for Mangler
    2524#include "SynTree/Declaration.h"  // for TypeDecl::Data, AggregateDecl, Type...
     
    3029        // TODO Via some tricks this works for ast::TypeDecl::Data as well.
    3130        typedef ErasableScopedMap< std::string, TypeDecl::Data > TyVarMap;
    32         using TypeVarMap = ErasableScopedMap< std::string, ast::TypeDecl::Data >;
    3331
    3432        /// Replaces a TypeInstType by its referrent in the environment, if applicable
     
    4139        /// returns polymorphic type if is polymorphic type in tyVars, NULL otherwise; will look up substitution in env if provided
    4240        Type *isPolyType( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env = 0 );
    43         const ast::Type * isPolyType( const ast::Type * type, const TypeVarMap & typeVars, const ast::TypeSubstitution * subst = nullptr );
     41        const ast::Type * isPolyType(const ast::Type * type, const TyVarMap & tyVars, const ast::TypeSubstitution * env = nullptr);
    4442
    4543        /// returns dynamic-layout type if is dynamic-layout type in tyVars, NULL otherwise; will look up substitution in env if provided
    4644        ReferenceToType *isDynType( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env = 0 );
    47         const ast::BaseInstType *isDynType( const ast::Type * type, const TypeVarMap & typeVars, const ast::TypeSubstitution * subst = 0 );
     45        const ast::BaseInstType *isDynType( const ast::Type *type, const TyVarMap &tyVars, const ast::TypeSubstitution *typeSubs = 0 );
    4846
    4947        /// true iff function has dynamic-layout return type under the given type variable map
    5048        ReferenceToType *isDynRet( FunctionType *function, const TyVarMap &tyVars );
    51         const ast::BaseInstType *isDynRet( const ast::FunctionType * type, const TypeVarMap & typeVars );
    5249
    5350        /// true iff function has dynamic-layout return type under the type variable map generated from its forall-parameters
     
    5653        /// A function needs an adapter if it returns a dynamic-layout value or if any of its parameters have dynamic-layout type
    5754        bool needsAdapter( FunctionType *adaptee, const TyVarMap &tyVarr );
    58         bool needsAdapter( ast::FunctionType const * adaptee, const TypeVarMap & typeVars );
    5955
    6056        /// returns polymorphic type if is pointer to polymorphic type, NULL otherwise; will look up substitution in env if provided
     
    6359        /// returns polymorphic type if is pointer to polymorphic type in tyVars, NULL otherwise; will look up substitution in env if provided
    6460        Type *isPolyPtr( Type *type, const TyVarMap &tyVars, const TypeSubstitution *env = 0 );
    65         const ast::Type * isPolyPtr( const ast::Type * type, const TypeVarMap & typeVars, const ast::TypeSubstitution * env = 0 );
    6661
    6762        /// if the base type (after dereferencing N >= 0 pointers) is a polymorphic type, returns the base type, NULL otherwise;
     
    7267        /// N will be stored in levels, if provided, will look up substitution in env if provided
    7368        Type *hasPolyBase( Type *type, const TyVarMap &tyVars, int *levels = 0, const TypeSubstitution *env = 0 );
    74         const ast::Type * hasPolyBase( const ast::Type * type, const TypeVarMap & typeVars, int * levels = 0, const ast::TypeSubstitution * env = 0 );
    7569
    7670        /// true iff this type or some base of this type after dereferencing pointers is either polymorphic or a generic type with at least one
     
    9690        /// true if arg requires boxing given exprTyVars
    9791        bool needsBoxing( Type * param, Type * arg, const TyVarMap &exprTyVars, const TypeSubstitution * env );
    98         bool needsBoxing( const ast::Type * param, const ast::Type * arg, const TypeVarMap & typeVars, const ast::TypeSubstitution * subst );
     92        bool needsBoxing( const ast::Type * param, const ast::Type * arg, const TyVarMap &exprTyVars, const ast::TypeSubstitution * env);
    9993
    10094        /// true if arg requires boxing in the call to appExpr
    10195        bool needsBoxing( Type * param, Type * arg, ApplicationExpr * appExpr, const TypeSubstitution * env );
    102         bool needsBoxing( const ast::Type * param, const ast::Type * arg, const ast::ApplicationExpr * expr, const ast::TypeSubstitution * subst );
     96        bool needsBoxing( const ast::Type * param, const ast::Type * arg, const ast::ApplicationExpr * appExpr, const ast::TypeSubstitution * env);
    10397
    10498        /// Adds the type variable `tyVar` to `tyVarMap`
    10599        void addToTyVarMap( TypeDecl * tyVar, TyVarMap &tyVarMap );
    106         void addToTypeVarMap( const ast::TypeDecl * type, TypeVarMap & typeVars );
    107100
    108101        /// Adds the declarations in the forall list of type (and its pointed-to type if it's a pointer type) to `tyVarMap`
    109102        void makeTyVarMap( Type *type, TyVarMap &tyVarMap );
    110         void makeTypeVarMap( const ast::Type * type, TypeVarMap & typeVars );
     103        void makeTyVarMap(const ast::Type * type, TyVarMap & tyVarMap);
    111104
    112105        /// Prints type variable map
    113106        void printTyVarMap( std::ostream &os, const TyVarMap &tyVarMap );
    114         void printTypeVarMap( std::ostream &os, const TypeVarMap & typeVars );
    115107
    116108        /// Gets the mangled name of this type; alias for SymTab::Mangler::mangleType().
Note: See TracChangeset for help on using the changeset viewer.