Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    r3fe34ae r626dbc10  
    1414//
    1515
    16 #include <memory>
    1716#include <iostream>
    1817#include <fstream>
     
    6665        nopreludep = false,
    6766        noprotop = false,
    68         nomainp = false,
    6967        parsep = false,
    7068        resolvep = false,                                                                       // used in AlternativeFinder
     
    7977static void parse( FILE * input, LinkageSpec::Spec linkage, bool shouldExit = false );
    8078static 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;
    8479
    8580static void backtrace( int start ) {                                    // skip first N stack frames
     
    159154
    160155        parse_cmdline( argc, argv, filename );                          // process command-line arguments
    161         translation_unit_nomain = nomainp;
    162156
    163157        try {
     
    305299
    306300                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                 }
    319301
    320302                if ( output != &cout ) {
     
    378360
    379361        int c;
    380         while ( (c = getopt_long( argc, argv, "abBcefglmnpqrstTvyzD:F:", long_opts, &long_index )) != -1 ) {
     362        while ( (c = getopt_long( argc, argv, "abBcefglnpqrstTvyzD:F:", long_opts, &long_index )) != -1 ) {
    381363                switch ( c ) {
    382364                  case Ast:
     
    418400                  case 'p':                                                                             // generate prototypes for preamble functions
    419401                        noprotop = true;
    420                         break;
    421                   case 'm':                                                                             // don't replace the main
    422                         nomainp = true;
    423402                        break;
    424403                  case Parse:
Note: See TracChangeset for help on using the changeset viewer.