Changeset cccc534
- Timestamp:
- Sep 1, 2017, 10:27:39 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:
- 7d9ad510
- Parents:
- 058f549
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r058f549 rcccc534 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 … … 1550 1549 // (alloca was previously used, but can't be safely used in loops) 1551 1550 Type *declType = objectDecl->get_type(); 1552 std::string bufName = bufNamer.newName(); 1553 ObjectDecl *newBuf = new ObjectDecl( bufName, Type::StorageClasses(), LinkageSpec::C, 0, 1551 ObjectDecl *newBuf = new ObjectDecl( bufNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, 1554 1552 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 );1553 true, false, std::list<Attribute*>{ new Attribute( "aligned", std::list<Expression*>{ new ConstantExpr( Constant::from_int(8) ) } ) } ), 0 ); 1556 1554 stmtsToAdd.push_back( new DeclStmt( noLabels, newBuf ) ); 1557 1555 1558 1556 delete objectDecl->get_init(); 1559 1560 objectDecl->set_init( new SingleInit( new NameExpr( bufName ) ) ); 1557 objectDecl->set_init( new SingleInit( new VariableExpr( newBuf ) ) ); 1561 1558 } 1562 1559 } -
src/GenPoly/GenPoly.cc
r058f549 rcccc534 336 336 assertf(bparam, "Aggregate parameters should be type expressions"); 337 337 338 // xxx - might need to let VoidType be a wildcard here too; could have some voids 338 // xxx - might need to let VoidType be a wildcard here too; could have some voids 339 339 // stuffed in for dtype-statics. 340 340 // if ( is<VoidType>( aparam->get_type() ) || is<VoidType>( bparam->get_type() ) ) continue; 341 341 if ( ! typesPolyCompatible( aparam->get_type(), bparam->get_type() ) ) return false; 342 342 } 343 343 344 344 return true; 345 345 } … … 350 350 // polymorphic types always match 351 351 if ( aid == type_index{typeid(TypeInstType)} ) return true; 352 352 353 353 type_index bid{ typeid(*b) }; 354 354 // polymorphic types always match 355 355 if ( bid == type_index{typeid(TypeInstType)} ) return true; 356 356 357 357 // can't match otherwise if different types 358 358 if ( aid != bid ) return false; … … 377 377 ConstantExpr *ad = dynamic_cast<ConstantExpr*>( aa->get_dimension() ); 378 378 ConstantExpr *bd = dynamic_cast<ConstantExpr*>( ba->get_dimension() ); 379 if ( ad && bd 379 if ( ad && bd 380 380 && ad->get_constant()->get_value() != bd->get_constant()->get_value() ) 381 381 return false; -
src/Parser/ExpressionNode.cc
r058f549 rcccc534 314 314 Expression * build_unary_ptr( OperKinds op, ExpressionNode * expr_node ) { 315 315 std::list< Expression * > args; 316 args.push_back( maybeMoveBuild< Expression >(expr_node) ); // xxx 316 args.push_back( maybeMoveBuild< Expression >(expr_node) ); // xxx -- this is exactly the same as the val case now, refactor this code. 317 317 return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args ); 318 318 } // build_unary_ptr
Note: See TracChangeset
for help on using the changeset viewer.