Changeset 0f9ceacb


Ignore:
Timestamp:
Nov 29, 2019, 2:59:11 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
b798713
Parents:
d4f1521 (diff), 78cdb06 (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' into relaxed_ready

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Lvalue.cc

    rd4f1521 r0f9ceacb  
    6060                }
    6161
    62                 struct ReferenceConversions final : public WithStmtsToAdd {
     62                struct ReferenceConversions final : public WithStmtsToAdd, public WithGuards {
    6363                        Expression * postmutate( CastExpr * castExpr );
    6464                        Expression * postmutate( AddressExpr * addrExpr );
     
    7171
    7272                struct FixIntrinsicResult final : public WithGuards {
     73                        enum {
     74                                NoSkip,
     75                                Skip,
     76                                SkipInProgress
     77                        } skip = NoSkip;
     78
     79                        void premutate( AsmExpr * ) { GuardValue( skip ); skip = Skip; }
     80                        void premutate( ApplicationExpr * ) { GuardValue( skip ); skip = (skip == Skip) ? SkipInProgress : NoSkip; }
     81
     82
    7383                        Expression * postmutate( ApplicationExpr * appExpr );
    7484                        void premutate( FunctionDecl * funcDecl );
     
    162172
    163173                Expression * FixIntrinsicResult::postmutate( ApplicationExpr * appExpr ) {
    164                         if ( isIntrinsicReference( appExpr ) ) {
     174                        if ( skip != SkipInProgress && isIntrinsicReference( appExpr ) ) {
    165175                                // eliminate reference types from intrinsic applications - now they return lvalues
    166176                                ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result );
  • tests/.expect/references.txt

    rd4f1521 r0f9ceacb  
    36363
    37373 9 { 1., 7. }, [1, 2, 3]
     384
    3839Destructing a Y
    3940Destructing a Y
  • tests/references.cfa

    rd4f1521 r0f9ceacb  
    119119                f( 3, a + b, (S){ 1.0, 7.0 }, (int [3]){ 1, 2, 3 } ); // two rvalue to reference
    120120        }
     121
     122        {
     123                int a = 3;
     124                int *p = &a;
     125                asm (
     126                        "incl %[p]\n\t" :
     127                        : [p] "m" (*p)
     128                );
     129                printf("%d\n", a);
     130        }
    121131}
    122132
Note: See TracChangeset for help on using the changeset viewer.