Changes in src/main.cc [3fe34ae:626dbc10]
- File:
-
- 1 edited
-
src/main.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r3fe34ae r626dbc10 14 14 // 15 15 16 #include <memory>17 16 #include <iostream> 18 17 #include <fstream> … … 66 65 nopreludep = false, 67 66 noprotop = false, 68 nomainp = false,69 67 parsep = false, 70 68 resolvep = false, // used in AlternativeFinder … … 79 77 static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit = false ); 80 78 static void dump( list< Declaration * > & translationUnit, ostream & out = cout ); 81 82 bool translation_unit_nomain = true;83 std::unique_ptr<FunctionDecl> translation_unit_main_signature = nullptr;84 79 85 80 static void backtrace( int start ) { // skip first N stack frames … … 159 154 160 155 parse_cmdline( argc, argv, filename ); // process command-line arguments 161 translation_unit_nomain = nomainp;162 156 163 157 try { … … 305 299 306 300 CodeGen::generate( translationUnit, *output, ! noprotop ); 307 308 if( translation_unit_main_signature ) {309 *output << "int main(int argc, char** argv) { return ";310 311 *output << translation_unit_main_signature->get_scopedMangleName() << "(";312 if(translation_unit_main_signature->get_functionType()->get_parameters().size() != 0){313 *output << "argc, argv";314 }315 *output << ");";316 317 *output << " }\n";318 }319 301 320 302 if ( output != &cout ) { … … 378 360 379 361 int c; 380 while ( (c = getopt_long( argc, argv, "abBcefgl mnpqrstTvyzD:F:", long_opts, &long_index )) != -1 ) {362 while ( (c = getopt_long( argc, argv, "abBcefglnpqrstTvyzD:F:", long_opts, &long_index )) != -1 ) { 381 363 switch ( c ) { 382 364 case Ast: … … 418 400 case 'p': // generate prototypes for preamble functions 419 401 noprotop = true; 420 break;421 case 'm': // don't replace the main422 nomainp = true;423 402 break; 424 403 case Parse:
Note:
See TracChangeset
for help on using the changeset viewer.