Changes in driver/cc1.cc [36de20d:db62eef]
- File:
-
- 1 edited
-
driver/cc1.cc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
r36de20d rdb62eef 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Aug 16 21:03:02202013 // Update Count : 4 1312 // Last Modified On : Thu Aug 13 21:03:15 2020 13 // Update Count : 407 14 14 // 15 15 … … 24 24 #include <unistd.h> // execvp, fork, unlink 25 25 #include <sys/wait.h> // wait 26 #include <fcntl.h> // creat26 #include <fcntl.h> 27 27 28 28 … … 59 59 60 60 61 static string __CFA_FLAGPREFIX__( "__CFA_FLAG" ); // " __CFA_FLAG__=" suffix61 static string __CFA_FLAGPREFIX__( "__CFA_FLAG" ); // "N__=" suffix 62 62 63 63 static void checkEnv1( const char * args[], int & nargs ) { // stage 1 … … 111 111 } // checkEnv2 112 112 113 #define CFA_SUFFIX ".ifa" 114 115 static char tmpname[] = P_tmpdir "/CFAXXXXXX" CFA_SUFFIX; 113 114 static char tmpname[] = P_tmpdir "/CFAXXXXXX.ifa"; 116 115 static int tmpfilefd = -1; 117 116 static bool startrm = false; … … 322 321 323 322 if ( WIFSIGNALED(code) ) { // child failed ? 324 rmtmpfile(); // remove tmpname325 323 cerr << "CC1 Translator error: stage 1, child failed " << WTERMSIG(code) << endl; 326 324 exit( EXIT_FAILURE ); 327 325 } // if 328 326 329 exit( WEXITSTATUS( code ) );// bad cpp result stops top-level gcc327 exit( WEXITSTATUS(code) ); // bad cpp result stops top-level gcc 330 328 } // Stage1 331 329 … … 375 373 } else if ( arg == "-fno-diagnostics-color" ) { 376 374 color_arg = Color_Auto; 377 } // if375 } 378 376 379 377 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" ) ) { 382 380 383 381 // strip inappropriate flags with an argument … … 443 441 } // if 444 442 445 cfa_cpp_out = cfa_cpp_out.substr( 0, dot ) + CFA_SUFFIX;443 cfa_cpp_out = cfa_cpp_out.substr( 0, dot ) + ".ifa"; 446 444 if ( creat( cfa_cpp_out.c_str(), 0666 ) == -1 ) { 447 445 perror( "CC1 Translator error: stage 2, creat" ); … … 464 462 // output. Otherwise, run the cfa-cpp preprocessor on the temporary file and save the result into the output file. 465 463 466 if ( fork() == 0 ) { // child runs CFA preprocessor464 if ( fork() == 0 ) { // child runs CFA 467 465 cargs[0] = ( *new string( bprefix + "cfa-cpp" ) ).c_str(); 468 466 cargs[ncargs++] = cpp_in; … … 522 520 #endif // __DEBUG_H__ 523 521 524 if ( fork() == 0 ) { // child runs gcc522 if ( fork() == 0 ) { // child runs CFA 525 523 args[0] = compiler_path.c_str(); 526 524 args[nargs++] = "-S"; // only compile and put assembler output in specified file
Note:
See TracChangeset
for help on using the changeset viewer.