Ignore:
Timestamp:
Jul 24, 2019, 10:40:28 AM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
77d2432, 96ac72c
Parents:
6130304 (diff), 8fc15cf (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/ResolvExpr/TypeEnvironment.cc

    r6130304 r83b52f1  
    99// Author           : Richard C. Bilson
    1010// Created On       : Sun May 17 12:19:47 2015
    11 // Last Modified By : Aaron B. Moss
    12 // Last Modified On : Mon Jun 18 11:58:00 2018
    13 // Update Count     : 4
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Fri Jun 18 14:27:00 2019
     13// Update Count     : 5
    1414//
    1515
     
    315315        }
    316316
    317         bool isFtype( Type *type ) {
    318                 if ( dynamic_cast< FunctionType* >( type ) ) {
     317        bool isFtype( const Type * type ) {
     318                if ( dynamic_cast< const FunctionType * >( type ) ) {
    319319                        return true;
    320                 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) {
     320                } else if ( const TypeInstType *typeInst = dynamic_cast< const TypeInstType * >( type ) ) {
    321321                        return typeInst->get_isFtype();
    322322                } // if
     
    324324        }
    325325
    326         bool tyVarCompatible( const TypeDecl::Data & data, Type *type ) {
     326        bool tyVarCompatible( const TypeDecl::Data & data, const Type * type ) {
    327327                switch ( data.kind ) {
    328328                  case TypeDecl::Dtype:
     
    336336                  case TypeDecl::Ttype:
    337337                        // ttype unifies with any tuple type
    338                         return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type );
     338                        return dynamic_cast< const TupleType * >( type ) || Tuples::isTtype( type );
    339339                  default:
    340340                        assertf(false, "Unhandled tyvar kind: %d", data.kind);
     
    343343        }
    344344
    345         bool TypeEnvironment::bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer ) {
     345        bool TypeEnvironment::bindVar( const TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer ) {
    346346
    347347                // remove references from other, so that type variables can only bind to value types
     
    361361                                // attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to
    362362                                std::unique_ptr< Type > newType( curClass->type->clone() );
    363                                 newType->get_qualifiers() = typeInst->get_qualifiers();
     363                                newType->tq = typeInst->tq;
    364364                                if ( unifyInexact( newType.get(), bindTo, *this, need, have, openVars, widen & WidenMode( curClass->allowWidening, true ), indexer, common ) ) {
    365365                                        if ( common ) {
     
    386386        }
    387387
    388         bool TypeEnvironment::bindVarToVar( TypeInstType *var1, TypeInstType *var2,
    389                         TypeDecl::Data && data, AssertionSet &need, AssertionSet &have, 
     388        bool TypeEnvironment::bindVarToVar( const TypeInstType * var1, const TypeInstType * var2,
     389                        TypeDecl::Data && data, AssertionSet &need, AssertionSet &have,
    390390                        const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer ) {
    391391
Note: See TracChangeset for help on using the changeset viewer.