Changeset eba74ba for src/GenPoly


Ignore:
Timestamp:
May 25, 2018, 2:51:06 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
cdc4d43
Parents:
3ef35bd (diff), 58e822a (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 remote-tracking branch 'origin/master' into with_gc

Location:
src/GenPoly
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.cc

    r3ef35bd reba74ba  
    371371                        return is<VoidType>( ap->get_base() ) || is<VoidType>( bp->get_base() )
    372372                                || typesPolyCompatible( ap->get_base(), bp->get_base() );
     373                } else if ( aid == type_index{typeid(ReferenceType)} ) {
     374                        ReferenceType *ap = as<ReferenceType>(a), *bp = as<ReferenceType>(b);
     375                        return is<VoidType>( ap->get_base() ) || is<VoidType>( bp->get_base() )
     376                                || typesPolyCompatible( ap->get_base(), bp->get_base() );
    373377                } else if ( aid == type_index{typeid(ArrayType)} ) {
    374378                        ArrayType *aa = as<ArrayType>(a), *ba = as<ArrayType>(b);
  • src/GenPoly/Lvalue.cc

    r3ef35bd reba74ba  
    165165                        if ( isIntrinsicReference( appExpr ) ) {
    166166                                // eliminate reference types from intrinsic applications - now they return lvalues
    167                                 Type * result = appExpr->result;
    168                                 appExpr->result = result->stripReferences()->clone();
     167                                ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result );
     168                                appExpr->result = result->base->clone();
    169169                                appExpr->result->set_lvalue( true );
    170170                                if ( ! inIntrinsic ) {
     
    181181                void FixIntrinsicResult::premutate( FunctionDecl * funcDecl ) {
    182182                        GuardValue( inIntrinsic );
    183                         inIntrinsic =  funcDecl->linkage == LinkageSpec::Intrinsic;
     183                        inIntrinsic = funcDecl->linkage == LinkageSpec::Intrinsic;
    184184                }
    185185
     
    399399                                        ret = new AddressExpr( ret );
    400400                                }
    401                                 if ( srcType->get_lvalue() && srcType->get_qualifiers() != strict_dynamic_cast<ReferenceType *>( destType )->base->get_qualifiers() ) {
     401                                if ( srcType->get_lvalue() && ! ResolvExpr::typesCompatible( srcType, strict_dynamic_cast<ReferenceType *>( destType )->base, SymTab::Indexer() ) ) {
    402402                                        // must keep cast if cast-to type is different from the actual type
    403403                                        castExpr->arg = ret;
Note: See TracChangeset for help on using the changeset viewer.