Changes in / [98399b2:8c63bb4]
- Location:
- src
- Files:
-
- 7 edited
-
GenPoly/Box.cc (modified) (1 diff)
-
GenPoly/Lvalue.cc (modified) (2 diffs)
-
ResolvExpr/AlternativeFinder.cc (modified) (1 diff)
-
ResolvExpr/ConversionCost.cc (modified) (2 diffs)
-
SynTree/AddressExpr.cc (modified) (1 diff)
-
SynTree/Expression.cc (modified) (2 diffs)
-
SynTree/Expression.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r98399b2 r8c63bb4 725 725 if ( ! needsBoxing( param, arg->result, exprTyVars, env ) ) return; 726 726 727 if ( arg-> get_lvalue() ) {727 if ( arg->result->get_lvalue() ) { 728 728 // argument expression may be CFA lvalue, but not C lvalue -- apply generalizedLvalue transformations. 729 729 // if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( arg ) ) { -
src/GenPoly/Lvalue.cc
r98399b2 r8c63bb4 363 363 int diff = depth1 - depth2; 364 364 365 if ( diff > 0 && ! castExpr->arg->get_lvalue() ) {365 if ( diff > 0 && ! srcType->get_lvalue() ) { 366 366 // rvalue to reference conversion -- introduce temporary 367 367 // know that reference depth of cast argument is 0, need to introduce n temporaries for reference depth of n, e.g. … … 407 407 ret = new AddressExpr( ret ); 408 408 } 409 if ( castExpr->arg->get_lvalue() && ! ResolvExpr::typesCompatible( srcType, strict_dynamic_cast<ReferenceType *>( destType )->base, SymTab::Indexer() ) ) {409 if ( srcType->get_lvalue() && ! ResolvExpr::typesCompatible( srcType, strict_dynamic_cast<ReferenceType *>( destType )->base, SymTab::Indexer() ) ) { 410 410 // must keep cast if cast-to type is different from the actual type 411 411 castExpr->arg = ret; -
src/ResolvExpr/AlternativeFinder.cc
r98399b2 r8c63bb4 1135 1135 bool isLvalue( Expression *expr ) { 1136 1136 // xxx - recurse into tuples? 1137 return expr->result && ( expr-> get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) );1137 return expr->result && ( expr->result->get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) ); 1138 1138 } 1139 1139 -
src/ResolvExpr/ConversionCost.cc
r98399b2 r8c63bb4 98 98 } 99 99 100 staticCost convertToReferenceCost( const Type * src, const Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) {100 Cost convertToReferenceCost( const Type * src, const Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) { 101 101 PRINT( std::cerr << "convert to reference cost... diff " << diff << " " << src << " / " << dest << std::endl; ) 102 102 if ( diff > 0 ) { … … 534 534 } 535 535 536 static Cost convertToReferenceCost( const ast::Type * src, const ast::Type * dst,537 int diff,const ast::SymbolTable & symtab, const ast::TypeEnvironment & env,536 Cost convertToReferenceCost( const ast::Type * src, const ast::Type * dst, int diff, 537 const ast::SymbolTable & symtab, const ast::TypeEnvironment & env, 538 538 NumCostCalculation func ) { 539 539 if ( 0 < diff ) { -
src/SynTree/AddressExpr.cc
r98399b2 r8c63bb4 42 42 AddressExpr::AddressExpr( Expression *arg ) : Expression(), arg( arg ) { 43 43 if ( arg->result ) { 44 if ( arg-> get_lvalue() ) {44 if ( arg->result->get_lvalue() ) { 45 45 // lvalue, retains all layers of reference and gains a pointer inside the references 46 46 set_result( addrType( arg->result ) ); -
src/SynTree/Expression.cc
r98399b2 r8c63bb4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Wed Aug 7 17:03:00201913 // Update Count : 6 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 25 22:21:48 2019 13 // Update Count : 61 14 14 // 15 15 … … 61 61 delete env; 62 62 delete result; 63 }64 65 bool Expression::get_lvalue() const {66 return result->get_lvalue();67 63 } 68 64 -
src/SynTree/Expression.h
r98399b2 r8c63bb4 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Wed Aug 7 16:56:00201913 // Update Count : 5 111 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 25 22:21:44 2019 13 // Update Count : 50 14 14 // 15 15 … … 71 71 const Type * get_result() const { return result; } 72 72 void set_result( Type * newValue ) { result = newValue; } 73 bool get_lvalue() const;74 73 75 74 TypeSubstitution * get_env() const { return env; }
Note:
See TracChangeset
for help on using the changeset viewer.