Ignore:
Timestamp:
Nov 14, 2022, 11:52:44 AM (3 years ago)
Author:
caparson <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
7d9598d8
Parents:
b77f0e1 (diff), 19a8c40 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.h

    rb77f0e1 r63be3387  
    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 : Mon Oct 24 15:18:00 2022
     13// Update Count     : 11
    1414//
    1515
     
    2222#include "AST/Decl.hpp"           // for TypeDecl::Data
    2323#include "AST/Fwd.hpp"            // for ApplicationExpr, BaseInstType, Func...
     24#include "AST/Type.hpp"           // for TypeInstType::TypeEnvKey
    2425#include "SymTab/Mangler.h"       // for Mangler
    2526#include "SynTree/Declaration.h"  // for TypeDecl::Data, AggregateDecl, Type...
     
    2829namespace GenPoly {
    2930
    30         // TODO Via some tricks this works for ast::TypeDecl::Data as well.
    3131        typedef ErasableScopedMap< std::string, TypeDecl::Data > TyVarMap;
    32         using TypeVarMap = ErasableScopedMap< std::string, ast::TypeDecl::Data >;
     32        using TypeVarMap = ErasableScopedMap< ast::TypeInstType::TypeEnvKey, ast::TypeDecl::Data >;
    3333
    3434        /// Replaces a TypeInstType by its referrent in the environment, if applicable
    3535        Type* replaceTypeInst( Type* type, const TypeSubstitution* env );
     36        const Type* replaceTypeInst( const Type* type, const TypeSubstitution* env );
     37        const ast::Type * replaceTypeInst( const ast::Type *, const ast::TypeSubstitution * );
    3638
    3739        /// returns polymorphic type if is polymorphic type, NULL otherwise; will look up substitution in env if provided
     
    5355        /// true iff function has dynamic-layout return type under the type variable map generated from its forall-parameters
    5456        ReferenceToType *isDynRet( FunctionType *function );
     57        const ast::BaseInstType *isDynRet( const ast::FunctionType * func );
    5558
    5659        /// A function needs an adapter if it returns a dynamic-layout value or if any of its parameters have dynamic-layout type
     
    112115        /// Prints type variable map
    113116        void printTyVarMap( std::ostream &os, const TyVarMap &tyVarMap );
    114         void printTypeVarMap( std::ostream &os, const TypeVarMap & typeVars );
    115117
    116118        /// Gets the mangled name of this type; alias for SymTab::Mangler::mangleType().
    117         inline std::string mangleType( Type *ty ) { return SymTab::Mangler::mangleType( ty ); }
     119        inline std::string mangleType( const Type *ty ) { return SymTab::Mangler::mangleType( ty ); }
    118120
    119121        /// Gets the name of the sizeof parameter for the type, given its mangled name
     
    128130        /// Gets the name of the layout function for a given aggregate type, given its declaration
    129131        inline std::string layoutofName( AggregateDecl *decl ) { return std::string( "_layoutof_" ) + decl->get_name(); }
     132        inline std::string layoutofName( ast::AggregateDecl const * decl ) {
     133                return std::string( "_layoutof_" ) + decl->name;
     134        }
    130135
    131136} // namespace GenPoly
Note: See TracChangeset for help on using the changeset viewer.