Changeset b3f252a for src/GenPoly/Box.cc
- Timestamp:
- Sep 7, 2017, 10:36:35 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- e0886db
- Parents:
- 871cdb4 (diff), 416cc86 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r871cdb4 rb3f252a 141 141 virtual StructDecl *mutate( StructDecl *structDecl ) override; 142 142 virtual UnionDecl *mutate( UnionDecl *unionDecl ) override; 143 virtual TraitDecl *mutate( TraitDecl *unionDecl ) override; 143 144 virtual TypeDecl *mutate( TypeDecl *typeDecl ) override; 144 145 virtual TypedefDecl *mutate( TypedefDecl *typedefDecl ) override; … … 216 217 private: 217 218 }; 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 ) ) {899 898 } else if ( isDynType( adaptee->get_returnVals().front()->get_type(), tyVars ) ) { 900 899 // return type T … … 1299 1298 } 1300 1299 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 1308 1300 DeclarationWithType * Pass2::mutate( FunctionDecl *functionDecl ) { 1309 1301 functionDecl = safe_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl ) ); … … 1352 1344 } 1353 1345 1346 TraitDecl * Pass2::mutate( TraitDecl *aggDecl ) { 1347 return handleAggDecl( aggDecl ); 1348 } 1349 1354 1350 TypeDecl * Pass2::mutate( TypeDecl *typeDecl ) { 1355 1351 addToTyVarMap( typeDecl, scopeTyVars ); … … 1377 1373 Type *Pass2::mutate( FunctionType *funcType ) { 1378 1374 scopeTyVars.beginScope(); 1375 1379 1376 makeTyVarMap( funcType, scopeTyVars ); 1380 1377 … … 1550 1547 // (alloca was previously used, but can't be safely used in loops) 1551 1548 Type *declType = objectDecl->get_type(); 1552 std::string bufName = bufNamer.newName(); 1553 ObjectDecl *newBuf = new ObjectDecl( bufName, Type::StorageClasses(), LinkageSpec::C, 0, 1549 ObjectDecl *newBuf = new ObjectDecl( bufNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, 1554 1550 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::Kind::Char), new NameExpr( sizeofName( mangleType(declType) ) ), 1555 true, false, std::list<Attribute*>{ new Attribute( std::string{"aligned"}, std::list<Expression*>{ new ConstantExpr( Constant::from_int(8) ) } ) } ), 0 );1551 true, false, std::list<Attribute*>{ new Attribute( "aligned", std::list<Expression*>{ new ConstantExpr( Constant::from_int(8) ) } ) } ), 0 ); 1556 1552 stmtsToAdd.push_back( new DeclStmt( noLabels, newBuf ) ); 1557 1553 1558 1554 delete objectDecl->get_init(); 1559 1560 objectDecl->set_init( new SingleInit( new NameExpr( bufName ) ) ); 1555 objectDecl->set_init( new SingleInit( new VariableExpr( newBuf ) ) ); 1561 1556 } 1562 1557 }
Note: See TracChangeset
for help on using the changeset viewer.