- Timestamp:
- Feb 4, 2020, 11:29:22 AM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 52142c2, 9f575ea, bdfc032
- Parents:
- 09f357ec (diff), e56eb455 (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
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/LabelFixer.cc
r09f357ec r4f7b418 45 45 void LabelFixer::postvisit( FunctionDecl * functionDecl ) { 46 46 PassVisitor<MultiLevelExitMutator> mlem( resolveJumps(), generator ); 47 functionDecl->acceptMutator( mlem ); 47 // We start in the body so we can stop when we hit another FunctionDecl. 48 maybeMutate( functionDecl->statements, mlem ); 48 49 } 49 50 -
src/ControlStruct/MLEMutator.cc
r09f357ec r4f7b418 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Jan 21 10:33:00 202013 // Update Count : 22 212 // Last Modified On : Wed Jan 22 11:50:00 2020 13 // Update Count : 223 14 14 // 15 15 … … 60 60 } 61 61 } // namespace 62 63 void MultiLevelExitMutator::premutate( FunctionDecl * ) { 64 visit_children = false; 65 } 62 66 63 67 // break labels have to come after the statement they break out of, so mutate a statement, then if they inform us … … 352 356 }); 353 357 enclosingControlStructures = std::list<Entry>(); 358 GuardValue( inFinally ); 359 inFinally = true; 360 } 361 362 void MultiLevelExitMutator::premutate( ReturnStmt *returnStmt ) { 363 if ( inFinally ) { 364 SemanticError( returnStmt->location, "'return' may not appear in a finally clause" ); 365 } 354 366 } 355 367 -
src/ControlStruct/MLEMutator.h
r09f357ec r4f7b418 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Jan 21 10:33:00 202013 // Update Count : 4 712 // Last Modified On : Wed Jan 22 11:50:00 2020 13 // Update Count : 48 14 14 // 15 15 … … 38 38 ~MultiLevelExitMutator(); 39 39 40 void premutate( FunctionDecl * ); 41 40 42 void premutate( CompoundStmt *cmpndStmt ); 41 43 Statement * postmutate( BranchStmt *branchStmt ) throw ( SemanticErrorException ); … … 49 51 void premutate( SwitchStmt *switchStmt ); 50 52 Statement * postmutate( SwitchStmt *switchStmt ); 53 void premutate( ReturnStmt *returnStmt ); 51 54 void premutate( TryStmt *tryStmt ); 52 55 Statement * postmutate( TryStmt *tryStmt ); … … 113 116 Label breakLabel; 114 117 LabelGenerator *generator; 118 bool inFinally = false; 115 119 116 120 template< typename LoopClass > -
src/Parser/lex.ll
r09f357ec r4f7b418 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : S un Aug 4 20:53:47 201913 * Update Count : 7 1912 * Last Modified On : Sat Feb 1 07:16:44 2020 13 * Update Count : 724 14 14 */ 15 15 … … 330 330 /* identifier */ 331 331 {identifier} { IDENTIFIER_RETURN(); } 332 "` "{identifier}"`" { // CFA333 yytext[yyleng - 1] = '\0'; yytext += 1; // SKULLDUGGERY: remove backquotes (ok to shorten?)332 "``"{identifier}"``" { // CFA 333 yytext[yyleng - 2] = '\0'; yytext += 2; // SKULLDUGGERY: remove backquotes (ok to shorten?) 334 334 IDENTIFIER_RETURN(); 335 335 } -
src/Parser/parser.yy
r09f357ec r4f7b418 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jan 17 14:54:55202013 // Update Count : 44 2612 // Last Modified On : Sat Feb 1 10:04:40 2020 13 // Update Count : 4440 14 14 // 15 15 … … 579 579 | '(' compound_statement ')' // GCC, lambda expression 580 580 { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); } 581 | constant '`' IDENTIFIER // CFA, postfix call582 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }583 | string_literal '`' IDENTIFIER // CFA, postfix call584 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); }585 | IDENTIFIER '`' IDENTIFIER // CFA, postfix call586 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( build_varref( $1 ) ) ) ); }587 | tuple '`' IDENTIFIER // CFA, postfix call588 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }589 | '(' comma_expression ')' '`' IDENTIFIER // CFA, postfix call590 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $5 ) ), $2 ) ); }591 581 | type_name '.' identifier // CFA, nested type 592 582 { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; } … … 642 632 | postfix_expression '(' argument_expression_list ')' 643 633 { $$ = new ExpressionNode( build_func( $1, $3 ) ); } 634 | postfix_expression '`' identifier // CFA, postfix call 635 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 636 | constant '`' identifier // CFA, postfix call 637 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 638 | string_literal '`' identifier // CFA, postfix call 639 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); } 644 640 | postfix_expression '.' identifier 645 641 { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); } … … 666 662 | '(' type_no_function ')' '@' '{' initializer_list_opt comma_opt '}' // CFA, explicit C compound-literal 667 663 { $$ = new ExpressionNode( build_compoundLiteral( $2, (new InitializerNode( $6, true ))->set_maybeConstructed( false ) ) ); } 668 | '^' primary_expression '{' argument_expression_list '}' // CFA 664 | '^' primary_expression '{' argument_expression_list '}' // CFA, destructor call 669 665 { 670 666 Token fn;
Note: See TracChangeset
for help on using the changeset viewer.