Ignore:
Timestamp:
Apr 6, 2020, 4:46:28 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
e3bc51c
Parents:
71d6bd8 (diff), 057298e (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 new-ast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Lvalue.cc

    r71d6bd8 r7030dab  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 17 09:11:18 2017
    13 // Update Count     : 5
     12// Last Modified On : Fri Dec 13 23:14:38 2019
     13// Update Count     : 7
    1414//
    1515
     
    1717#include <string>                        // for string
    1818
     19#include "Common/UniqueName.h"
    1920#include "Common/PassVisitor.h"
    2021#include "GenPoly.h"                     // for isPolyType
     
    2223
    2324#include "InitTweak/InitTweak.h"
    24 #include "Parser/LinkageSpec.h"          // for Spec, isBuiltin, Intrinsic
    2525#include "ResolvExpr/TypeEnvironment.h"  // for AssertionSet, OpenVarSet
    2626#include "ResolvExpr/Unify.h"            // for unify
    2727#include "ResolvExpr/typeops.h"
    2828#include "SymTab/Indexer.h"              // for Indexer
     29#include "SynTree/LinkageSpec.h"         // for Spec, isBuiltin, Intrinsic
    2930#include "SynTree/Declaration.h"         // for Declaration, FunctionDecl
    3031#include "SynTree/Expression.h"          // for Expression, ConditionalExpr
     
    6061                }
    6162
    62                 struct ReferenceConversions final : public WithStmtsToAdd {
     63                struct ReferenceConversions final : public WithStmtsToAdd, public WithGuards {
    6364                        Expression * postmutate( CastExpr * castExpr );
    6465                        Expression * postmutate( AddressExpr * addrExpr );
     
    7172
    7273                struct FixIntrinsicResult final : public WithGuards {
     74                        enum {
     75                                NoSkip,
     76                                Skip,
     77                                SkipInProgress
     78                        } skip = NoSkip;
     79
     80                        void premutate( AsmExpr * ) { GuardValue( skip ); skip = Skip; }
     81                        void premutate( ApplicationExpr * ) { GuardValue( skip ); skip = (skip == Skip) ? SkipInProgress : NoSkip; }
     82
     83
    7384                        Expression * postmutate( ApplicationExpr * appExpr );
    7485                        void premutate( FunctionDecl * funcDecl );
     
    162173
    163174                Expression * FixIntrinsicResult::postmutate( ApplicationExpr * appExpr ) {
    164                         if ( isIntrinsicReference( appExpr ) ) {
     175                        if ( skip != SkipInProgress && isIntrinsicReference( appExpr ) ) {
    165176                                // eliminate reference types from intrinsic applications - now they return lvalues
    166177                                ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result );
Note: See TracChangeset for help on using the changeset viewer.