Changeset b1e63ac5 for src/main.cc
- Timestamp:
- Jul 4, 2017, 9:40:16 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 208e5be
- Parents:
- 9c951e3 (diff), f7cb0bc (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. - File:
-
- 1 edited
-
src/main.cc (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r9c951e3 rb1e63ac5 10 10 // Author : Richard C. Bilson 11 11 // Created On : Fri May 15 23:12:02 2015 12 // Last Modified By : Andrew Beach13 // Last Modified On : Wed May 10 14:45:00 201714 // Update Count : 4 3712 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Thu Jun 29 12:46:50 2017 14 // Update Count : 441 15 15 // 16 16 … … 25 25 using namespace std; 26 26 27 #include "Parser/lex.h" 28 #include "Parser/parser.h" 27 #include "Parser/parser.hh" 29 28 #include "Parser/TypedefTable.h" 30 29 #include "GenPoly/Lvalue.h" … … 64 63 bresolvep = false, 65 64 bboxp = false, 65 bcodegenp = false, 66 66 ctorinitp = false, 67 67 declstatsp = false, … … 145 145 } // sigSegvBusHandler 146 146 147 void sigAbortHandler( int sig_num ) {147 void sigAbortHandler( __attribute__((unused)) int sig_num ) { 148 148 backtrace( 6 ); // skip first 6 stack frames 149 149 signal( SIGABRT, SIG_DFL); // reset default signal handler … … 185 185 if ( ! nopreludep ) { // include gcc builtins 186 186 // -l is for initial build ONLY and builtins.cf is not in the lib directory so access it here. 187 FILE * builtins = fopen( libcfap | treep ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" ); 188 assertf( builtins, "cannot open builtins.cf\n" ); 189 parse( builtins, LinkageSpec::Compiler ); 187 188 // Read to gcc builtins, if not generating the cfa library 189 FILE * gcc_builtins = fopen( libcfap | treep ? "../prelude/gcc-builtins.cf" : CFA_LIBDIR "/gcc-builtins.cf", "r" ); 190 assertf( gcc_builtins, "cannot open gcc-builtins.cf\n" ); 191 parse( gcc_builtins, LinkageSpec::Compiler ); 190 192 191 193 // read the extra prelude in, if not generating the cfa library … … 199 201 assertf( prelude, "cannot open prelude.cf\n" ); 200 202 parse( prelude, LinkageSpec::Intrinsic ); 203 204 // Read to cfa builtins, if not generating the cfa library 205 FILE * builtins = fopen( libcfap | treep ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" ); 206 assertf( builtins, "cannot open builtins.cf\n" ); 207 parse( builtins, LinkageSpec::Builtin ); 201 208 } // if 202 209 } // if … … 306 313 OPTPRINT( "box" ) 307 314 GenPoly::box( translationUnit ); 315 316 if ( bcodegenp ) { 317 dump( translationUnit ); 318 return 0; 319 } 308 320 309 321 if ( optind < argc ) { // any commands after the flags and input file ? => output file name … … 377 389 378 390 int c; 379 while ( (c = getopt_long( argc, argv, "abBc defglLmnpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {391 while ( (c = getopt_long( argc, argv, "abBcCdefglLmnpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) { 380 392 switch ( c ) { 381 393 case Ast: … … 394 406 ctorinitp = true; 395 407 break; 408 case 'C': // print before code generation 409 bcodegenp = true; 410 break; 396 411 case DeclStats: 397 412 case 'd': … … 466 481 break; 467 482 case '?': 468 assertf( false, "Unknown option: '%c'\n", (char)optopt ); 483 if ( optopt ) { // short option ? 484 assertf( false, "Unknown option: -%c\n", (char)optopt ); 485 } else { 486 assertf( false, "Unknown option: %s\n", argv[optind - 1] ); 487 } // if 469 488 default: 470 489 abort();
Note:
See TracChangeset
for help on using the changeset viewer.