Changeset 3d618a0 for src/Parser
- Timestamp:
- Sep 9, 2024, 6:16:09 PM (13 months ago)
- Branches:
- master
- Children:
- aa14aafe
- Parents:
- d93b813 (diff), f5dbc8d (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. - Location:
- src/Parser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cpp
rd93b813 r3d618a0 11 11 // Created On : Sat May 16 14:59:41 2015 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Fri Aug 11 11:44:15 202314 // Update Count : 4 2913 // Last Modified On : Mon Sep 9 11:28:07 2024 14 // Update Count : 430 15 15 // 16 16 … … 208 208 209 209 ast::Stmt * build_for( const CodeLocation & location, ForCtrl * forctl, StatementNode * stmt, StatementNode * else_ ) { 210 std::vector<ast::ptr<ast::Stmt>> astinit; 210 std::vector<ast::ptr<ast::Stmt>> astinit; // maybe empty 211 211 buildMoveList( forctl->init, astinit ); 212 212 213 213 if ( forctl->range_over ) { 214 214 ast::Expr * range_over = maybeMoveBuild( forctl->range_over ); 215 auto kind = forctl->kind; // save before delete, used in return 215 216 delete forctl; 216 217 return new ast::ForStmt( location, 217 218 std::move( astinit ), 218 range_over, forctl->kind == OperKinds::LEThan,219 range_over, kind == OperKinds::LEThan, 219 220 buildMoveSingle( stmt ), 220 221 buildMoveOptional( else_ ) -
src/Parser/TypeData.cpp
rd93b813 r3d618a0 1476 1476 } else if ( cur->has_enumeratorValue() ) { 1477 1477 ast::Expr * initValue; 1478 if (ret->isCfa && ret->base) { 1479 initValue = new ast::CastExpr( cur->enumeratorValue->location, maybeMoveBuild( cur->consume_enumeratorValue() ), ret->base ); 1478 if ( ret->isCfa && ret->base ) { 1479 CodeLocation location = cur->enumeratorValue->location; 1480 initValue = new ast::CastExpr( location, maybeMoveBuild( cur->consume_enumeratorValue() ), ret->base ); 1480 1481 } else { 1481 1482 initValue = maybeMoveBuild( cur->consume_enumeratorValue() ); -
src/Parser/parser.yy
rd93b813 r3d618a0 927 927 { $$ = new ExpressionNode( build_unary_val( yylloc, OperKinds::Decr, $2 ) ); } 928 928 | SIZEOF unary_expression 929 { $$ = new ExpressionNode( new ast::SizeofExpr( yylloc, maybeMoveBuild( $2) ) ); }929 { $$ = new ExpressionNode( new ast::SizeofExpr( yylloc, new ast::TypeofType( maybeMoveBuild( $2 ) ) ) ); } 930 930 | SIZEOF '(' type_no_function ')' 931 931 { $$ = new ExpressionNode( new ast::SizeofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); } 932 932 | ALIGNOF unary_expression // GCC, variable alignment 933 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, maybeMoveBuild( $2) ) ); }933 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, new ast::TypeofType( maybeMoveBuild( $2 ) ) ) ); } 934 934 | ALIGNOF '(' type_no_function ')' // GCC, type alignment 935 935 { $$ = new ExpressionNode( new ast::AlignofExpr( yylloc, maybeMoveBuildType( $3 ) ) ); }
Note:
See TracChangeset
for help on using the changeset viewer.