Changes in / [9082d7e8:d24b1985]
- Files:
-
- 1 deleted
- 35 edited
-
Jenkins/Promote (modified) (2 diffs)
-
libcfa/src/concurrency/pthread.cfa (modified) (2 diffs)
-
libcfa/src/interpose.cfa (modified) (3 diffs)
-
libcfa/src/interpose_thread.cfa (modified) (2 diffs)
-
src/AST/ParseNode.hpp (modified) (1 diff)
-
src/CodeGen/CodeGenerator.cc (modified) (1 diff)
-
src/Common/DeclStats.cpp (modified) (1 diff)
-
src/Common/ResolvProtoDump.cpp (modified) (2 diffs)
-
src/Common/ToString.hpp (deleted)
-
src/Common/module.mk (modified) (1 diff)
-
src/Common/utility.h (modified) (2 diffs)
-
src/ControlStruct/ExceptDeclNew.cpp (modified) (1 diff)
-
src/ControlStruct/MLEMutator.cc (modified) (1 diff)
-
src/GenPoly/Box.cc (modified) (1 diff)
-
src/GenPoly/Lvalue.cc (modified) (1 diff)
-
src/GenPoly/LvalueNew.cpp (modified) (1 diff)
-
src/InitTweak/FixInit.cc (modified) (1 diff)
-
src/InitTweak/FixInitNew.cpp (modified) (1 diff)
-
src/InitTweak/GenInit.cc (modified) (1 diff)
-
src/Parser/ParseNode.h (modified) (2 diffs)
-
src/Parser/StatementNode.cc (modified) (4 diffs)
-
src/Parser/lex.ll (modified) (2 diffs)
-
src/Parser/parser.yy (modified) (35 diffs)
-
src/ResolvExpr/Candidate.cpp (modified) (2 diffs)
-
src/ResolvExpr/Resolver.cc (modified) (1 diff)
-
src/SymTab/FixFunction.cc (modified) (1 diff)
-
src/SymTab/Mangler.cc (modified) (1 diff)
-
src/SymTab/Validate.cc (modified) (1 diff)
-
src/SymTab/ValidateType.cc (modified) (1 diff)
-
src/SynTree/Type.cc (modified) (2 diffs)
-
src/SynTree/Type.h (modified) (2 diffs)
-
src/Validate/FixQualifiedTypes.cpp (modified) (1 diff)
-
src/Validate/ForallPointerDecay.cpp (modified) (1 diff)
-
src/Validate/HandleAttributes.cc (modified) (1 diff)
-
src/Validate/HoistStruct.cpp (modified) (1 diff)
-
src/include/cassert (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/Promote
r9082d7e8 rd24b1985 36 36 dir (BuildDir) { 37 37 sh 'rm -rf *' 38 sshagent (credentials: ['git _key_mar27']) {38 sshagent (credentials: ['github_key_jun1']) { 39 39 sh "git clone --bare ${RemoteRepo} repo" 40 40 } … … 69 69 sh "git status" 70 70 sh "git diff-index --quiet HEAD || git commit -m 'Push from build machine: ${name}'" 71 sshagent (credentials: ['git _key_mar27']) {71 sshagent (credentials: ['github_key_jun1']) { 72 72 sh "git push origin master" 73 73 } -
libcfa/src/concurrency/pthread.cfa
r9082d7e8 rd24b1985 152 152 153 153 //######################### Attr helpers ######################### 154 typedef struct cfaPthread_attr_t {// thread attributes154 struct cfaPthread_attr_t { // thread attributes 155 155 int contentionscope; 156 156 int detachstate; … … 160 160 int inheritsched; 161 161 struct sched_param param; 162 } cfaPthread_attr_t;162 } typedef cfaPthread_attr_t; 163 163 164 164 static const cfaPthread_attr_t default_attrs { -
libcfa/src/interpose.cfa
r9082d7e8 rd24b1985 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 27 21:09:03202313 // Update Count : 19 612 // Last Modified On : Mon Mar 13 22:39:12 2023 13 // Update Count : 193 14 14 // 15 15 … … 40 40 union { generic_fptr_t fptr; void * ptr; } originalFunc; 41 41 42 #if defined( _GNU_SOURCE )43 if ( version ) {44 originalFunc.ptr = dlvsym( library, symbol, version );45 } else {46 originalFunc.ptr = dlsym( library, symbol );47 } // if48 #else49 42 originalFunc.ptr = dlsym( library, symbol ); 50 #endif // _GNU_SOURCE 51 52 if ( ! originalFunc.ptr ) { // == nullptr 43 if ( ! originalFunc.ptr ) { // == nullptr 53 44 abort( "interpose_symbol : internal error, %s\n", dlerror() ); 54 45 } // if … … 58 49 static generic_fptr_t interpose_symbol( const char symbol[], const char version[] ) { 59 50 void * library; 60 61 51 #if defined( RTLD_NEXT ) 62 52 library = RTLD_NEXT; -
libcfa/src/interpose_thread.cfa
r9082d7e8 rd24b1985 14 14 // 15 15 16 // BUG in 32-bit gcc with interpose: fixed in >= gcc-9.5, gcc-10.4, gcc-12.217 16 #ifdef __i386__ // 32-bit architecture 18 17 #undef _GNU_SOURCE … … 34 33 typedef void (* generic_fptr_t)(void); 35 34 36 generic_fptr_t libcfa_publicinterpose_symbol(35 generic_fptr_t interpose_symbol( 37 36 generic_fptr_t (*do_interpose_symbol)( void * library, const char symbol[], const char version[] ), 38 37 const char symbol[], 39 38 const char version[] 40 ) {39 ) libcfa_public { 41 40 void * library; 42 41 -
src/AST/ParseNode.hpp
r9082d7e8 rd24b1985 40 40 template<typename node_t> 41 41 friend node_t * mutate(const node_t * node); 42 template<typename node_t>43 friend node_t * shallowCopy(const node_t * node);44 42 }; 45 43 -
src/CodeGen/CodeGenerator.cc
r9082d7e8 rd24b1985 17 17 #include <cassert> // for assert, assertf 18 18 #include <list> // for _List_iterator, list, list<>::it... 19 #include <sstream> // for stringstream20 19 21 20 #include "AST/Decl.hpp" // for DeclWithType 22 21 #include "Common/UniqueName.h" // for UniqueName 22 #include "Common/utility.h" // for CodeLocation, toString 23 23 #include "GenType.h" // for genType 24 24 #include "InitTweak/InitTweak.h" // for getPointerBase -
src/Common/DeclStats.cpp
r9082d7e8 rd24b1985 23 23 #include <iostream> 24 24 #include <map> 25 #include <sstream>26 25 #include <unordered_map> 27 26 #include <unordered_set> -
src/Common/ResolvProtoDump.cpp
r9082d7e8 rd24b1985 19 19 #include <iostream> 20 20 #include <set> 21 #include <sstream>22 21 #include <unordered_set> 23 22 … … 27 26 #include "AST/Type.hpp" 28 27 #include "CodeGen/OperatorTable.h" 28 #include "Common/utility.h" 29 29 30 30 namespace { -
src/Common/module.mk
r9082d7e8 rd24b1985 52 52 Common/Stats/Time.cc \ 53 53 Common/Stats/Time.h \ 54 Common/ToString.hpp \55 54 Common/UniqueName.cc \ 56 55 Common/UniqueName.h \ -
src/Common/utility.h
r9082d7e8 rd24b1985 22 22 #include <list> 23 23 #include <memory> 24 #include <sstream> 24 25 #include <string> 25 26 #include <type_traits> … … 142 143 dst.swap( src ); 143 144 } 145 146 template < typename T > 147 void toString_single( std::ostream & os, const T & value ) { 148 os << value; 149 } 150 151 template < typename T, typename... Params > 152 void toString_single( std::ostream & os, const T & value, const Params & ... params ) { 153 os << value; 154 toString_single( os, params ... ); 155 } 156 157 template < typename ... Params > 158 std::string toString( const Params & ... params ) { 159 std::ostringstream os; 160 toString_single( os, params... ); 161 return os.str(); 162 } 163 164 #define toCString( ... ) toString( __VA_ARGS__ ).c_str() 144 165 145 166 template< typename... Args > -
src/ControlStruct/ExceptDeclNew.cpp
r9082d7e8 rd24b1985 15 15 16 16 #include "ExceptDecl.h" 17 18 #include <sstream>19 17 20 18 #include "AST/Decl.hpp" -
src/ControlStruct/MLEMutator.cc
r9082d7e8 rd24b1985 25 25 #include <memory> // for allocator_traits<>::value_... 26 26 27 #include "Common/ ToString.hpp" // for toString27 #include "Common/utility.h" // for toString, operator+ 28 28 #include "ControlStruct/LabelGenerator.h" // for LabelGenerator 29 29 #include "MLEMutator.h" -
src/GenPoly/Box.cc
r9082d7e8 rd24b1985 31 31 #include "Common/SemanticError.h" // for SemanticError 32 32 #include "Common/UniqueName.h" // for UniqueName 33 #include "Common/ ToString.hpp" // for toCString33 #include "Common/utility.h" // for toString 34 34 #include "FindFunction.h" // for findFunction, findAndReplace... 35 35 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::const_i... -
src/GenPoly/Lvalue.cc
r9082d7e8 rd24b1985 17 17 #include <string> // for string 18 18 19 #include "Common/ToString.hpp" // for toCString20 19 #include "Common/UniqueName.h" 21 20 #include "Common/PassVisitor.h" -
src/GenPoly/LvalueNew.cpp
r9082d7e8 rd24b1985 25 25 #include "AST/Pass.hpp" 26 26 #include "Common/SemanticError.h" // for SemanticWarning 27 #include "Common/ToString.hpp" // for toCString28 27 #include "Common/UniqueName.h" // for UniqueName 29 28 #include "GenPoly/GenPoly.h" // for genFunctionType -
src/InitTweak/FixInit.cc
r9082d7e8 rd24b1985 32 32 #include "Common/PassVisitor.h" // for PassVisitor, WithStmtsToAdd 33 33 #include "Common/SemanticError.h" // for SemanticError 34 #include "Common/ToString.hpp" // for toCString35 34 #include "Common/UniqueName.h" // for UniqueName 35 #include "Common/utility.h" // for CodeLocation, ValueGuard, toSt... 36 36 #include "FixGlobalInit.h" // for fixGlobalInit 37 37 #include "GenInit.h" // for genCtorDtor -
src/InitTweak/FixInitNew.cpp
r9082d7e8 rd24b1985 20 20 #include "Common/PassVisitor.h" // for PassVisitor, WithStmtsToAdd 21 21 #include "Common/SemanticError.h" // for SemanticError 22 #include "Common/ToString.hpp" // for toCString23 22 #include "Common/UniqueName.h" // for UniqueName 23 #include "Common/utility.h" // for CodeLocation, ValueGuard, toSt... 24 24 #include "FixGlobalInit.h" // for fixGlobalInit 25 25 #include "GenInit.h" // for genCtorDtor -
src/InitTweak/GenInit.cc
r9082d7e8 rd24b1985 31 31 #include "Common/PassVisitor.h" // for PassVisitor, WithGuards, WithShort... 32 32 #include "Common/SemanticError.h" // for SemanticError 33 #include "Common/ToString.hpp" // for toCString34 33 #include "Common/UniqueName.h" // for UniqueName 35 34 #include "Common/utility.h" // for ValueGuard, maybeClone -
src/Parser/ParseNode.h
r9082d7e8 rd24b1985 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 29 08:40:27 202313 // Update Count : 94 812 // Last Modified On : Sun Feb 19 09:02:37 2023 13 // Update Count : 940 14 14 // 15 15 … … 425 425 Statement * build_directive( std::string * directive ); 426 426 SuspendStmt * build_suspend( StatementNode *, SuspendStmt::Type = SuspendStmt::None); 427 WaitForStmt * build_waitfor( WaitForStmt * existing, ExpressionNode * when, ExpressionNode * targetExpr, StatementNode * stmt ); 428 WaitForStmt * build_waitfor_else( WaitForStmt * existing, ExpressionNode * when, StatementNode * stmt ); 429 WaitForStmt * build_waitfor_timeout( WaitForStmt * existing, ExpressionNode * when, ExpressionNode * timeout, StatementNode * stmt ); 427 WaitForStmt * build_waitfor( ExpressionNode * target, StatementNode * stmt, ExpressionNode * when ); 428 WaitForStmt * build_waitfor( ExpressionNode * target, StatementNode * stmt, ExpressionNode * when, WaitForStmt * existing ); 429 WaitForStmt * build_waitfor_timeout( ExpressionNode * timeout, StatementNode * stmt, ExpressionNode * when ); 430 WaitForStmt * build_waitfor_timeout( ExpressionNode * timeout, StatementNode * stmt, ExpressionNode * when, StatementNode * else_stmt, ExpressionNode * else_when ); 430 431 Statement * build_with( ExpressionNode * exprs, StatementNode * stmt ); 431 432 Statement * build_mutex( ExpressionNode * exprs, StatementNode * stmt ); -
src/Parser/StatementNode.cc
r9082d7e8 rd24b1985 11 11 // Created On : Sat May 16 14:59:41 2015 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Wed Mar 29 08:51:23 202314 // Update Count : 4 5413 // Last Modified On : Wed Feb 2 20:29:30 2022 14 // Update Count : 425 15 15 // 16 16 … … 268 268 269 269 return node; 270 } // build_suspend 271 272 WaitForStmt * build_waitfor( WaitForStmt * existing, ExpressionNode * when, ExpressionNode * targetExpr, StatementNode * stmt ) { 270 } 271 272 WaitForStmt * build_waitfor( ExpressionNode * targetExpr, StatementNode * stmt, ExpressionNode * when ) { 273 auto node = new WaitForStmt(); 274 273 275 WaitForStmt::Target target; 274 276 target.function = maybeBuild( targetExpr ); … … 280 282 delete targetExpr; 281 283 282 existing->clauses.insert( existing->clauses.begin(), WaitForStmt::Clause{ 284 node->clauses.push_back( WaitForStmt::Clause{ 285 target, 286 maybeMoveBuild( stmt ), 287 notZeroExpr( maybeMoveBuild( when ) ) 288 }); 289 290 return node; 291 } // build_waitfor 292 293 WaitForStmt * build_waitfor( ExpressionNode * targetExpr, StatementNode * stmt, ExpressionNode * when, WaitForStmt * node ) { 294 WaitForStmt::Target target; 295 target.function = maybeBuild( targetExpr ); 296 297 ExpressionNode * next = dynamic_cast<ExpressionNode *>( targetExpr->get_next() ); 298 targetExpr->set_next( nullptr ); 299 buildMoveList< Expression >( next, target.arguments ); 300 301 delete targetExpr; 302 303 node->clauses.insert( node->clauses.begin(), WaitForStmt::Clause{ 283 304 std::move( target ), 284 305 maybeMoveBuild( stmt ), … … 286 307 }); 287 308 288 return existing;309 return node; 289 310 } // build_waitfor 290 311 291 WaitForStmt * build_waitfor_else( WaitForStmt * existing, ExpressionNode * when, StatementNode * stmt ) { 292 existing->orelse.statement = maybeMoveBuild( stmt ); 293 existing->orelse.condition = notZeroExpr( maybeMoveBuild( when ) ); 294 295 return existing; 296 } // build_waitfor_else 297 298 WaitForStmt * build_waitfor_timeout( WaitForStmt * existing, ExpressionNode * when, ExpressionNode * timeout, StatementNode * stmt ) { 299 existing->timeout.time = maybeMoveBuild( timeout ); 300 existing->timeout.statement = maybeMoveBuild( stmt ); 301 existing->timeout.condition = notZeroExpr( maybeMoveBuild( when ) ); 302 303 return existing; 312 WaitForStmt * build_waitfor_timeout( ExpressionNode * timeout, StatementNode * stmt, ExpressionNode * when ) { 313 auto node = new WaitForStmt(); 314 315 if( timeout ) { 316 node->timeout.time = maybeMoveBuild( timeout ); 317 node->timeout.statement = maybeMoveBuild( stmt ); 318 node->timeout.condition = notZeroExpr( maybeMoveBuild( when ) ); 319 } else { 320 node->orelse.statement = maybeMoveBuild( stmt ); 321 node->orelse.condition = notZeroExpr( maybeMoveBuild( when ) ); 322 } // if 323 324 return node; 325 } // build_waitfor_timeout 326 327 WaitForStmt * build_waitfor_timeout( ExpressionNode * timeout, StatementNode * stmt, ExpressionNode * when, StatementNode * else_, ExpressionNode * else_when ) { 328 auto node = new WaitForStmt(); 329 330 node->timeout.time = maybeMoveBuild( timeout ); 331 node->timeout.statement = maybeMoveBuild( stmt ); 332 node->timeout.condition = notZeroExpr( maybeMoveBuild( when ) ); 333 334 node->orelse.statement = maybeMoveBuild( else_ ); 335 node->orelse.condition = notZeroExpr( maybeMoveBuild( else_when ) ); 336 337 return node; 304 338 } // build_waitfor_timeout 305 339 -
src/Parser/lex.ll
r9082d7e8 rd24b1985 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Sat Mar 25 08:09:03202313 * Update Count : 76 812 * Last Modified On : Mon Jan 30 19:03:34 2023 13 * Update Count : 767 14 14 */ 15 15 … … 214 214 __alignof { KEYWORD_RETURN(ALIGNOF); } // GCC 215 215 __alignof__ { KEYWORD_RETURN(ALIGNOF); } // GCC 216 and { QKEYWORD_RETURN(WAND); } // CFA217 216 asm { KEYWORD_RETURN(ASM); } 218 217 __asm { KEYWORD_RETURN(ASM); } // GCC -
src/Parser/parser.yy
r9082d7e8 rd24b1985 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 9 17:56:42202313 // Update Count : 6 32512 // Last Modified On : Wed Mar 22 21:26:01 2023 13 // Update Count : 6002 14 14 // 15 15 … … 44 44 45 45 #include <cstdio> 46 #include <sstream>47 46 #include <stack> 48 47 using namespace std; … … 271 270 SemanticError( yylloc, ::toString( "Identifier \"", identifier, "\" cannot appear before a ", kind, ".\n" 272 271 "Possible cause is misspelled storage/CV qualifier, misspelled typename, or missing generic parameter." ) ); 272 } // IdentifierBeforeType 273 274 static bool TypedefForall( DeclarationNode * decl ) { 275 if ( decl->type->forall || (decl->type->kind == TypeData::Aggregate && decl->type->aggregate.params) ) { 276 SemanticError( yylloc, "forall qualifier in typedef is currently unimplemented." ); 277 return true; 278 } // if 279 return false; 273 280 } // IdentifierBeforeType 274 281 … … 352 359 353 360 // names and constants: lexer differentiates between identifier and typedef names 354 %token<tok> IDENTIFIER TYPEDIMname TYPEDEFname TYPEGENname355 %token<tok> TIMEOUT W AND WORCATCH RECOVER CATCHRESUME FIXUP FINALLY // CFA361 %token<tok> IDENTIFIER QUOTED_IDENTIFIER TYPEDIMname TYPEDEFname TYPEGENname 362 %token<tok> TIMEOUT WOR CATCH RECOVER CATCHRESUME FIXUP FINALLY // CFA 356 363 %token<tok> INTEGERconstant CHARACTERconstant STRINGliteral 357 364 %token<tok> DIRECTIVE … … 422 429 %type<catch_kind> handler_key 423 430 %type<sn> mutex_statement 424 %type<en> when_clause when_clause_opt waitfor waituntiltimeout425 %type<sn> waitfor_statement waituntil_statement426 %type<wfs> w or_waitfor_clause waituntil_clause wand_waituntil_clause wor_waituntil_clause431 %type<en> when_clause when_clause_opt waitfor timeout 432 %type<sn> waitfor_statement 433 %type<wfs> waitfor_clause 427 434 428 435 // declarations … … 528 535 // Similar issues exit with the waitfor statement. 529 536 530 // Order of these lines matters (low-to-high precedence). THEN is left associative over W AND/WOR/TIMEOUT/ELSE, WAND/WOR531 // is leftassociative over TIMEOUT/ELSE, and TIMEOUT is left associative over ELSE.537 // Order of these lines matters (low-to-high precedence). THEN is left associative over WOR/TIMEOUT/ELSE, WOR is left 538 // associative over TIMEOUT/ELSE, and TIMEOUT is left associative over ELSE. 532 539 %precedence THEN // rule precedence for IF/WAITFOR statement 533 %precedence ANDAND // token precedence for start of WAND in WAITFOR statement534 %precedence WAND // token precedence for start of WAND in WAITFOR statement535 %precedence OROR // token precedence for start of WOR in WAITFOR statement536 540 %precedence WOR // token precedence for start of WOR in WAITFOR statement 537 541 %precedence TIMEOUT // token precedence for start of TIMEOUT in WAITFOR statement … … 620 624 quasi_keyword: // CFA 621 625 TIMEOUT 622 | WAND623 626 | WOR 624 627 | CATCH … … 771 774 { $$ = new ExpressionNode( build_pfieldSel( $1, build_tuple( $4 ) ) ); } 772 775 | postfix_expression ICR 773 { $$ = new ExpressionNode( build_unary_val( OperKinds::IncrPost, $1 ) ); }776 { $$ = new ExpressionNode( build_unary_val( OperKinds::IncrPost, $1 ) ); } 774 777 | postfix_expression DECR 775 { $$ = new ExpressionNode( build_unary_val( OperKinds::DecrPost, $1 ) ); }778 { $$ = new ExpressionNode( build_unary_val( OperKinds::DecrPost, $1 ) ); } 776 779 | '(' type_no_function ')' '{' initializer_list_opt comma_opt '}' // C99, compound-literal 777 780 { $$ = new ExpressionNode( build_compoundLiteral( $2, new InitializerNode( $5, true ) ) ); } … … 801 804 '@' // CFA, default parameter 802 805 { SemanticError( yylloc, "Default parameter for argument is currently unimplemented." ); $$ = nullptr; } 803 // { $$ = new ExpressionNode( build_constantInteger( *new string( "2" ) ) ); }806 // { $$ = new ExpressionNode( build_constantInteger( *new string( "2" ) ) ); } 804 807 | assignment_expression 805 808 ; … … 876 879 } 877 880 | unary_operator cast_expression 878 { $$ = new ExpressionNode( build_unary_val( $1, $2 ) ); }881 { $$ = new ExpressionNode( build_unary_val( $1, $2 ) ); } 879 882 | ICR unary_expression 880 { $$ = new ExpressionNode( build_unary_val( OperKinds::Incr, $2 ) ); }883 { $$ = new ExpressionNode( build_unary_val( OperKinds::Incr, $2 ) ); } 881 884 | DECR unary_expression 882 { $$ = new ExpressionNode( build_unary_val( OperKinds::Decr, $2 ) ); }885 { $$ = new ExpressionNode( build_unary_val( OperKinds::Decr, $2 ) ); } 883 886 | SIZEOF unary_expression 884 887 { $$ = new ExpressionNode( new SizeofExpr( maybeMoveBuild( $2 ) ) ); } … … 1133 1136 | mutex_statement 1134 1137 | waitfor_statement 1135 | waituntil_statement1136 1138 | exception_statement 1137 1139 | enable_disable_statement … … 1243 1245 | declaration comma_expression // semi-colon separated 1244 1246 { $$ = new CondCtl( $1, $2 ); } 1245 ;1247 ; 1246 1248 1247 1249 // CASE and DEFAULT clauses are only allowed in the SWITCH statement, precluding Duff's device. In addition, a case … … 1326 1328 } 1327 1329 | FOR '(' for_control_expression_list ')' statement %prec THEN 1328 { $$ = new StatementNode( build_for( $3, maybe_build_compound( $5 ) ) ); }1330 { $$ = new StatementNode( build_for( $3, maybe_build_compound( $5 ) ) ); } 1329 1331 | FOR '(' for_control_expression_list ')' statement ELSE statement // CFA 1330 1332 { $$ = new StatementNode( build_for( $3, maybe_build_compound( $5 ), $7 ) ); } … … 1518 1520 SemanticError( yylloc, "Type iterator is currently unimplemented." ); $$ = nullptr; 1519 1521 } 1520 ;1522 ; 1521 1523 1522 1524 downupdowneq: … … 1527 1529 | ErangeDownEq 1528 1530 { $$ = OperKinds::GEThan; } 1529 ;1531 ; 1530 1532 1531 1533 updown: … … 1534 1536 | ErangeDown 1535 1537 { $$ = OperKinds::GThan; } 1536 ;1538 ; 1537 1539 1538 1540 updowneq: … … 1542 1544 | ErangeDownEq 1543 1545 { $$ = OperKinds::GEThan; } 1544 ;1546 ; 1545 1547 1546 1548 jump_statement: … … 1625 1627 ; 1626 1628 1629 waitfor: 1630 WAITFOR '(' cast_expression ')' 1631 { $$ = $3; } 1632 // | WAITFOR '(' cast_expression ',' argument_expression_list_opt ')' 1633 // { $$ = (ExpressionNode *)$3->set_last( $5 ); } 1634 | WAITFOR '(' cast_expression_list ':' argument_expression_list_opt ')' 1635 { $$ = (ExpressionNode *)($3->set_last( $5 )); } 1636 ; 1637 1627 1638 cast_expression_list: 1628 1639 cast_expression … … 1633 1644 1634 1645 timeout: 1635 TIMEOUT '(' comma_expression ')' { $$ = $3; } 1636 ; 1637 1638 wor: 1639 OROR 1640 | WOR 1641 1642 waitfor: 1643 WAITFOR '(' cast_expression ')' 1644 { $$ = $3; } 1645 | WAITFOR '(' cast_expression_list ':' argument_expression_list_opt ')' 1646 { $$ = (ExpressionNode *)($3->set_last( $5 )); } 1647 ; 1648 1649 wor_waitfor_clause: 1646 TIMEOUT '(' comma_expression ')' { $$ = $3; } 1647 ; 1648 1649 waitfor_clause: 1650 1650 when_clause_opt waitfor statement %prec THEN 1651 // Called first: create header for WaitForStmt. 1652 { $$ = build_waitfor( new WaitForStmt(), $1, $2, maybe_build_compound( $3 ) ); } 1653 | wor_waitfor_clause wor when_clause_opt waitfor statement %prec THEN 1654 { $$ = build_waitfor( $1, $3, $4, maybe_build_compound( $5 ) ); } 1655 | wor_waitfor_clause wor when_clause_opt ELSE statement 1656 { $$ = build_waitfor_else( $1, $3, maybe_build_compound( $5 ) ); } 1657 | wor_waitfor_clause wor when_clause_opt timeout statement %prec THEN 1658 { $$ = build_waitfor_timeout( $1, $3, $4, maybe_build_compound( $5 ) ); } 1651 { $$ = build_waitfor( $2, maybe_build_compound( $3 ), $1 ); } 1652 | when_clause_opt waitfor statement WOR waitfor_clause 1653 { $$ = build_waitfor( $2, maybe_build_compound( $3 ), $1, $5 ); } 1654 | when_clause_opt timeout statement %prec THEN 1655 { $$ = build_waitfor_timeout( $2, maybe_build_compound( $3 ), $1 ); } 1656 | when_clause_opt ELSE statement 1657 { $$ = build_waitfor_timeout( nullptr, maybe_build_compound( $3 ), $1 ); } 1659 1658 // "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless) 1660 | w or_waitfor_clause wor when_clause_opt timeout statement worELSE statement // syntax error1659 | when_clause_opt timeout statement WOR ELSE statement // syntax error 1661 1660 { SemanticError( yylloc, "else clause must be conditional after timeout or timeout never triggered." ); $$ = nullptr; } 1662 | wor_waitfor_clause wor when_clause_opt timeout statement wor when_clause ELSE statement 1663 { $$ = build_waitfor_else( build_waitfor_timeout( $1, $3, $4, maybe_build_compound( $5 ) ), $7, maybe_build_compound( $9 ) ); } 1661 | when_clause_opt timeout statement WOR when_clause ELSE statement 1662 { $$ = build_waitfor_timeout( $2, maybe_build_compound( $3 ), $1, maybe_build_compound( $7 ), $5 ); } 1663 ; 1664 1664 1665 1665 waitfor_statement: 1666 wor_waitfor_clause %prec THEN 1667 { $$ = new StatementNode( $1 ); } 1668 ; 1669 1670 wand: 1671 ANDAND 1672 | WAND 1673 ; 1674 1675 waituntil: 1676 WAITUNTIL '(' cast_expression ')' 1677 { $$ = $3; } 1678 ; 1679 1680 waituntil_clause: 1681 when_clause_opt waituntil statement 1682 { printf( "waituntil_clause 1\n" ); $$ = nullptr; } 1683 | '(' wor_waituntil_clause ')' 1684 { printf( "waituntil_clause 2\n" ); $$ = nullptr; } 1685 ; 1686 1687 wand_waituntil_clause: 1688 waituntil_clause %prec THEN 1689 { printf( "wand_waituntil_clause 1\n" ); $$ = nullptr; } 1690 | waituntil_clause wand wand_waituntil_clause 1691 { printf( "wand_waituntil_clause 2\n" ); $$ = nullptr; } 1692 ; 1693 1694 wor_waituntil_clause: 1695 wand_waituntil_clause 1696 { printf( "wor_waituntil_clause 1\n" ); $$ = nullptr; } 1697 | wor_waituntil_clause wor wor_waituntil_clause %prec THEN 1698 { printf( "wor_waituntil_clause 2\n" ); $$ = nullptr; } 1699 | wor_waituntil_clause wor when_clause_opt ELSE statement 1700 { printf( "wor_waituntil_clause 3\n" ); $$ = nullptr; } 1701 | wor_waituntil_clause wor when_clause_opt timeout statement %prec THEN 1702 { printf( "wor_waituntil_clause 4\n" ); $$ = nullptr; } 1703 // "else" must be conditional after timeout or timeout is never triggered (i.e., it is meaningless) 1704 | wor_waituntil_clause wor when_clause_opt timeout statement wor ELSE statement // syntax error 1705 { SemanticError( yylloc, "else clause must be conditional after timeout or timeout never triggered." ); $$ = nullptr; } 1706 | wor_waituntil_clause wor when_clause_opt timeout statement wor when_clause ELSE statement 1707 { printf( "wor_waituntil_clause 6\n" ); $$ = nullptr; } 1708 ; 1709 1710 waituntil_statement: 1711 wor_waituntil_clause %prec THEN 1712 // SKULLDUGGERY: create an empty compound statement to test parsing of waituntil statement. 1713 { $$ = new StatementNode( build_compound( (StatementNode *)0 ) ); } 1666 when_clause_opt waitfor statement %prec THEN 1667 { $$ = new StatementNode( build_waitfor( $2, $3, $1 ) ); } 1668 | when_clause_opt waitfor statement WOR waitfor_clause 1669 { $$ = new StatementNode( build_waitfor( $2, $3, $1, $5 ) ); } 1714 1670 ; 1715 1671 1716 1672 exception_statement: 1717 TRY compound_statement handler_clause %prec THEN1673 TRY compound_statement handler_clause %prec THEN 1718 1674 { $$ = new StatementNode( build_try( $2, $3, nullptr ) ); } 1719 1675 | TRY compound_statement finally_clause … … 1875 1831 { 1876 1832 // printf( "C_DECLARATION1 %p %s\n", $$, $$->name ? $$->name->c_str() : "(nil)" ); 1877 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {1833 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) { 1878 1834 // printf( "\tattr %s\n", attr->name.c_str() ); 1879 1835 // } // for … … 2011 1967 { 2012 1968 typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "4" ); 2013 if ( $2->type->forall || ($2->type->kind == TypeData::Aggregate && $2->type->aggregate.params) ) { 2014 SemanticError( yylloc, "forall qualifier in typedef is currently unimplemented." ); $$ = nullptr; 2015 } else $$ = $3->addType( $2 )->addTypedef(); // watchout frees $2 and $3 1969 if ( TypedefForall( $2 ) ) $$ = nullptr; 1970 else $$ = $3->addType( $2 )->addTypedef(); // watchout frees $2 and $3 2016 1971 } 2017 1972 | typedef_declaration pop ',' push declarator … … 2021 1976 } 2022 1977 | type_qualifier_list TYPEDEF type_specifier declarator // remaining OBSOLESCENT (see 2 ) 2023 { SemanticError( yylloc, "Type qualifiers/specifiers before TYPEDEF is deprecated, move after TYPEDEF." ); $$ = nullptr; } 1978 { 1979 typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "6" ); 1980 if ( TypedefForall( $1 ) ) $$ = nullptr; 1981 else $$ = $4->addQualifiers( $1 )->addType( $3 )->addTypedef(); 1982 } 2024 1983 | type_specifier TYPEDEF declarator 2025 { SemanticError( yylloc, "Type qualifiers/specifiers before TYPEDEF is deprecated, move after TYPEDEF." ); $$ = nullptr; } 1984 { 1985 typedefTable.addToEnclosingScope( *$3->name, TYPEDEFname, "7" ); 1986 if ( TypedefForall( $1 ) ) $$ = nullptr; 1987 else $$ = $3->addType( $1 )->addTypedef(); 1988 } 2026 1989 | type_specifier TYPEDEF type_qualifier_list declarator 2027 { SemanticError( yylloc, "Type qualifiers/specifiers before TYPEDEF is deprecated, move after TYPEDEF." ); $$ = nullptr; } 1990 { 1991 typedefTable.addToEnclosingScope( *$4->name, TYPEDEFname, "8" ); 1992 if ( TypedefForall( $3 ) ) $$ = nullptr; 1993 else $$ = $4->addQualifiers( $1 )->addType( $1 )->addTypedef(); 1994 } 2028 1995 ; 2029 1996 … … 2032 1999 TYPEDEF identifier '=' assignment_expression 2033 2000 { 2034 SemanticError( yylloc, "T YPEDEFexpression is deprecated, use typeof(...) instead." ); $$ = nullptr;2001 SemanticError( yylloc, "Typedef expression is deprecated, use typeof(...) instead." ); $$ = nullptr; 2035 2002 } 2036 2003 | typedef_expression pop ',' push identifier '=' assignment_expression 2037 2004 { 2038 SemanticError( yylloc, "T YPEDEFexpression is deprecated, use typeof(...) instead." ); $$ = nullptr;2005 SemanticError( yylloc, "Typedef expression is deprecated, use typeof(...) instead." ); $$ = nullptr; 2039 2006 } 2040 2007 ; … … 2334 2301 { 2335 2302 // printf( "sue_declaration_specifier %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" ); 2336 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {2303 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) { 2337 2304 // printf( "\tattr %s\n", attr->name.c_str() ); 2338 2305 // } // for … … 2350 2317 { 2351 2318 // printf( "sue_type_specifier %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" ); 2352 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {2319 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) { 2353 2320 // printf( "\tattr %s\n", attr->name.c_str() ); 2354 2321 // } // for … … 2428 2395 { 2429 2396 // printf( "elaborated_type %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" ); 2430 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {2397 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) { 2431 2398 // printf( "\tattr %s\n", attr->name.c_str() ); 2432 2399 // } // for … … 2555 2522 $$ = fieldDecl( $1, $2 ); 2556 2523 // printf( "type_specifier2 %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" ); 2557 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) {2524 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) { 2558 2525 // printf( "\tattr %s\n", attr->name.c_str() ); 2559 2526 // } // for … … 2562 2529 { $$ = fieldDecl( $2, $3 ); distExt( $$ ); } 2563 2530 | STATIC type_specifier field_declaring_list_opt ';' // CFA 2564 { SemanticError( yylloc, "STATIC aggregate field qualifier currently unimplemented." ); $$ = nullptr; }2531 { SemanticError( yylloc, "STATIC aggregate field qualifier currently unimplemented." ); $$ = nullptr; } 2565 2532 | INLINE type_specifier field_abstract_list_opt ';' // CFA 2566 2533 { … … 2573 2540 } 2574 2541 | INLINE aggregate_control ';' // CFA 2575 { SemanticError( yylloc, "INLINE aggregate control currently unimplemented." ); $$ = nullptr; }2542 { SemanticError( yylloc, "INLINE aggregate control currently unimplemented." ); $$ = nullptr; } 2576 2543 | typedef_declaration ';' // CFA 2577 2544 | cfa_field_declaring_list ';' // CFA, new style field declaration … … 2656 2623 { $$ = DeclarationNode::newEnum( $3->name, $6, true, false, nullptr, $4 )->addQualifiers( $2 ); } 2657 2624 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '{' enumerator_list comma_opt '}' 2658 {2625 { 2659 2626 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.any() ) 2660 2627 { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } … … 3190 3157 { 3191 3158 distQual( $5, $1 ); 3192 forall = false;3159 forall = false; 3193 3160 $$ = $5; 3194 3161 } … … 3201 3168 { 3202 3169 distQual( $5, $1 ); 3203 forall = false;3170 forall = false; 3204 3171 $$ = $5; 3205 3172 } … … 3212 3179 { 3213 3180 distQual( $6, $1->addQualifiers( $2 ) ); 3214 forall = false;3181 forall = false; 3215 3182 $$ = $6; 3216 3183 } … … 3419 3386 | '(' attribute_list variable_ptr ')' array_dimension 3420 3387 { $$ = $3->addQualifiers( $2 )->addArray( $5 ); } 3421 | '(' variable_array ')' multi_array_dimension // redundant parenthesis3388 | '(' variable_array ')' multi_array_dimension // redundant parenthesis 3422 3389 { $$ = $2->addArray( $4 ); } 3423 3390 | '(' attribute_list variable_array ')' multi_array_dimension // redundant parenthesis … … 3842 3809 | ErangeUpEq 3843 3810 { $$ = OperKinds::LEThan; } 3844 ;3811 ; 3845 3812 3846 3813 multi_array_dimension: -
src/ResolvExpr/Candidate.cpp
r9082d7e8 rd24b1985 17 17 18 18 #include <iostream> 19 #include <sstream>20 19 21 20 #include "AST/Print.hpp" … … 45 44 sorted.reserve(cands.size()); 46 45 for(const auto & c : cands) { 47 std:: ostringstream ss;46 std::stringstream ss; 48 47 print( ss, *c, indent ); 49 48 sorted.push_back(ss.str()); -
src/ResolvExpr/Resolver.cc
r9082d7e8 rd24b1985 39 39 #include "AST/Type.hpp" 40 40 #include "Common/Eval.h" // for eval 41 #include "Common/Iterate.hpp" // for group_iterate42 41 #include "Common/PassVisitor.h" // for PassVisitor 43 42 #include "Common/SemanticError.h" // for SemanticError 44 43 #include "Common/Stats/ResolveTime.h" // for ResolveTime::start(), ResolveTime::stop() 45 #include "Common/ ToString.hpp" // for toCString44 #include "Common/utility.h" // for ValueGuard, group_iterate 46 45 #include "InitTweak/GenInit.h" 47 46 #include "InitTweak/InitTweak.h" // for isIntrinsicSingleArgCallStmt -
src/SymTab/FixFunction.cc
r9082d7e8 rd24b1985 21 21 #include "AST/Pass.hpp" 22 22 #include "AST/Type.hpp" 23 #include "Common/utility.h" // for copy23 #include "Common/utility.h" // for maybeClone, copy 24 24 #include "SynTree/Declaration.h" // for FunctionDecl, ObjectDecl, Declarati... 25 25 #include "SynTree/Expression.h" // for Expression -
src/SymTab/Mangler.cc
r9082d7e8 rd24b1985 24 24 #include "CodeGen/OperatorTable.h" // for OperatorInfo, operatorLookup 25 25 #include "Common/PassVisitor.h" 26 #include "Common/ToString.hpp" // for toCString27 26 #include "Common/SemanticError.h" // for SemanticError 27 #include "Common/utility.h" // for toString 28 28 #include "ResolvExpr/TypeEnvironment.h" // for TypeEnvironment 29 29 #include "SynTree/LinkageSpec.h" // for Spec, isOverridable, AutoGen, Int... -
src/SymTab/Validate.cc
r9082d7e8 rd24b1985 55 55 #include "Common/ScopedMap.h" // for ScopedMap 56 56 #include "Common/SemanticError.h" // for SemanticError 57 #include "Common/ToString.hpp" // for toCString58 57 #include "Common/UniqueName.h" // for UniqueName 59 #include "Common/utility.h" // for cloneAll, deleteAll58 #include "Common/utility.h" // for operator+, cloneAll, deleteAll 60 59 #include "CompilationState.h" // skip some passes in new-ast build 61 60 #include "Concurrency/Keywords.h" // for applyKeywords -
src/SymTab/ValidateType.cc
r9082d7e8 rd24b1985 18 18 #include "CodeGen/OperatorTable.h" 19 19 #include "Common/PassVisitor.h" 20 #include "Common/ToString.hpp"21 20 #include "SymTab/FixFunction.h" 22 21 #include "SynTree/Declaration.h" -
src/SynTree/Type.cc
r9082d7e8 rd24b1985 16 16 17 17 #include "Attribute.h" // for Attribute 18 #include "Common/ToString.hpp" // for toCString19 18 #include "Common/utility.h" // for cloneAll, deleteAll, printAll 20 19 #include "InitTweak/InitTweak.h" // for getPointerBase … … 106 105 int Type::referenceDepth() const { return 0; } 107 106 108 AggregateDecl * Type::getAggr() const {109 assertf( false, "Non-aggregate type: %s", toCString( this ) );110 }111 112 107 TypeSubstitution Type::genericSubstitution() const { assertf( false, "Non-aggregate type: %s", toCString( this ) ); } 113 108 -
src/SynTree/Type.h
r9082d7e8 rd24b1985 24 24 #include "BaseSyntaxNode.h" // for BaseSyntaxNode 25 25 #include "Common/Iterate.hpp"// for operator+ 26 #include "Common/utility.h" // for toCString 26 27 #include "Mutator.h" // for Mutator 27 28 #include "SynTree.h" // for AST nodes … … 185 186 virtual bool isComplete() const { return true; } 186 187 187 virtual AggregateDecl * getAggr() const ;188 virtual AggregateDecl * getAggr() const { assertf( false, "Non-aggregate type: %s", toCString( this ) ); } 188 189 189 190 virtual TypeSubstitution genericSubstitution() const; -
src/Validate/FixQualifiedTypes.cpp
r9082d7e8 rd24b1985 16 16 #include "Validate/FixQualifiedTypes.hpp" 17 17 18 #include "AST/LinkageSpec.hpp" // for Linkage19 18 #include "AST/Pass.hpp" 20 19 #include "AST/TranslationUnit.hpp" 21 #include "Common/ToString.hpp" // for toString22 #include "SymTab/Mangler.h" // for Mangler23 20 #include "Validate/NoIdSymbolTable.hpp" 21 #include "SymTab/Mangler.h" // for Mangler 22 #include "AST/LinkageSpec.hpp" // for Linkage 24 23 25 24 namespace Validate { -
src/Validate/ForallPointerDecay.cpp
r9082d7e8 rd24b1985 22 22 #include "CodeGen/OperatorTable.h" 23 23 #include "Common/CodeLocation.h" 24 #include "Common/ToString.hpp"25 24 #include "SymTab/FixFunction.h" 26 25 -
src/Validate/HandleAttributes.cc
r9082d7e8 rd24b1985 19 19 #include "Common/Eval.h" 20 20 #include "Common/PassVisitor.h" 21 #include "Common/ToString.hpp"22 21 #include "Common/SemanticError.h" 23 22 #include "ResolvExpr/Resolver.h" -
src/Validate/HoistStruct.cpp
r9082d7e8 rd24b1985 16 16 #include "Validate/HoistStruct.hpp" 17 17 18 #include <sstream>19 20 18 #include "AST/Pass.hpp" 21 19 #include "AST/TranslationUnit.hpp" 20 #include "Common/utility.h" 22 21 23 22 namespace Validate { -
src/include/cassert
r9082d7e8 rd24b1985 20 20 #include_next <cassert> 21 21 22 #include "Common/ToString.hpp" 22 #include <string> 23 24 template < typename ... Params > 25 std::string toString( const Params & ... params ); 23 26 24 27 #ifdef NDEBUG
Note:
See TracChangeset
for help on using the changeset viewer.