Changes in src/GenPoly/Specialize.cc [d3b7937:0f8e4ac]
- File:
-
- 1 edited
-
src/GenPoly/Specialize.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Specialize.cc
rd3b7937 r0f8e4ac 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed Jan 20 12:40:33201613 // Update Count : 1812 // Last Modified On : Thu Apr 28 15:17:45 2016 13 // Update Count : 24 14 14 // 15 15 … … 25 25 #include "SynTree/Statement.h" 26 26 #include "SynTree/Type.h" 27 #include "SynTree/Attribute.h" 27 28 #include "SynTree/TypeSubstitution.h" 28 29 #include "SynTree/Mutator.h" … … 41 42 virtual Expression * mutate( AddressExpr *castExpr ); 42 43 virtual Expression * mutate( CastExpr *castExpr ); 43 virtual Expression * mutate( LogicalExpr *logicalExpr );44 virtual Expression * mutate( ConditionalExpr *conditionalExpr );45 virtual Expression * mutate( CommaExpr *commaExpr );44 // virtual Expression * mutate( LogicalExpr *logicalExpr ); 45 // virtual Expression * mutate( ConditionalExpr *conditionalExpr ); 46 // virtual Expression * mutate( CommaExpr *commaExpr ); 46 47 47 48 private: … … 98 99 } // if 99 100 // create new thunk with same signature as formal type (C linkage, empty body) 100 FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, newType, new CompoundStmt( std::list< std::string >()), false, false );101 FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, newType, new CompoundStmt( noLabels ), false, false ); 101 102 thunkFunc->fixUniqueId(); 103 104 // thunks may be generated and not used - silence warning with attribute 105 thunkFunc->get_attributes().push_back( new Attribute( "unused" ) ); 102 106 103 107 // thread thunk parameters into call to actual function, naming thunk parameters as we go … … 142 146 143 147 Expression * Specialize::doSpecialization( Type *formalType, Expression *actual, InferredParams *inferParams ) { 144 assert( ! actual->get_results().empty() ); 148 assert( ! actual->get_results().empty() ); // using front, should have this assert 145 149 if ( needsSpecialization( formalType, actual->get_results().front(), env ) ) { 146 150 FunctionType *funType; … … 212 216 } 213 217 214 Expression * Specialize::mutate( LogicalExpr *logicalExpr ) { 215 return logicalExpr; 216 } 217 218 Expression * Specialize::mutate( ConditionalExpr *condExpr ) { 219 return condExpr; 220 } 221 222 Expression * Specialize::mutate( CommaExpr *commaExpr ) { 223 return commaExpr; 224 } 218 // Removing these for now. Richard put these in for some reason, but it's not clear why. 219 // In particular, copy constructors produce a comma expression, and with this code the parts 220 // of that comma expression are not specialized, which causes problems. 221 222 // Expression * Specialize::mutate( LogicalExpr *logicalExpr ) { 223 // return logicalExpr; 224 // } 225 226 // Expression * Specialize::mutate( ConditionalExpr *condExpr ) { 227 // return condExpr; 228 // } 229 230 // Expression * Specialize::mutate( CommaExpr *commaExpr ) { 231 // return commaExpr; 232 // } 225 233 } // namespace GenPoly 226 234
Note:
See TracChangeset
for help on using the changeset viewer.