Changes in src/GenPoly/Box.cc [acd7c5dd:2edd80ae]
- File:
-
- 1 edited
-
src/GenPoly/Box.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
racd7c5dd r2edd80ae 27 27 #include "Box.h" 28 28 #include "DeclMutator.h" 29 #include " Lvalue.h"29 #include "PolyMutator.h" 30 30 #include "FindFunction.h" 31 #include "PolyMutator.h"32 31 #include "ScopedSet.h" 33 32 #include "ScrubTyVars.h" … … 756 755 757 756 void Pass1::boxParam( Type *param, Expression *&arg, const TyVarMap &exprTyVars ) { 758 assert f( arg->has_result(), "arg does not have result: %s", toString( arg ).c_str() );757 assert( arg->has_result() ); 759 758 if ( isPolyType( param, exprTyVars ) ) { 760 Type * newType = arg->get_result()->clone(); 761 if ( env ) env->apply( newType ); 762 std::auto_ptr<Type> manager( newType ); 763 if ( isPolyType( newType ) ) { 759 if ( isPolyType( arg->get_result() ) ) { 764 760 // if the argument's type is polymorphic, we don't need to box again! 765 761 return; 766 762 } else if ( arg->get_result()->get_lvalue() ) { 767 // argument expression may be CFA lvalue, but not C lvalue -- apply generalizedLvalue transformations. 768 arg = generalizedLvalue( new AddressExpr( arg ) ); 763 // VariableExpr and MemberExpr are lvalues; need to check this isn't coming from the second arg of a comma expression though (not an lvalue) 764 // xxx - need to test that this code is still reachable 765 if ( CommaExpr *commaArg = dynamic_cast< CommaExpr* >( arg ) ) { 766 commaArg->set_arg2( new AddressExpr( commaArg->get_arg2() ) ); 767 } else { 768 arg = new AddressExpr( arg ); 769 } 769 770 if ( ! ResolvExpr::typesCompatible( param, arg->get_result(), SymTab::Indexer() ) ) { 770 771 // silence warnings by casting boxed parameters when the actual type does not match up with the formal type. … … 1878 1879 return structDecl; 1879 1880 } 1880 1881 1881 1882 Declaration *Pass3::mutate( UnionDecl *unionDecl ) { 1882 1883 stripGenericMembers( unionDecl );
Note:
See TracChangeset
for help on using the changeset viewer.