Changeset bdd516a for driver/cpp.cc


Ignore:
Timestamp:
Apr 28, 2015, 4:21:36 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
42e2ad7
Parents:
ad17ba6a
Message:

fixed sizeof type variable, find lowest cost alternative for sizeof expression, removed unused classes, added compiler flag, remove temporary file for -CFA, formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/cpp.cc

    rad17ba6a rbdd516a  
    88// Created On       : Thu Aug 29 12:24:06 2002
    99// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Sat Dec  6 08:31:49 2014
    11 // Update Count     : 51
     10// Last Modified On : Tue Apr 21 07:23:38 2015
     11// Update Count     : 52
    1212//
    1313
     
    218218    if ( cpp_flag && CFA_flag ) {
    219219        cerr << argv[0] << " Error cannot use -E and -CFA flags together." << endl;
    220         exit( -1 );
     220        exit( EXIT_FAILURE );
    221221    } // if
    222222
     
    234234            if ( freopen( cpp_out.c_str(), "w", stdout ) == NULL ) { // redirect stdout if not -E
    235235                cerr << argv[0] << ": Error can't write to " << cpp_out << endl;
    236                 exit( -1 );
     236                exit( EXIT_FAILURE );
    237237            } // if
    238238
     
    274274        execvp( args[0], (char *const *)args );         // should not return
    275275        perror( "CFA translator error: cpp level, exec" );
    276         exit( -1 );
     276        exit( EXIT_FAILURE );
    277277    } // if
    278278
     
    282282        if ( freopen( tmpfile, "w", stdout ) == NULL) { // redirect output to tmpfile
    283283            cerr << argv[0] << ": Error can't write to " << tmpfile << endl;
    284             exit( -1 );
     284            exit( EXIT_FAILURE );
    285285        } // if
    286286
     
    308308        execvp( args[0], (char *const *)args );         // should not return
    309309        perror( "CFA translator error: cpp level, exec" );
    310         exit( -1 );
     310        exit( EXIT_FAILURE );
    311311    } // if
    312312
     
    316316        unlink( tmpfile );
    317317        cerr << "CFA translator error: cpp failed with signal " << WTERMSIG(code) << endl;
    318         exit( -1 );
     318        exit( EXIT_FAILURE );
    319319    } // if
    320320
     
    357357    wait( &code );                                      // wait for child to finish
    358358
    359     unlink( tmpfile );
     359    if ( unlink( tmpfile ) == -1 ) {
     360        cerr << "CFA translator error: cfa-cpp failed " << errno << " to remove temporary file \"" << tmpfile << "\"" << endl;
     361        exit( EXIT_FAILURE );
     362    } // if
    360363
    361364    if ( WIFSIGNALED(code) != 0 ) {                     // child completed successfully ?
    362365        cerr << "CFA translator error: cfa-cpp failed with signal " << WTERMSIG(code) << endl;
    363         exit( -1 );
     366        exit( EXIT_FAILURE );
    364367    } // if
    365368
    366369    if ( CFA_flag ) {                                   // -CFA flag ?
    367         exit( -1 );                                     // tell gcc not to go any further
     370        exit( EXIT_FAILURE );                           // tell gcc not to go any further
    368371    } else {
    369372        exit( WEXITSTATUS(code) );
Note: See TracChangeset for help on using the changeset viewer.