Ignore:
Timestamp:
Feb 25, 2020, 1:17:33 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
7dc2e015
Parents:
9fb8f01 (diff), dd9e1ca (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:

resolve conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Lvalue.cc

    r9fb8f01 r3d5701e  
    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
     
    5455                                delete ret->result;
    5556                                ret->result = base->clone();
    56                                 ret->result->set_lvalue( true );
    5757                                return ret;
    5858                        } else {
     
    6161                }
    6262
    63                 struct ReferenceConversions final : public WithStmtsToAdd {
     63                struct ReferenceConversions final : public WithStmtsToAdd, public WithGuards {
    6464                        Expression * postmutate( CastExpr * castExpr );
    6565                        Expression * postmutate( AddressExpr * addrExpr );
     
    7272
    7373                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
    7484                        Expression * postmutate( ApplicationExpr * appExpr );
    7585                        void premutate( FunctionDecl * funcDecl );
     
    163173
    164174                Expression * FixIntrinsicResult::postmutate( ApplicationExpr * appExpr ) {
    165                         if ( isIntrinsicReference( appExpr ) ) {
     175                        if ( skip != SkipInProgress && isIntrinsicReference( appExpr ) ) {
    166176                                // eliminate reference types from intrinsic applications - now they return lvalues
    167177                                ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result );
    168178                                appExpr->result = result->base->clone();
    169                                 appExpr->result->set_lvalue( true );
    170179                                if ( ! inIntrinsic ) {
    171180                                        // when not in an intrinsic function, add a cast to
     
    436445                                delete ret->result;
    437446                                ret->result = castExpr->result;
    438                                 ret->result->set_lvalue( true ); // ensure result is lvalue
     447                                assert( ret->get_lvalue() ); // ensure result is lvalue
    439448                                castExpr->env = nullptr;
    440449                                castExpr->arg = nullptr;
Note: See TracChangeset for help on using the changeset viewer.