Changes in / [fca3bf8:3b9c674]
- Files:
-
- 2 added
- 2 deleted
- 28 edited
-
libcfa/src/interpose.cfa (modified) (2 diffs)
-
src/CodeGen/CodeGenerator.cc (modified) (24 diffs)
-
src/CodeGen/CodeGenerator.h (modified) (5 diffs)
-
src/CodeGen/FixMain.h (modified) (2 diffs)
-
src/CodeGen/GenType.h (modified) (2 diffs)
-
src/CodeGen/Generate.cc (modified) (2 diffs)
-
src/CodeGen/OperatorTable.cc (modified) (3 diffs)
-
src/CodeGen/OperatorTable.h (modified) (3 diffs)
-
src/CodeGen/Options.h (modified) (1 diff)
-
src/CodeTools/ResolvProtoDump.cc (modified) (2 diffs)
-
src/ControlStruct/Mutate.cc (modified) (2 diffs)
-
src/InitTweak/FixInit.cc (modified) (2 diffs)
-
src/InitTweak/FixInit.h (modified) (2 diffs)
-
src/MakeLibCfa.cc (modified) (3 diffs)
-
src/Parser/ParserTypes.h (modified) (2 diffs)
-
src/Parser/TypedefTable.cc (modified) (2 diffs)
-
src/Parser/TypedefTable.h (modified) (2 diffs)
-
src/Parser/lex.ll (modified) (3 diffs)
-
src/Parser/parser.yy (modified) (3 diffs)
-
src/SymTab/Mangler.cc (modified) (3 diffs)
-
src/SynTree/Attribute.h (modified) (2 diffs)
-
tests/.expect/alloc-ERROR.txt (modified) (4 diffs)
-
tests/.expect/alloc.txt (modified) (1 diff)
-
tests/.expect/nested-types-ERR1.txt (modified) (1 diff)
-
tests/.expect/nested-types-ERR2.txt (modified) (1 diff)
-
tests/.expect/userLiterals.txt (deleted)
-
tests/alloc.cfa (modified) (2 diffs)
-
tests/nested-types.cfa (modified) (2 diffs)
-
tests/test.py (modified) (1 diff)
-
tests/userLiterals.cfa (deleted)
-
tests/zombies/abort.cfa (added)
-
tests/zombies/userLiterals.cfa (added)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/interpose.cfa
rfca3bf8 r3b9c674 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Feb 17 10:18:53202013 // Update Count : 16 612 // Last Modified On : Sat Feb 8 08:40:34 2020 13 // Update Count : 163 14 14 // 15 15 … … 237 237 if ( fmt[strlen( fmt ) - 1] != '\n' ) { // add optional newline if missing at the end of the format text 238 238 __cfaabi_dbg_write( "\n", 1 ); 239 } // if 239 } 240 240 241 kernel_abort_msg( kernel_data, abort_text, abort_text_size ); 241 242 __cfaabi_backtrace( signalAbort ? 4 : 2 ); 242 __cfaabi_backtrace( signalAbort ? 4 : 3 ); 243 243 244 244 __cabi_libc.abort(); // print stack trace in handler -
src/CodeGen/CodeGenerator.cc
rfca3bf8 r3b9c674 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 16 08:32:48 202013 // Update Count : 5 3212 // Last Modified On : Fri Dec 13 23:13:28 2019 13 // Update Count : 508 14 14 // 15 15 #include "CodeGenerator.h" … … 39 39 int CodeGenerator::tabsize = 4; 40 40 41 // The kinds of statements that would ideally be followed by whitespace.41 // the kinds of statements that would ideally be followed by whitespace 42 42 bool wantSpacing( Statement * stmt) { 43 43 return dynamic_cast< IfStmt * >( stmt ) || dynamic_cast< CompoundStmt * >( stmt ) || … … 78 78 } 79 79 80 // Using updateLocation at the beginning of a node and endl within a node should become the method of formating. 80 /* Using updateLocation at the beginning of a node and endl 81 * within a node should become the method of formating. 82 */ 81 83 void CodeGenerator::updateLocation( CodeLocation const & to ) { 82 84 // skip if linemarks shouldn't appear or if codelocation is unset … … 93 95 } else { 94 96 output << "\n# " << to.first_line << " \"" << to.filename 95 << "\"\n" << indent;97 << "\"\n" << indent; 96 98 currentLocation = to; 97 99 } … … 129 131 130 132 void CodeGenerator::genAttributes( list< Attribute * > & attributes ) { 131 if ( attributes.empty() ) return;133 if ( attributes.empty() ) return; 132 134 output << "__attribute__ (("; 133 135 for ( list< Attribute * >::iterator attr( attributes.begin() );; ) { … … 138 140 output << ")"; 139 141 } // if 140 if ( ++attr == attributes.end() ) break;142 if ( ++attr == attributes.end() ) break; 141 143 output << ","; // separator 142 144 } // for … … 163 165 previsit( (BaseSyntaxNode *)node ); 164 166 GuardAction( [this, node](){ 165 if ( options.printExprTypes && node->result ) {166 output << " /* " << genType( node->result, "", options ) << " */ ";167 }168 } );167 if ( options.printExprTypes && node->result ) { 168 output << " /* " << genType( node->result, "", options ) << " */ "; 169 } 170 } ); 169 171 } 170 172 … … 397 399 extension( applicationExpr ); 398 400 if ( VariableExpr * varExpr = dynamic_cast< VariableExpr* >( applicationExpr->get_function() ) ) { 399 const OperatorInfo *opInfo;400 if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && ( opInfo = operatorLookup( varExpr->get_var()->get_name() )) ) {401 OperatorInfo opInfo; 402 if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( varExpr->get_var()->get_name(), opInfo ) ) { 401 403 std::list< Expression* >::iterator arg = applicationExpr->get_args().begin(); 402 switch ( opInfo ->type ) {404 switch ( opInfo.type ) { 403 405 case OT_INDEX: 404 406 assert( applicationExpr->get_args().size() == 2 ); … … 421 423 output << "("; 422 424 (*arg++)->accept( *visitor ); 423 output << ") /* " << opInfo ->inputName << " */";425 output << ") /* " << opInfo.inputName << " */"; 424 426 } else if ( applicationExpr->get_args().size() == 2 ) { 425 427 // intrinsic two parameter constructors are essentially bitwise assignment 426 428 output << "("; 427 429 (*arg++)->accept( *visitor ); 428 output << opInfo ->symbol;430 output << opInfo.symbol; 429 431 (*arg)->accept( *visitor ); 430 output << ") /* " << opInfo ->inputName << " */";432 output << ") /* " << opInfo.inputName << " */"; 431 433 } else { 432 434 // no constructors with 0 or more than 2 parameters … … 439 441 assert( applicationExpr->get_args().size() == 1 ); 440 442 output << "("; 441 output << opInfo ->symbol;443 output << opInfo.symbol; 442 444 (*arg)->accept( *visitor ); 443 445 output << ")"; … … 448 450 assert( applicationExpr->get_args().size() == 1 ); 449 451 (*arg)->accept( *visitor ); 450 output << opInfo ->symbol;452 output << opInfo.symbol; 451 453 break; 452 454 … … 457 459 output << "("; 458 460 (*arg++)->accept( *visitor ); 459 output << opInfo ->symbol;461 output << opInfo.symbol; 460 462 (*arg)->accept( *visitor ); 461 463 output << ")"; … … 484 486 extension( untypedExpr ); 485 487 if ( NameExpr * nameExpr = dynamic_cast< NameExpr* >( untypedExpr->function ) ) { 486 const OperatorInfo * opInfo = operatorLookup( nameExpr->name );487 if ( op Info) {488 OperatorInfo opInfo; 489 if ( operatorLookup( nameExpr->name, opInfo ) ) { 488 490 std::list< Expression* >::iterator arg = untypedExpr->args.begin(); 489 switch ( opInfo ->type ) {491 switch ( opInfo.type ) { 490 492 case OT_INDEX: 491 493 assert( untypedExpr->args.size() == 2 ); … … 506 508 output << "("; 507 509 (*arg++)->accept( *visitor ); 508 output << ") /* " << opInfo ->inputName << " */";510 output << ") /* " << opInfo.inputName << " */"; 509 511 } else if ( untypedExpr->get_args().size() == 2 ) { 510 512 // intrinsic two parameter constructors are essentially bitwise assignment 511 513 output << "("; 512 514 (*arg++)->accept( *visitor ); 513 output << opInfo ->symbol;515 output << opInfo.symbol; 514 516 (*arg)->accept( *visitor ); 515 output << ") /* " << opInfo ->inputName << " */";517 output << ") /* " << opInfo.inputName << " */"; 516 518 } else { 517 519 // no constructors with 0 or more than 2 parameters … … 519 521 output << "("; 520 522 (*arg++)->accept( *visitor ); 521 output << opInfo ->symbol << "{ ";523 output << opInfo.symbol << "{ "; 522 524 genCommaList( arg, untypedExpr->args.end() ); 523 output << "}) /* " << opInfo ->inputName << " */";525 output << "}) /* " << opInfo.inputName << " */"; 524 526 } // if 525 527 break; … … 530 532 assert( untypedExpr->args.size() == 1 ); 531 533 output << "("; 532 output << opInfo ->symbol;534 output << opInfo.symbol; 533 535 (*arg)->accept( *visitor ); 534 536 output << ")"; … … 539 541 assert( untypedExpr->args.size() == 1 ); 540 542 (*arg)->accept( *visitor ); 541 output << opInfo ->symbol;543 output << opInfo.symbol; 542 544 break; 543 545 … … 547 549 output << "("; 548 550 (*arg++)->accept( *visitor ); 549 output << opInfo ->symbol;551 output << opInfo.symbol; 550 552 (*arg)->accept( *visitor ); 551 553 output << ")"; … … 579 581 void CodeGenerator::postvisit( NameExpr * nameExpr ) { 580 582 extension( nameExpr ); 581 const OperatorInfo * opInfo = operatorLookup( nameExpr->name );582 if ( op Info) {583 if ( opInfo ->type == OT_CONSTANT ) {584 output << opInfo ->symbol;583 OperatorInfo opInfo; 584 if ( operatorLookup( nameExpr->name, opInfo ) ) { 585 if ( opInfo.type == OT_CONSTANT ) { 586 output << opInfo.symbol; 585 587 } else { 586 output << opInfo ->outputName;588 output << opInfo.outputName; 587 589 } 588 590 } else { … … 652 654 void CodeGenerator::postvisit( VariableExpr * variableExpr ) { 653 655 extension( variableExpr ); 654 const OperatorInfo *opInfo;655 if ( variableExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && (opInfo = operatorLookup( variableExpr->get_var()->get_name() )) && opInfo->type == OT_CONSTANT ) {656 output << opInfo ->symbol;656 OperatorInfo opInfo; 657 if ( variableExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( variableExpr->get_var()->get_name(), opInfo ) && opInfo.type == OT_CONSTANT ) { 658 output << opInfo.symbol; 657 659 } else { 658 660 output << mangleName( variableExpr->get_var() ); … … 1009 1011 case BranchStmt::FallThroughDefault: 1010 1012 assertf( ! options.genC, "fallthru should not reach code generation." ); 1011 output << "fallthru";1013 output << "fallthru"; 1012 1014 break; 1013 1015 } // switch … … 1033 1035 1034 1036 output << ((throwStmt->get_kind() == ThrowStmt::Terminate) ? 1035 "throw" : "throwResume");1037 "throw" : "throwResume"); 1036 1038 if (throwStmt->get_expr()) { 1037 1039 output << " "; … … 1048 1050 1049 1051 output << ((stmt->get_kind() == CatchStmt::Terminate) ? 1050 "catch" : "catchResume");1052 "catch" : "catchResume"); 1051 1053 output << "( "; 1052 1054 stmt->decl->accept( *visitor ); … … 1185 1187 1186 1188 std::string genName( DeclarationWithType * decl ) { 1187 const OperatorInfo * opInfo = operatorLookup( decl->get_name() );1188 if ( op Info) {1189 return opInfo ->outputName;1189 CodeGen::OperatorInfo opInfo; 1190 if ( operatorLookup( decl->get_name(), opInfo ) ) { 1191 return opInfo.outputName; 1190 1192 } else { 1191 1193 return decl->get_name(); -
src/CodeGen/CodeGenerator.h
rfca3bf8 r3b9c674 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun Feb 16 03:58:31 202013 // Update Count : 6211 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Apr 30 12:01:00 2019 13 // Update Count : 57 14 14 // 15 15 … … 29 29 namespace CodeGen { 30 30 struct CodeGenerator : public WithShortCircuiting, public WithGuards, public WithVisitorRef<CodeGenerator> { 31 static int tabsize;31 static int tabsize; 32 32 33 33 CodeGenerator( std::ostream &os, bool pretty = false, bool genC = false, bool lineMarks = false, bool printExprTypes = false ); … … 104 104 void postvisit( AsmStmt * ); 105 105 void postvisit( DirectiveStmt * ); 106 void postvisit( AsmDecl * ); // special: statement in declaration context106 void postvisit( AsmDecl * ); // special: statement in declaration context 107 107 void postvisit( IfStmt * ); 108 108 void postvisit( SwitchStmt * ); … … 147 147 LabelPrinter printLabels; 148 148 Options options; 149 public:149 public: 150 150 LineEnder endl; 151 private:151 private: 152 152 153 153 CodeLocation currentLocation; … … 162 162 template< class Iterator > 163 163 void CodeGenerator::genCommaList( Iterator begin, Iterator end ) { 164 if ( begin == end ) return;164 if ( begin == end ) return; 165 165 for ( ;; ) { 166 166 (*begin++)->accept( *visitor ); 167 if ( begin == end ) break;167 if ( begin == end ) break; 168 168 output << ", "; // separator 169 169 } // for -
src/CodeGen/FixMain.h
rfca3bf8 r3b9c674 10 10 // Created On : Thr Jan 12 14:11:09 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 16 03:24:32 202013 // Update Count : 512 // Last Modified On : Fri Dec 13 23:12:21 2019 13 // Update Count : 3 14 14 // 15 15 … … 42 42 static std::unique_ptr<FunctionDecl> main_signature; 43 43 }; 44 } // namespace CodeGen44 }; -
src/CodeGen/GenType.h
rfca3bf8 r3b9c674 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun Feb 16 04:11:40 202013 // Update Count : 511 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Apr 30 11:47:00 2019 13 // Update Count : 3 14 14 // 15 15 … … 25 25 std::string genType( Type *type, const std::string &baseString, const Options &options ); 26 26 std::string genType( Type *type, const std::string &baseString, bool pretty = false, bool genC = false, bool lineMarks = false ); 27 std::string genPrettyType( Type * type, const std::string & baseString );27 std::string genPrettyType( Type * type, const std::string & baseString ); 28 28 } // namespace CodeGen 29 29 -
src/CodeGen/Generate.cc
rfca3bf8 r3b9c674 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 16 03:01:51 202013 // Update Count : 912 // Last Modified On : Fri Dec 13 23:38:56 2019 13 // Update Count : 8 14 14 // 15 15 #include "Generate.h" … … 64 64 void generate( BaseSyntaxNode * node, std::ostream & os ) { 65 65 if ( Type * type = dynamic_cast< Type * >( node ) ) { 66 os << genPrettyType( type, "" );66 os << CodeGen::genPrettyType( type, "" ); 67 67 } else { 68 68 PassVisitor<CodeGenerator> cgv( os, true, false, false, false ); -
src/CodeGen/OperatorTable.cc
rfca3bf8 r3b9c674 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 18 15:55:01202013 // Update Count : 5512 // Last Modified On : Mon Feb 10 18:12:12 2020 13 // Update Count : 17 14 14 // 15 15 … … 17 17 #include <map> // for map, _Rb_tree_const_iterator, map<>::const_iterator 18 18 #include <utility> // for pair 19 using namespace std;20 19 21 20 #include "OperatorTable.h" … … 23 22 24 23 namespace CodeGen { 25 const OperatorInfo CodeGen::tableValues[] ={26 // inputName symbol outputName friendlyName type27 { "?[?]", "", "_operator_index", "Index", OT_INDEX },28 { "?{}", "=", "_constructor", "Constructor", OT_CTOR },29 { "^?{}", "", "_destructor", "Destructor", OT_DTOR },30 { "?()", "", "_operator_call", "Call Operator", OT_CALL },31 { "?++", "++", "_operator_postincr", "Postfix Increment", OT_POSTFIXASSIGN },32 { "?--", "--", "_operator_postdecr", "Postfix Decrement", OT_POSTFIXASSIGN },33 { "*?", "*", "_operator_deref", "Dereference", OT_PREFIX },34 { "+?", "+", "_operator_unaryplus", "Plus", OT_PREFIX },35 { "-?", "-", "_operator_unaryminus", "Minus", OT_PREFIX },36 { "~?", "~", "_operator_bitnot", "Bitwise Not", OT_PREFIX },37 { "!?", "!", "_operator_lognot", "Logical Not", OT_PREFIX },38 { "++?", "++", "_operator_preincr", "Prefix Increment", OT_PREFIXASSIGN },39 { "--?", "--", "_operator_predecr", "Prefix Decrement", OT_PREFIXASSIGN },40 { "?\\?", "\\", "_operator_exponential", "Exponentiation", OT_INFIX },41 { "?*?", "*", "_operator_multiply", "Multiplication", OT_INFIX },42 { "?/?", "/", "_operator_divide", "Division", OT_INFIX },43 { "?%?", "%", "_operator_modulus", "Modulo", OT_INFIX },44 { "?+?", "+", "_operator_add", "Addition", OT_INFIX },45 { "?-?", "-", "_operator_subtract", "Substraction", OT_INFIX },46 { "?<<?", "<<", "_operator_shiftleft", "Shift Left", OT_INFIX },47 { "?>>?", ">>", "_operator_shiftright", "Shift Right", OT_INFIX },48 { "?<?", "<", "_operator_less", "Less-than", OT_INFIX },49 { "?>?", ">", "_operator_greater", "Greater-than", OT_INFIX },50 { "?<=?", "<=", "_operator_lessequal", "Less-than-or-Equal", OT_INFIX },51 { "?>=?", ">=", "_operator_greaterequal", "Greater-than-or-Equal", OT_INFIX },52 { "?==?", "==", "_operator_equal", "Equality", OT_INFIX },53 { "?!=?", "!=", "_operator_notequal", "Not-Equal", OT_INFIX },54 { "?&?", "&", "_operator_bitand", "Bitwise And", OT_INFIX },55 { "?^?", "^", "_operator_bitxor", "Bitwise Xor", OT_INFIX },56 { "?|?", "|", "_operator_bitor", "Bitwise Or", OT_INFIX },57 { "?=?", "=", "_operator_assign", "Assignment", OT_INFIXASSIGN },58 { "?\\=?", "\\=", "_operator_expassign", "Exponentiation Assignment", OT_INFIXASSIGN },59 { "?*=?", "*=", "_operator_multassign", "Multiplication Assignment", OT_INFIXASSIGN },60 { "?/=?", "/=", "_operator_divassign", "Division Assignment", OT_INFIXASSIGN },61 { "?%=?", "%=", "_operator_modassign", "Modulo Assignment", OT_INFIXASSIGN },62 { "?+=?", "+=", "_operator_addassign", "Addition Assignment", OT_INFIXASSIGN },63 { "?-=?", "-=", "_operator_subassign", "Substrction Assignment", OT_INFIXASSIGN },64 { "?<<=?", "<<=", "_operator_shiftleftassign", "Shift Left Assignment", OT_INFIXASSIGN },65 { "?>>=?", ">>=", "_operator_shiftrightassign", "Shift Right Assignment", OT_INFIXASSIGN },66 { "?&=?", "&=", "_operator_bitandassign", "Bitwise And Assignment", OT_INFIXASSIGN },67 { "?^=?", "^=", "_operator_bitxorassign", "Bitwise Xor Assignment", OT_INFIXASSIGN },68 { "?|=?", "|=", "_operator_bitorassign", "Bitwise Or Assignment", OT_INFIXASSIGN },69 }; // tableValues24 namespace { 25 const OperatorInfo tableValues[] = { 26 { "?[?]", "", "_operator_index", "Index", OT_INDEX }, 27 { "?{}", "=", "_constructor", "Constructor", OT_CTOR }, 28 { "^?{}", "", "_destructor", "Destructor", OT_DTOR }, 29 { "?()", "", "_operator_call", "Call Operator", OT_CALL }, 30 { "?++", "++", "_operator_postincr", "Postfix Increment", OT_POSTFIXASSIGN }, 31 { "?--", "--", "_operator_postdecr", "Postfix Decrement", OT_POSTFIXASSIGN }, 32 { "*?", "*", "_operator_deref", "Dereference", OT_PREFIX }, 33 { "+?", "+", "_operator_unaryplus", "Plus", OT_PREFIX }, 34 { "-?", "-", "_operator_unaryminus", "Minus", OT_PREFIX }, 35 { "~?", "~", "_operator_bitnot", "Bitwise Not", OT_PREFIX }, 36 { "!?", "!", "_operator_lognot", "Logical Not", OT_PREFIX }, 37 { "++?", "++", "_operator_preincr", "Prefix Increment", OT_PREFIXASSIGN }, 38 { "--?", "--", "_operator_predecr", "Prefix Decrement", OT_PREFIXASSIGN }, 39 { "?\\?", "\\", "_operator_exponential", "Exponentiation", OT_INFIX }, 40 { "?*?", "*", "_operator_multiply", "Multiplication", OT_INFIX }, 41 { "?/?", "/", "_operator_divide", "Division", OT_INFIX }, 42 { "?%?", "%", "_operator_modulus", "Modulo", OT_INFIX }, 43 { "?+?", "+", "_operator_add", "Addition", OT_INFIX }, 44 { "?-?", "-", "_operator_subtract", "Substraction", OT_INFIX }, 45 { "?<<?", "<<", "_operator_shiftleft", "Shift Left", OT_INFIX }, 46 { "?>>?", ">>", "_operator_shiftright", "Shift Right", OT_INFIX }, 47 { "?<?", "<", "_operator_less", "Less-than", OT_INFIX }, 48 { "?>?", ">", "_operator_greater", "Greater-than", OT_INFIX }, 49 { "?<=?", "<=", "_operator_lessequal", "Less-than-or-Equal", OT_INFIX }, 50 { "?>=?", ">=", "_operator_greaterequal", "Greater-than-or-Equal", OT_INFIX }, 51 { "?==?", "==", "_operator_equal", "Equality", OT_INFIX }, 52 { "?!=?", "!=", "_operator_notequal", "Not-Equal", OT_INFIX }, 53 { "?&?", "&", "_operator_bitand", "Bitwise And", OT_INFIX }, 54 { "?^?", "^", "_operator_bitxor", "Bitwise Xor", OT_INFIX }, 55 { "?|?", "|", "_operator_bitor", "Bitwise Or", OT_INFIX }, 56 { "?=?", "=", "_operator_assign", "Assignment", OT_INFIXASSIGN }, 57 { "?\\=?", "\\=", "_operator_expassign", "Exponentiation Assignment", OT_INFIXASSIGN }, 58 { "?*=?", "*=", "_operator_multassign", "Multiplication Assignment", OT_INFIXASSIGN }, 59 { "?/=?", "/=", "_operator_divassign", "Division Assignment", OT_INFIXASSIGN }, 60 { "?%=?", "%=", "_operator_modassign", "Modulo Assignment", OT_INFIXASSIGN }, 61 { "?+=?", "+=", "_operator_addassign", "Addition Assignment", OT_INFIXASSIGN }, 62 { "?-=?", "-=", "_operator_subassign", "Substrction Assignment", OT_INFIXASSIGN }, 63 { "?<<=?", "<<=", "_operator_shiftleftassign", "Shift Left Assignment", OT_INFIXASSIGN }, 64 { "?>>=?", ">>=", "_operator_shiftrightassign", "Shift Right Assignment", OT_INFIXASSIGN }, 65 { "?&=?", "&=", "_operator_bitandassign", "Bitwise And Assignment", OT_INFIXASSIGN }, 66 { "?^=?", "^=", "_operator_bitxorassign", "Bitwise Xor Assignment", OT_INFIXASSIGN }, 67 { "?|=?", "|=", "_operator_bitorassign", "Bitwise Or Assignment", OT_INFIXASSIGN }, 68 }; 70 69 71 std::map< std::string, OperatorInfo > CodeGen::table;70 const int numOps = sizeof( tableValues ) / sizeof( OperatorInfo ); 72 71 73 CodeGen::CodeGen() { 74 enum { numOps = sizeof( tableValues ) / sizeof( OperatorInfo ) }; 75 for ( int i = 0; i < numOps; i += 1 ) { 76 table[ tableValues[i].inputName ] = tableValues[i]; 77 } // for 72 std::map< std::string, OperatorInfo > table; 73 74 void initialize() { 75 for ( int i = 0; i < numOps; ++i ) { 76 table[ tableValues[i].inputName ] = tableValues[i]; 77 } // for 78 } 79 } // namespace 80 81 bool operatorLookup( const std::string & funcName, OperatorInfo & info ) { 82 static bool init = false; 83 if ( ! init ) { 84 initialize(); 85 } // if 86 87 std::map< std::string, OperatorInfo >::const_iterator i = table.find( funcName ); 88 if ( i == table.end() ) { 89 if ( isPrefix( funcName, "?`" ) ) { // user-defined postfix operator ? 90 info.inputName = funcName; 91 info.symbol = funcName.substr(2); 92 info.outputName = toString( "__postfix_call_", info.symbol ); 93 info.type = OT_POSTFIX; 94 return true; 95 } 96 return false; 97 } else { 98 info = i->second; 99 return true; 100 } // if 78 101 } 79 102 80 const OperatorInfo * operatorLookup( const string & funcName ) { 81 if ( funcName.find_first_of( "?^*+-!", 0, 1 ) == string::npos ) return nullptr; // prefilter 82 const OperatorInfo * ret = &CodeGen::table.find( funcName )->second; // must be in the table 83 assert( ret ); 84 return ret; 103 bool isOperator( const std::string & funcName ) { 104 OperatorInfo info; 105 return operatorLookup( funcName, info ); 85 106 } 86 107 87 bool isOperator( const string & funcName ) { 88 return operatorLookup( funcName ) != nullptr; 89 } 90 91 string operatorFriendlyName( const string & funcName ) { 92 const OperatorInfo * info = operatorLookup( funcName ); 93 if ( info ) return info->friendlyName; 108 std::string operatorFriendlyName( const std::string & funcName ) { 109 OperatorInfo info; 110 if( operatorLookup( funcName, info ) ) { 111 return info.friendlyName; 112 } 94 113 return ""; 95 114 } 96 115 97 bool isConstructor( const string & funcName ) { 98 const OperatorInfo * info = operatorLookup( funcName ); 99 if ( info ) return info->type == OT_CTOR; 116 /// determines if a given function name is one of the operator types between [begin, end) 117 template<typename Iterator> 118 bool isOperatorType( const std::string & funcName, Iterator begin, Iterator end ) { 119 OperatorInfo info; 120 if ( operatorLookup( funcName, info ) ) { 121 return std::find( begin, end, info.type ) != end; 122 } 100 123 return false; 101 124 } 102 125 103 bool isDestructor( const string & funcName ) { 104 const OperatorInfo * info = operatorLookup( funcName ); 105 if ( info ) return info->type == OT_DTOR; 106 return false; 126 bool isConstructor( const std::string & funcName ) { 127 static OperatorType types[] = { OT_CTOR }; 128 return isOperatorType( funcName, std::begin(types), std::end(types) ); 107 129 } 108 130 109 bool isCtorDtor( const string & funcName ) { 110 const OperatorInfo * info = operatorLookup( funcName ); 111 if ( info ) return info->type <= OT_CONSTRUCTOR; 112 return false; 131 bool isDestructor( const std::string & funcName ) { 132 static OperatorType types[] = { OT_DTOR }; 133 return isOperatorType( funcName, std::begin(types), std::end(types) ); 113 134 } 114 135 115 bool isAssignment( const string & funcName ) { 116 const OperatorInfo * info = operatorLookup( funcName ); 117 if ( info ) return info->type > OT_CONSTRUCTOR && info->type <= OT_ASSIGNMENT; 118 return false; 136 bool isAssignment( const std::string & funcName ) { 137 static OperatorType types[] = { OT_PREFIXASSIGN, OT_POSTFIXASSIGN, OT_INFIXASSIGN }; 138 return isOperatorType( funcName, std::begin(types), std::end(types) ); 119 139 } 120 140 121 bool isCtorDtorAssign( const string & funcName ) { 122 const OperatorInfo * info = operatorLookup( funcName ); 123 if ( info ) return info->type <= OT_ASSIGNMENT; 124 return false; 141 bool isCtorDtor( const std::string & funcName ) { 142 static OperatorType types[] = { OT_CTOR, OT_DTOR }; 143 return isOperatorType( funcName, std::begin(types), std::end(types) ); 125 144 } 126 145 127 CodeGen codegen; // initialize singleton package 146 bool isCtorDtorAssign( const std::string & funcName ) { 147 static OperatorType types[] = { OT_CTOR, OT_DTOR, OT_PREFIXASSIGN, OT_POSTFIXASSIGN, OT_INFIXASSIGN }; 148 return isOperatorType( funcName, std::begin(types), std::end(types) ); 149 } 128 150 } // namespace CodeGen 129 151 130 152 // Local Variables: // 131 153 // tab-width: 4 // 154 // mode: c++ // 155 // compile-command: "make install" // 132 156 // End: // -
src/CodeGen/OperatorTable.h
rfca3bf8 r3b9c674 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 16 08:13:34 202013 // Update Count : 2612 // Last Modified On : Fri Jul 21 22:17:11 2017 13 // Update Count : 6 14 14 // 15 15 … … 17 17 18 18 #include <string> 19 #include <map>20 19 21 20 namespace CodeGen { 22 21 enum OperatorType { 22 OT_INDEX, 23 23 OT_CTOR, 24 24 OT_DTOR, 25 OT_CONSTRUCTOR = OT_DTOR, 25 OT_CALL, 26 OT_PREFIX, 27 OT_POSTFIX, 28 OT_INFIX, 26 29 OT_PREFIXASSIGN, 27 30 OT_POSTFIXASSIGN, 28 31 OT_INFIXASSIGN, 29 OT_ASSIGNMENT = OT_INFIXASSIGN,30 OT_CALL,31 OT_PREFIX,32 OT_INFIX,33 OT_POSTFIX,34 OT_INDEX,35 32 OT_LABELADDRESS, 36 33 OT_CONSTANT … … 45 42 }; 46 43 47 class CodeGen {48 friend const OperatorInfo * operatorLookup( const std::string & funcName );49 50 static const OperatorInfo tableValues[];51 static std::map< std::string, OperatorInfo > table;52 public:53 CodeGen();54 }; // CodeGen55 56 44 bool isOperator( const std::string & funcName ); 57 const OperatorInfo * operatorLookup( const std::string & funcName);45 bool operatorLookup( const std::string & funcName, OperatorInfo & info ); 58 46 std::string operatorFriendlyName( const std::string & funcName ); 59 47 -
src/CodeGen/Options.h
rfca3bf8 r3b9c674 9 9 // Author : Andrew Beach 10 10 // Created On : Tue Apr 30 11:36:00 2019 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Feb 15 18:37:06 202013 // Update Count : 311 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr May 2 10:45:00 2019 13 // Update Count : 2 14 14 // 15 15 16 16 #pragma once 17 17 18 struct Options { 19 // External Options: Same thoughout a pass. 20 bool pretty; 21 bool genC; 22 bool lineMarks; 23 bool printExprTypes; 18 namespace CodeGen { 19 struct Options { 20 // External Options: Same thoughout a pass. 21 bool pretty; 22 bool genC; 23 bool lineMarks; 24 bool printExprTypes; 24 25 25 // Internal Options: Changed on some recurisive calls.26 bool anonymousUnused = false;26 // Internal Options: Changed on some recurisive calls. 27 bool anonymousUnused = false; 27 28 28 Options(bool pretty, bool genC, bool lineMarks, bool printExprTypes) :29 pretty(pretty), genC(genC), lineMarks(lineMarks), printExprTypes(printExprTypes)29 Options(bool pretty, bool genC, bool lineMarks, bool printExprTypes) : 30 pretty(pretty), genC(genC), lineMarks(lineMarks), printExprTypes(printExprTypes) 30 31 {} 31 }; 32 }; 33 } // namespace CodeGen 32 34 33 35 // Local Variables: // -
src/CodeTools/ResolvProtoDump.cc
rfca3bf8 r3b9c674 9 9 // Author : Aaron Moss 10 10 // Created On : Tue Sep 11 09:04:00 2018 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Feb 15 13:50:11 202013 // Update Count : 311 // Last Modified By : Aaron Moss 12 // Last Modified On : Tue Sep 11 09:04:00 2018 13 // Update Count : 1 14 14 // 15 15 … … 182 182 183 183 // replace operator names 184 const CodeGen::OperatorInfo * opInfo = CodeGen::operatorLookup( name );185 if ( opInfo) {184 CodeGen::OperatorInfo info; 185 if ( CodeGen::operatorLookup( name, info ) ) { 186 186 ss << new_prefix(pre, ""); 187 op_name( opInfo->outputName, ss );187 op_name( info.outputName, ss ); 188 188 return; 189 189 } -
src/ControlStruct/Mutate.cc
rfca3bf8 r3b9c674 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 16 03:22:07 202013 // Update Count : 1012 // Last Modified On : Thu Aug 4 11:39:08 2016 13 // Update Count : 9 14 14 // 15 15 … … 37 37 mutateAll( translationUnit, formut ); 38 38 } 39 } // namespace Co ntrolStruct39 } // namespace CodeGen 40 40 41 41 // Local Variables: // -
src/InitTweak/FixInit.cc
rfca3bf8 r3b9c674 10 10 // Created On : Wed Jan 13 16:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 16 04:17:07 202013 // Update Count : 8212 // Last Modified On : Fri Dec 13 23:41:27 2019 13 // Update Count : 77 14 14 // 15 15 #include "FixInit.h" … … 745 745 } 746 746 747 // to prevent warnings ( '_unq0'may be used uninitialized in this function),747 // to prevent warnings (‘_unq0’ may be used uninitialized in this function), 748 748 // insert an appropriate zero initializer for UniqueExpr temporaries. 749 749 Initializer * makeInit( Type * t ) { -
src/InitTweak/FixInit.h
rfca3bf8 r3b9c674 10 10 // Created On : Wed Jan 13 16:29:30 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Feb 16 07:54:50 202013 // Update Count : 812 // Last Modified On : Sat Jul 22 09:31:06 2017 13 // Update Count : 6 14 14 // 15 15 … … 22 22 23 23 namespace InitTweak { 24 /// replace constructor initializers with expression statements and unwrap basic C-style initializers 24 /// replace constructor initializers with expression statements 25 /// and unwrap basic C-style initializers 25 26 void fix( std::list< Declaration * > & translationUnit, bool inLibrary ); 26 27 } // namespace -
src/MakeLibCfa.cc
rfca3bf8 r3b9c674 10 10 // Created On : Sat May 16 10:33:33 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 16 03:49:49 202013 // Update Count : 4 512 // Last Modified On : Fri Dec 13 23:41:40 2019 13 // Update Count : 42 14 14 // 15 15 … … 96 96 97 97 FunctionDecl *funcDecl = origFuncDecl->clone(); 98 const CodeGen::OperatorInfo *opInfo;99 opInfo = CodeGen::operatorLookup( funcDecl->get_name());100 assert( opInfo);98 CodeGen::OperatorInfo opInfo; 99 bool lookResult = CodeGen::operatorLookup( funcDecl->get_name(), opInfo ); 100 assert( lookResult ); 101 101 assert( ! funcDecl->get_statements() ); 102 102 // build a recursive call - this is okay, as the call will actually be codegen'd using operator syntax … … 120 120 121 121 Statement * stmt = nullptr; 122 switch ( opInfo ->type ) {122 switch ( opInfo.type ) { 123 123 case CodeGen::OT_INDEX: 124 124 case CodeGen::OT_CALL: -
src/Parser/ParserTypes.h
rfca3bf8 r3b9c674 10 10 // Created On : Sat Sep 22 08:58:10 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 15 11:04:40 202013 // Update Count : 35 112 // Last Modified On : Sat Jul 22 09:33:28 2017 13 // Update Count : 350 14 14 // 15 15 … … 27 27 // current location in the input 28 28 extern int yylineno; 29 extern char * yyfilename;29 extern char *yyfilename; 30 30 31 31 struct Location { 32 char * file;32 char *file; 33 33 int line; 34 34 }; // Location 35 35 36 36 struct Token { 37 std::string * str; // must be pointer as used in union37 std::string *str; // must be pointer as used in union 38 38 Location loc; 39 39 -
src/Parser/TypedefTable.cc
rfca3bf8 r3b9c674 10 10 // Created On : Sat May 16 15:20:13 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 15 08:06:36 202013 // Update Count : 25 912 // Last Modified On : Wed Jul 25 15:32:35 2018 13 // Update Count : 258 14 14 // 15 15 … … 47 47 } // TypedefTable::~TypedefTable 48 48 49 bool TypedefTable::exists( const string & identifier ) const{49 bool TypedefTable::exists( const string & identifier ) { 50 50 return kindTable.find( identifier ) != kindTable.end(); 51 51 } // TypedefTable::exists 52 52 53 bool TypedefTable::existsCurr( const string & identifier ) const{53 bool TypedefTable::existsCurr( const string & identifier ) { 54 54 return kindTable.findAt( kindTable.currentScope() - 1, identifier ) != kindTable.end(); 55 55 } // TypedefTable::exists -
src/Parser/TypedefTable.h
rfca3bf8 r3b9c674 10 10 // Created On : Sat May 16 15:24:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 15 08:06:37 202013 // Update Count : 11 712 // Last Modified On : Wed Jul 25 15:33:55 2018 13 // Update Count : 114 14 14 // 15 15 … … 30 30 ~TypedefTable(); 31 31 32 bool exists( const std::string & identifier ) const;33 bool existsCurr( const std::string & identifier ) const;32 bool exists( const std::string & identifier ); 33 bool existsCurr( const std::string & identifier ); 34 34 int isKind( const std::string & identifier ) const; 35 35 void makeTypedef( const std::string & name, int kind = TYPEDEFname ); -
src/Parser/lex.ll
rfca3bf8 r3b9c674 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Sat Feb 15 11:05:50202013 * Update Count : 7 3712 * Last Modified On : Fri Feb 7 19:02:43 2020 13 * Update Count : 725 14 14 */ 15 15 … … 42 42 #include "ParseNode.h" 43 43 #include "TypedefTable.h" 44 45 string * build_postfix_name( string * name );46 44 47 45 char *yyfilename; … … 434 432 "?"({op_unary_pre_post}|"()"|"[?]"|"{}") { IDENTIFIER_RETURN(); } 435 433 "^?{}" { IDENTIFIER_RETURN(); } 436 "?`"{identifier} { // postfix operator 437 yylval.tok.str = new string( &yytext[2] ); // remove ?` 438 yylval.tok.str = build_postfix_name( yylval.tok.str ); // add prefix 439 RETURN_LOCN( typedefTable.isKind( *yylval.tok.str ) ); 440 } 434 "?`"{identifier} { IDENTIFIER_RETURN(); } // postfix operator 441 435 "?"{op_binary_over}"?" { IDENTIFIER_RETURN(); } // binary 442 436 /* -
src/Parser/parser.yy
rfca3bf8 r3b9c674 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Feb 16 08:22:14202013 // Update Count : 44 6112 // Last Modified On : Sat Feb 1 10:04:40 2020 13 // Update Count : 4440 14 14 // 15 15 … … 166 166 } // rebindForall 167 167 168 string * build_postfix_name( string * name ) { 169 *name = string("__postfix_func_") + *name; 170 return name; 168 NameExpr * build_postfix_name( const string * name ) { 169 NameExpr * new_name = build_varref( new string( "?`" + *name ) ); 170 delete name; 171 return new_name; 171 172 } // build_postfix_name 172 173 … … 632 633 { $$ = new ExpressionNode( build_func( $1, $3 ) ); } 633 634 | postfix_expression '`' identifier // CFA, postfix call 634 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_ varref( build_postfix_name( $3 )) ), $1 ) ); }635 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 635 636 | constant '`' identifier // CFA, postfix call 636 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_ varref( build_postfix_name( $3 )) ), $1 ) ); }637 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); } 637 638 | string_literal '`' identifier // CFA, postfix call 638 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_ varref( build_postfix_name( $3 )) ), new ExpressionNode( $1 ) ) ); }639 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); } 639 640 | postfix_expression '.' identifier 640 641 { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); } -
src/SymTab/Mangler.cc
rfca3bf8 r3b9c674 10 10 // Created On : Sun May 17 21:40:29 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Feb 15 13:55:12 202013 // Update Count : 3312 // Last Modified On : Fri Dec 13 23:43:49 2019 13 // Update Count : 28 14 14 // 15 15 #include "Mangler.h" … … 128 128 } // if 129 129 mangleName << Encoding::manglePrefix; 130 const CodeGen::OperatorInfo * opInfo = CodeGen::operatorLookup( declaration->get_name() );131 if ( op Info) {132 mangleName << opInfo ->outputName.size() << opInfo->outputName;130 CodeGen::OperatorInfo opInfo; 131 if ( operatorLookup( declaration->get_name(), opInfo ) ) { 132 mangleName << opInfo.outputName.size() << opInfo.outputName; 133 133 } else { 134 134 mangleName << declaration->name.size() << declaration->name; … … 471 471 } // if 472 472 mangleName << Encoding::manglePrefix; 473 const CodeGen::OperatorInfo * opInfo = CodeGen::operatorLookup( decl->name );474 if ( op Info) {475 mangleName << opInfo ->outputName.size() << opInfo->outputName;473 CodeGen::OperatorInfo opInfo; 474 if ( operatorLookup( decl->name, opInfo ) ) { 475 mangleName << opInfo.outputName.size() << opInfo.outputName; 476 476 } else { 477 477 mangleName << decl->name.size() << decl->name; -
src/SynTree/Attribute.h
rfca3bf8 r3b9c674 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 13 21:34:08 202013 // Update Count : 4012 // Last Modified On : Sat Jul 22 09:54:14 2017 13 // Update Count : 39 14 14 // 15 15 … … 38 38 virtual ~Attribute(); 39 39 40 const std::string &get_name() const { return name; }40 std::string get_name() const { return name; } 41 41 void set_name( const std::string & newValue ) { name = newValue; } 42 42 std::list< Expression * > & get_parameters() { return parameters; } -
tests/.expect/alloc-ERROR.txt
rfca3bf8 r3b9c674 1 alloc.cfa:31 0:1 error: No reasonable alternatives for expression Applying untyped:1 alloc.cfa:311:1 error: No reasonable alternatives for expression Applying untyped: 2 2 Name: ?=? 3 3 ...to: … … 19 19 20 20 21 alloc.cfa:31 1:1 error: No reasonable alternatives for expression Applying untyped:21 alloc.cfa:312:1 error: No reasonable alternatives for expression Applying untyped: 22 22 Name: ?=? 23 23 ...to: … … 39 39 40 40 41 alloc.cfa:31 2:1 error: No reasonable alternatives for expression Applying untyped:41 alloc.cfa:313:1 error: No reasonable alternatives for expression Applying untyped: 42 42 Name: ?=? 43 43 ...to: … … 50 50 51 51 52 alloc.cfa:31 3:1 error: No reasonable alternatives for expression Applying untyped:52 alloc.cfa:314:1 error: No reasonable alternatives for expression Applying untyped: 53 53 Name: ?=? 54 54 ...to: -
tests/.expect/alloc.txt
rfca3bf8 r3b9c674 2 2 CFA malloc 0xdeadbeef 3 3 CFA alloc 0xdeadbeef 4 CFA array alloc, fill 0xde 4 5 CFA alloc, fill dededede 5 6 CFA alloc, fill 3 -
tests/.expect/nested-types-ERR1.txt
rfca3bf8 r3b9c674 1 nested-types.cfa: 83:1 error: Use of undefined type T1 nested-types.cfa:70:1 error: Use of undefined type T -
tests/.expect/nested-types-ERR2.txt
rfca3bf8 r3b9c674 1 nested-types.cfa: 86:1 error: Use of undefined global type Z2 nested-types.cfa: 87:1 error: Qualified type requires an aggregate on the left, but has: signed int3 nested-types.cfa: 88:1 error: Undefined type in qualified type: Qualified Type:1 nested-types.cfa:73:1 error: Use of undefined global type Z 2 nested-types.cfa:74:1 error: Qualified type requires an aggregate on the left, but has: signed int 3 nested-types.cfa:75:1 error: Undefined type in qualified type: Qualified Type: 4 4 instance of struct S with body 1 5 5 instance of type Z (not function type) -
tests/alloc.cfa
rfca3bf8 r3b9c674 10 10 // Created On : Wed Feb 3 07:56:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Feb 16 09:21:13 202013 // Update Count : 40 512 // Last Modified On : Fri Nov 22 15:34:19 2019 13 // Update Count : 404 14 14 // 15 15 … … 48 48 49 49 p = alloc_set( fill ); // CFA alloc, fill 50 printf( "CFA array alloc, fill %#hhx\n", fill ); 50 51 printf( "CFA alloc, fill %08x\n", *p ); 51 52 free( p ); -
tests/nested-types.cfa
rfca3bf8 r3b9c674 10 10 // Created On : Mon Jul 9 10:20:03 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 12 18:21:15 202013 // Update Count : 312 // Last Modified On : Tue Nov 6 17:59:40 2018 13 // Update Count : 2 14 14 // 15 15 … … 50 50 // double d; 51 51 // }; 52 53 // struct S {54 // enum C { R, G, B };55 // int i;56 // struct T {57 // int i;58 // };59 // T t;60 // };61 62 // S s;63 // S.C c;64 // S.T t;65 52 66 53 int main() { -
tests/test.py
rfca3bf8 r3b9c674 152 152 # run everything in a temp directory to make sure core file are handled properly 153 153 with tempdir(): 154 # if the make command succe eds continue otherwise skip to diff154 # if the make command succeds continue otherwise skip to diff 155 155 if success(make_ret): 156 156 with Timed() as run_dur:
Note:
See TracChangeset
for help on using the changeset viewer.