Changes in src/GenPoly/Lvalue.cc [07de76b:2d80111]
- File:
-
- 1 edited
-
src/GenPoly/Lvalue.cc (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Lvalue.cc
r07de76b r2d80111 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 13 23:14:38 201913 // Update Count : 712 // Last Modified On : Fri Mar 17 09:11:18 2017 13 // Update Count : 5 14 14 // 15 15 … … 17 17 #include <string> // for string 18 18 19 #include "Common/UniqueName.h"20 19 #include "Common/PassVisitor.h" 21 20 #include "GenPoly.h" // for isPolyType … … 23 22 24 23 #include "InitTweak/InitTweak.h" 24 #include "Parser/LinkageSpec.h" // for Spec, isBuiltin, Intrinsic 25 25 #include "ResolvExpr/TypeEnvironment.h" // for AssertionSet, OpenVarSet 26 26 #include "ResolvExpr/Unify.h" // for unify 27 27 #include "ResolvExpr/typeops.h" 28 28 #include "SymTab/Indexer.h" // for Indexer 29 #include "SynTree/LinkageSpec.h" // for Spec, isBuiltin, Intrinsic30 29 #include "SynTree/Declaration.h" // for Declaration, FunctionDecl 31 30 #include "SynTree/Expression.h" // for Expression, ConditionalExpr … … 55 54 delete ret->result; 56 55 ret->result = base->clone(); 56 ret->result->set_lvalue( true ); 57 57 return ret; 58 58 } else { … … 61 61 } 62 62 63 struct ReferenceConversions final : public WithStmtsToAdd , public WithGuards{63 struct ReferenceConversions final : public WithStmtsToAdd { 64 64 Expression * postmutate( CastExpr * castExpr ); 65 65 Expression * postmutate( AddressExpr * addrExpr ); … … 72 72 73 73 struct FixIntrinsicResult final : public WithGuards { 74 enum {75 NoSkip,76 Skip,77 SkipInProgress78 } skip = NoSkip;79 80 void premutate( AsmExpr * ) { GuardValue( skip ); skip = Skip; }81 void premutate( ApplicationExpr * ) { GuardValue( skip ); skip = (skip == Skip) ? SkipInProgress : NoSkip; }82 83 84 74 Expression * postmutate( ApplicationExpr * appExpr ); 85 75 void premutate( FunctionDecl * funcDecl ); … … 173 163 174 164 Expression * FixIntrinsicResult::postmutate( ApplicationExpr * appExpr ) { 175 if ( skip != SkipInProgress &&isIntrinsicReference( appExpr ) ) {165 if ( isIntrinsicReference( appExpr ) ) { 176 166 // eliminate reference types from intrinsic applications - now they return lvalues 177 167 ReferenceType * result = strict_dynamic_cast< ReferenceType * >( appExpr->result ); 178 168 appExpr->result = result->base->clone(); 169 appExpr->result->set_lvalue( true ); 179 170 if ( ! inIntrinsic ) { 180 171 // when not in an intrinsic function, add a cast to … … 445 436 delete ret->result; 446 437 ret->result = castExpr->result; 447 assert( ret->get_lvalue()); // ensure result is lvalue438 ret->result->set_lvalue( true ); // ensure result is lvalue 448 439 castExpr->env = nullptr; 449 440 castExpr->arg = nullptr;
Note:
See TracChangeset
for help on using the changeset viewer.