Changes in src/main.cc [77d601f:aa88cb9a]
- File:
-
- 1 edited
-
src/main.cc (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r77d601f raa88cb9a 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Mar 6 15:49:00202113 // Update Count : 6 5612 // Last Modified On : Mon Feb 8 21:10:16 2021 13 // Update Count : 642 14 14 // 15 15 … … 101 101 static string PreludeDirector = ""; 102 102 103 static void parse_cmdline( int argc, char * argv[] );103 static void parse_cmdline( int argc, char *argv[] ); 104 104 static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit = false ); 105 105 static void dump( list< Declaration * > & translationUnit, ostream & out = cout ); 106 static void dump( ast::TranslationUnit && transUnit, ostream & out = cout );107 106 108 107 static void backtrace( int start ) { // skip first N stack frames … … 159 158 #define SIGPARMS int sig __attribute__(( unused )), siginfo_t * sfp __attribute__(( unused )), ucontext_t * cxt __attribute__(( unused )) 160 159 161 static void Signal( int sig, void (* handler)(SIGPARMS), int flags ) {160 static void Signal( int sig, void (*handler)(SIGPARMS), int flags ) { 162 161 struct sigaction act; 163 162 … … 166 165 167 166 if ( sigaction( sig, &act, nullptr ) == -1 ) { 168 cerr << "* cfa-cpp compilationerror* problem installing signal handler, error(" << errno << ") " << strerror( errno ) << endl;167 cerr << "*CFA runtime error* problem installing signal handler, error(" << errno << ") " << strerror( errno ) << endl; 169 168 _exit( EXIT_FAILURE ); 170 169 } // if … … 350 349 PASS( "Resolve", ResolvExpr::resolve( transUnit ) ); 351 350 if ( exprp ) { 352 dump( move( transUnit ) ); 351 translationUnit = convert( move( transUnit ) ); 352 dump( translationUnit ); 353 353 return EXIT_SUCCESS; 354 354 } // if … … 421 421 delete output; 422 422 } // if 423 } catch ( SemanticErrorException & e ) {423 } catch ( SemanticErrorException &e ) { 424 424 if ( errorp ) { 425 425 cerr << "---AST at error:---" << endl; … … 432 432 } // if 433 433 return EXIT_FAILURE; 434 } catch ( UnimplementedError & e ) {434 } catch ( UnimplementedError &e ) { 435 435 cout << "Sorry, " << e.get_what() << " is not currently implemented" << endl; 436 436 if ( output != &cout ) { … … 438 438 } // if 439 439 return EXIT_FAILURE; 440 } catch ( CompilerError & e ) {440 } catch ( CompilerError &e ) { 441 441 cerr << "Compiler Error: " << e.get_what() << endl; 442 442 cerr << "(please report bugs to [REDACTED])" << endl; … … 445 445 } // if 446 446 return EXIT_FAILURE; 447 } catch ( std::bad_alloc & ) {448 cerr << "*cfa-cpp compilation error* std::bad_alloc" << endl;449 backtrace( 1 );450 abort();451 447 } catch ( ... ) { 452 448 exception_ptr eptr = current_exception(); … … 455 451 rethrow_exception(eptr); 456 452 } else { 457 cerr << " *cfa-cpp compilation error* exception uncaught and unknown" << endl;458 } // if 459 } catch( const exception & e) {460 cerr << " *cfa-cpp compilation error* uncaught exception \"" << e.what() << "\"\n";453 cerr << "Exception Uncaught and Unknown" << endl; 454 } // if 455 } catch(const exception& e) { 456 cerr << "Uncaught Exception \"" << e.what() << "\"\n"; 461 457 } // try 462 458 return EXIT_FAILURE; … … 548 544 enum { printoptsSize = sizeof( printopts ) / sizeof( printopts[0] ) }; 549 545 550 static void usage( char * argv[] ) {546 static void usage( char *argv[] ) { 551 547 cout << "Usage: " << argv[0] << " [options] [input-file (default stdin)] [output-file (default stdout)], where options are:" << endl; 552 548 int i = 0, j = 1; // j skips starting colon … … 736 732 } // dump 737 733 738 static void dump( ast::TranslationUnit && transUnit, ostream & out ) {739 std::list< Declaration * > translationUnit = convert( move( transUnit ) );740 dump( translationUnit, out );741 }742 743 734 // Local Variables: // 744 735 // tab-width: 4 //
Note:
See TracChangeset
for help on using the changeset viewer.