Changes in src/GenPoly/Box.cc [bc3127d:2ae171d8]
- File:
-
- 1 edited
-
src/GenPoly/Box.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
rbc3127d r2ae171d8 141 141 virtual StructDecl *mutate( StructDecl *structDecl ) override; 142 142 virtual UnionDecl *mutate( UnionDecl *unionDecl ) override; 143 virtual TraitDecl *mutate( TraitDecl *unionDecl ) override;144 143 virtual TypeDecl *mutate( TypeDecl *typeDecl ) override; 145 144 virtual TypedefDecl *mutate( TypedefDecl *typedefDecl ) override; … … 217 216 private: 218 217 }; 218 219 219 } // anonymous namespace 220 220 … … 896 896 addAdapterParams( adapteeApp, arg, param, adapterType->get_parameters().end(), realParam, tyVars ); 897 897 bodyStmt = new ExprStmt( noLabels, adapteeApp ); 898 // } else if ( isPolyType( adaptee->get_returnVals().front()->get_type(), tyVars ) ) { 898 899 } else if ( isDynType( adaptee->get_returnVals().front()->get_type(), tyVars ) ) { 899 900 // return type T … … 1298 1299 } 1299 1300 1301 /// determines if `pref` is a prefix of `str` 1302 bool isPrefix( const std::string & str, const std::string & pref ) { 1303 if ( pref.size() > str.size() ) return false; 1304 auto its = std::mismatch( pref.begin(), pref.end(), str.begin() ); 1305 return its.first == pref.end(); 1306 } 1307 1300 1308 DeclarationWithType * Pass2::mutate( FunctionDecl *functionDecl ) { 1301 1309 functionDecl = safe_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl ) ); … … 1344 1352 } 1345 1353 1346 TraitDecl * Pass2::mutate( TraitDecl *aggDecl ) {1347 return handleAggDecl( aggDecl );1348 }1349 1350 1354 TypeDecl * Pass2::mutate( TypeDecl *typeDecl ) { 1351 1355 addToTyVarMap( typeDecl, scopeTyVars ); … … 1373 1377 Type *Pass2::mutate( FunctionType *funcType ) { 1374 1378 scopeTyVars.beginScope(); 1375 1376 1379 makeTyVarMap( funcType, scopeTyVars ); 1377 1380 … … 1547 1550 // (alloca was previously used, but can't be safely used in loops) 1548 1551 Type *declType = objectDecl->get_type(); 1549 ObjectDecl *newBuf = new ObjectDecl( bufNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, 1552 std::string bufName = bufNamer.newName(); 1553 ObjectDecl *newBuf = new ObjectDecl( bufName, Type::StorageClasses(), LinkageSpec::C, 0, 1550 1554 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::Kind::Char), new NameExpr( sizeofName( mangleType(declType) ) ), 1551 true, false, std::list<Attribute*>{ new Attribute( "aligned", std::list<Expression*>{ new ConstantExpr( Constant::from_int(8) ) } ) } ), 0 );1555 true, false, std::list<Attribute*>{ new Attribute( std::string{"aligned"}, std::list<Expression*>{ new ConstantExpr( Constant::from_int(8) ) } ) } ), 0 ); 1552 1556 stmtsToAdd.push_back( new DeclStmt( noLabels, newBuf ) ); 1553 1557 1554 1558 delete objectDecl->get_init(); 1555 objectDecl->set_init( new SingleInit( new VariableExpr( newBuf ) ) ); 1559 1560 objectDecl->set_init( new SingleInit( new NameExpr( bufName ) ) ); 1556 1561 } 1557 1562 }
Note:
See TracChangeset
for help on using the changeset viewer.