Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • driver/cc1.cc

    r36de20d rdb62eef  
    1010// Created On       : Fri Aug 26 14:23:51 2005
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Aug 16 21:03:02 2020
    13 // Update Count     : 413
     12// Last Modified On : Thu Aug 13 21:03:15 2020
     13// Update Count     : 407
    1414//
    1515
     
    2424#include <unistd.h>                                                                             // execvp, fork, unlink
    2525#include <sys/wait.h>                                                                   // wait
    26 #include <fcntl.h>                                                                              // creat
     26#include <fcntl.h>
    2727
    2828
     
    5959
    6060
    61 static string __CFA_FLAGPREFIX__( "__CFA_FLAG" );               // "__CFA_FLAG__=" suffix
     61static string __CFA_FLAGPREFIX__( "__CFA_FLAG" );               // "N__=" suffix
    6262
    6363static void checkEnv1( const char * args[], int & nargs ) { // stage 1
     
    111111} // checkEnv2
    112112
    113 #define CFA_SUFFIX ".ifa"
    114 
    115 static char tmpname[] = P_tmpdir "/CFAXXXXXX" CFA_SUFFIX;
     113
     114static char tmpname[] = P_tmpdir "/CFAXXXXXX.ifa";
    116115static int tmpfilefd = -1;
    117116static bool startrm = false;
     
    322321
    323322        if ( WIFSIGNALED(code) ) {                                                      // child failed ?
    324                 rmtmpfile();                                                                    // remove tmpname
    325323                cerr << "CC1 Translator error: stage 1, child failed " << WTERMSIG(code) << endl;
    326324                exit( EXIT_FAILURE );
    327325        } // if
    328326
    329         exit( WEXITSTATUS( code ) );                                            // bad cpp result stops top-level gcc
     327        exit( WEXITSTATUS(code) );                                                      // bad cpp result stops top-level gcc
    330328} // Stage1
    331329
     
    375373                        } else if ( arg == "-fno-diagnostics-color" ) {
    376374                                color_arg = Color_Auto;
    377                         } // if
     375                        }
    378376
    379377                        if ( arg == "-quiet" || arg == "-version" || arg == "-fpreprocessed" ||
    380                                  // Currently CFA does not suppose precompiled .h files.
    381                                  prefix( arg, "--output-pch" ) ) {
     378                                // Currently CFA does not suppose precompiled .h files.
     379                                prefix( arg, "--output-pch" ) ) {
    382380
    383381                                // strip inappropriate flags with an argument
     
    443441                        } // if
    444442
    445                         cfa_cpp_out = cfa_cpp_out.substr( 0, dot ) + CFA_SUFFIX;
     443                        cfa_cpp_out = cfa_cpp_out.substr( 0, dot ) + ".ifa";
    446444                        if ( creat( cfa_cpp_out.c_str(), 0666 ) == -1 ) {
    447445                                perror( "CC1 Translator error: stage 2, creat" );
     
    464462        // output.  Otherwise, run the cfa-cpp preprocessor on the temporary file and save the result into the output file.
    465463
    466         if ( fork() == 0 ) {                                                            // child runs CFA preprocessor
     464        if ( fork() == 0 ) {                                                            // child runs CFA
    467465                cargs[0] = ( *new string( bprefix + "cfa-cpp" ) ).c_str();
    468466                cargs[ncargs++] = cpp_in;
     
    522520        #endif // __DEBUG_H__
    523521
    524         if ( fork() == 0 ) {                                                            // child runs gcc
     522        if ( fork() == 0 ) {                                                            // child runs CFA
    525523                args[0] = compiler_path.c_str();
    526524                args[nargs++] = "-S";                                                   // only compile and put assembler output in specified file
Note: See TracChangeset for help on using the changeset viewer.