Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    rcbbd5b48 ra16764a6  
     1
    12//
    23// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
     
    1011// Created On       : Fri May 15 23:12:02 2015
    1112// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed May  2 14:59:02 2018
    13 // Update Count     : 490
     13// Last Modified On : Tue Oct 31 12:22:40 2017
     14// Update Count     : 445
    1415//
    1516
     
    3435#include "CodeTools/DeclStats.h"            // for printDeclStats
    3536#include "CodeTools/TrackLoc.h"             // for fillLocations
     37#include "Common/PassVisitor.h"
    3638#include "Common/CompilerError.h"           // for CompilerError
    37 #include "Common/Heap.h"
    38 #include "Common/PassVisitor.h"
    3939#include "Common/SemanticError.h"           // for SemanticError
    4040#include "Common/UnimplementedError.h"      // for UnimplementedError
     
    175175        signal( SIGABRT, sigAbortHandler );
    176176
    177         // std::cout << "main" << std::endl;
    178         // for ( int i = 0; i < argc; i += 1 ) {
    179         //      std::cout << '\t' << argv[i] << std::endl;
    180         // } // for
    181 
    182177        parse_cmdline( argc, argv, filename );                          // process command-line arguments
    183178        CodeGen::FixMain::setReplaceMain( !nomainp );
     
    359354                OPTPRINT( "end" )
    360355
    361 
    362356                if ( output != &cout ) {
    363357                        delete output;
     
    390384
    391385        deleteAll( translationUnit );
    392         HeapStats::printStats();
    393386        return 0;
    394387} // main
     
    423416        opterr = 0;                                                                                     // (global) prevent getopt from printing error messages
    424417
    425         bool Werror = false;
    426418        int c;
    427         while ( (c = getopt_long( argc, argv, "abBcCdefgGlLmnNpqrstTvwW:yzZD:F:", long_opts, &long_index )) != -1 ) {
     419        while ( (c = getopt_long( argc, argv, "abBcCdefgGlLmnNpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {
    428420                switch ( c ) {
    429421                  case Ast:
     
    461453                        yydebug = true;
    462454                        break;
    463                   case 'G':                                                                             // dump AST after instantiate generics
     455                  case 'G':                   // dump AST after instantiate generics
    464456                        genericsp = true;
    465457                        break;
     
    509501                  case 'v':                                                                             // dump AST after decl validation pass
    510502                        validp = true;
    511                         break;
    512                   case 'w':
    513                         SemanticWarning_SuppressAll();
    514                         break;
    515                   case 'W':
    516                         if ( strcmp( optarg, "all" ) == 0 ) {
    517                                 SemanticWarning_EnableAll();
    518                         } else if ( strcmp( optarg, "error" ) == 0 ) {
    519                                 Werror = true;
    520                         } else {
    521                                 char * warning = optarg;
    522                                 Severity s;
    523                                 if ( strncmp( optarg, "no-", 3 ) == 0 ) {
    524                                         warning += 3;
    525                                         s = Severity::Suppress;
    526                                 } else {
    527                                         s = Severity::Warn;
    528                                 } // if
    529                                 SemanticWarning_Set( warning, s );
    530                         } // if
    531503                        break;
    532504                  case 'y':                                                                             // dump AST on error
     
    558530                } // switch
    559531        } // while
    560 
    561         if ( Werror ) {
    562                 SemanticWarning_WarningAsError();
    563         } // if
    564         // for ( const auto w : WarningFormats ) {
    565         //      cout << w.name << ' ' << (int)w.severity << endl;
    566         // } // for
    567532} // parse_cmdline
    568533
Note: See TracChangeset for help on using the changeset viewer.