Changes in src/ResolvExpr/Resolver.cc [ab780e6:bc61563]
- File:
-
- 1 edited
-
src/ResolvExpr/Resolver.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
rab780e6 rbc61563 340 340 } 341 341 342 ast::ptr< ast::Expr > findCondExpression(343 const ast::Expr * untyped, const ResolveContext & context344 ) {345 if ( nullptr == untyped ) return untyped;346 ast::ptr<ast::Expr> condExpr = createCondExpr( untyped );347 return findIntegralExpression( condExpr, context );348 }349 350 342 /// check if a type is a character type 351 343 bool isCharType( const ast::Type * t ) { … … 364 356 return it != end; 365 357 } 366 } // anonymous namespace358 } 367 359 368 360 class Resolver final … … 737 729 const ast::IfStmt * Resolver::previsit( const ast::IfStmt * ifStmt ) { 738 730 return ast::mutate_field( 739 ifStmt, &ast::IfStmt::cond, find CondExpression( ifStmt->cond, context ) );731 ifStmt, &ast::IfStmt::cond, findIntegralExpression( ifStmt->cond, context ) ); 740 732 } 741 733 742 734 const ast::WhileDoStmt * Resolver::previsit( const ast::WhileDoStmt * whileDoStmt ) { 743 735 return ast::mutate_field( 744 whileDoStmt, &ast::WhileDoStmt::cond, find CondExpression( whileDoStmt->cond, context ) );736 whileDoStmt, &ast::WhileDoStmt::cond, findIntegralExpression( whileDoStmt->cond, context ) ); 745 737 } 746 738 … … 748 740 if ( forStmt->cond ) { 749 741 forStmt = ast::mutate_field( 750 forStmt, &ast::ForStmt::cond, find CondExpression( forStmt->cond, context ) );742 forStmt, &ast::ForStmt::cond, findIntegralExpression( forStmt->cond, context ) ); 751 743 } 752 744 … … 1083 1075 1084 1076 // Resolve the conditions as if it were an IfStmt, statements normally 1085 clause2->when_cond = find CondExpression( clause.when_cond, context );1077 clause2->when_cond = findSingleExpression( clause.when_cond, context ); 1086 1078 clause2->stmt = clause.stmt->accept( *visitor ); 1087 1079 … … 1097 1089 new ast::BasicType{ ast::BasicType::LongLongUnsignedInt }; 1098 1090 auto timeout_time = findSingleExpression( stmt->timeout_time, target, context ); 1099 auto timeout_cond = find CondExpression( stmt->timeout_cond, context );1091 auto timeout_cond = findSingleExpression( stmt->timeout_cond, context ); 1100 1092 auto timeout_stmt = stmt->timeout_stmt->accept( *visitor ); 1101 1093 … … 1110 1102 if ( stmt->else_stmt ) { 1111 1103 // resolve the condition like IfStmt, stmts normally 1112 auto else_cond = find CondExpression( stmt->else_cond, context );1104 auto else_cond = findSingleExpression( stmt->else_cond, context ); 1113 1105 auto else_stmt = stmt->else_stmt->accept( *visitor ); 1114 1106
Note:
See TracChangeset
for help on using the changeset viewer.