Changeset 21bdce2 for src/GenPoly


Ignore:
Timestamp:
May 21, 2018, 10:52:15 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
2f0a0678
Parents:
b12c036 (diff), 1596726 (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 plg2:software/cfa/cfa-cc

Location:
src/GenPoly
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.cc

    rb12c036 r21bdce2  
    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

    rb12c036 r21bdce2  
    166166                        if ( isIntrinsicReference( appExpr ) ) {
    167167                                // eliminate reference types from intrinsic applications - now they return lvalues
    168                                 Type * result = appExpr->result;
    169                                 appExpr->result = result->stripReferences()->clone();
     168                                ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result );
     169                                appExpr->result = result->base->clone();
    170170                                appExpr->result->set_lvalue( true );
    171171                                if ( ! inIntrinsic ) {
     
    183183                void FixIntrinsicResult::premutate( FunctionDecl * funcDecl ) {
    184184                        GuardValue( inIntrinsic );
    185                         inIntrinsic =  funcDecl->linkage == LinkageSpec::Intrinsic;
     185                        inIntrinsic = funcDecl->linkage == LinkageSpec::Intrinsic;
    186186                }
    187187
     
    403403                                        ret = new AddressExpr( ret );
    404404                                }
    405                                 if ( srcType->get_lvalue() && srcType->get_qualifiers() != strict_dynamic_cast<ReferenceType *>( destType )->base->get_qualifiers() ) {
     405                                if ( srcType->get_lvalue() && ! ResolvExpr::typesCompatible( srcType, strict_dynamic_cast<ReferenceType *>( destType )->base, SymTab::Indexer() ) ) {
    406406                                        // must keep cast if cast-to type is different from the actual type
    407407                                        castExpr->arg = ret;
Note: See TracChangeset for help on using the changeset viewer.