Changes in / [36874e4:61f9356]
- Location:
- src/GenPoly
- Files:
-
- 3 edited
-
Box.cc (modified) (3 diffs)
-
ScrubTyVars.cc (modified) (1 diff)
-
ScrubTyVars.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r36874e4 r61f9356 492 492 assert( arg ); 493 493 if ( isPolyType( realParam->get_type(), tyVars ) ) { 494 // if ( dynamic_cast< PointerType *>( arg->get_type() ) ) { 495 // return new CastExpr( new VariableExpr( param ), arg->get_type()->clone() ); 496 // } else { 494 497 if ( dynamic_cast<TypeInstType *>(arg->get_type()) == NULL ) { 495 498 UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) ); … … 498 501 return deref; 499 502 } // if 503 // } 500 504 } // if 501 505 return new VariableExpr( param ); … … 1032 1036 1033 1037 // add size/align for generic types to parameter list 1034 std::set< std::string > seenTypes; // sizeofName for generic types we've seen1038 std::set< std::string > seenTypes; //< sizeofName for generic types we've seen 1035 1039 for ( std::list< DeclarationWithType* >::const_iterator fnParm = last; fnParm != funcType->get_parameters().end(); ++fnParm ) { 1036 1040 Type *parmType = (*fnParm)->get_type(); -
src/GenPoly/ScrubTyVars.cc
r36874e4 r61f9356 44 44 } 45 45 46 Type * ScrubTyVars::mutateAggregateType( Type *ty ) {47 if ( doAll ? isPolyType( ty ) : isPolyType( ty, tyVars ) ) {48 PointerType *ret = new PointerType( Type::Qualifiers(), new VoidType( ty->get_qualifiers() ) );49 delete ty;50 return ret;51 }52 return ty;53 }54 55 Type * ScrubTyVars::mutate( StructInstType *structInst ) {56 return mutateAggregateType( structInst );57 }58 59 Type * ScrubTyVars::mutate( UnionInstType *unionInst ) {60 return mutateAggregateType( unionInst );61 }62 63 46 Expression * ScrubTyVars::mutate( SizeofExpr *szeof ) { 64 47 // sizeof( T ) => _sizeof_T parameter, which is the size of T -
src/GenPoly/ScrubTyVars.h
r36874e4 r61f9356 35 35 template< typename SynTreeClass > 36 36 static SynTreeClass *scrub( SynTreeClass *target ); 37 37 38 38 virtual Type* mutate( TypeInstType *typeInst ); 39 virtual Type* mutate( StructInstType *structInst ); 40 virtual Type* mutate( UnionInstType *unionInst ); 41 virtual Expression* mutate( SizeofExpr *szeof ); 42 virtual Expression* mutate( AlignofExpr *algnof ); 39 Expression* mutate( SizeofExpr *szeof ); 40 Expression* mutate( AlignofExpr *algnof ); 43 41 virtual Type* mutate( PointerType *pointer ); 44 45 42 private: 46 /// Mutates (possibly generic) aggregate types appropriately47 Type* mutateAggregateType( Type *ty );48 49 43 bool doAll; 50 44 const TyVarMap &tyVars;
Note:
See TracChangeset
for help on using the changeset viewer.