Changeset 794db28 for driver/cc1.cc
- Timestamp:
- Aug 18, 2020, 11:35:50 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 93526ef
- Parents:
- d2b5d2d (diff), 36de20d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
rd2b5d2d r794db28 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 13 21:03:15202013 // Update Count : 4 0712 // Last Modified On : Sun Aug 16 21:03:02 2020 13 // Update Count : 413 14 14 // 15 15 … … 24 24 #include <unistd.h> // execvp, fork, unlink 25 25 #include <sys/wait.h> // wait 26 #include <fcntl.h> 26 #include <fcntl.h> // creat 27 27 28 28 … … 59 59 60 60 61 static string __CFA_FLAGPREFIX__( "__CFA_FLAG" ); // " N__=" suffix61 static string __CFA_FLAGPREFIX__( "__CFA_FLAG" ); // "__CFA_FLAG__=" suffix 62 62 63 63 static void checkEnv1( const char * args[], int & nargs ) { // stage 1 … … 111 111 } // checkEnv2 112 112 113 114 static char tmpname[] = P_tmpdir "/CFAXXXXXX.ifa"; 113 #define CFA_SUFFIX ".ifa" 114 115 static char tmpname[] = P_tmpdir "/CFAXXXXXX" CFA_SUFFIX; 115 116 static int tmpfilefd = -1; 116 117 static bool startrm = false; … … 321 322 322 323 if ( WIFSIGNALED(code) ) { // child failed ? 324 rmtmpfile(); // remove tmpname 323 325 cerr << "CC1 Translator error: stage 1, child failed " << WTERMSIG(code) << endl; 324 326 exit( EXIT_FAILURE ); 325 327 } // if 326 328 327 exit( WEXITSTATUS( code) );// bad cpp result stops top-level gcc329 exit( WEXITSTATUS( code ) ); // bad cpp result stops top-level gcc 328 330 } // Stage1 329 331 … … 373 375 } else if ( arg == "-fno-diagnostics-color" ) { 374 376 color_arg = Color_Auto; 375 } 377 } // if 376 378 377 379 if ( arg == "-quiet" || arg == "-version" || arg == "-fpreprocessed" || 378 // Currently CFA does not suppose precompiled .h files.379 prefix( arg, "--output-pch" ) ) {380 // Currently CFA does not suppose precompiled .h files. 381 prefix( arg, "--output-pch" ) ) { 380 382 381 383 // strip inappropriate flags with an argument … … 441 443 } // if 442 444 443 cfa_cpp_out = cfa_cpp_out.substr( 0, dot ) + ".ifa";445 cfa_cpp_out = cfa_cpp_out.substr( 0, dot ) + CFA_SUFFIX; 444 446 if ( creat( cfa_cpp_out.c_str(), 0666 ) == -1 ) { 445 447 perror( "CC1 Translator error: stage 2, creat" ); … … 462 464 // output. Otherwise, run the cfa-cpp preprocessor on the temporary file and save the result into the output file. 463 465 464 if ( fork() == 0 ) { // child runs CFA 466 if ( fork() == 0 ) { // child runs CFA preprocessor 465 467 cargs[0] = ( *new string( bprefix + "cfa-cpp" ) ).c_str(); 466 468 cargs[ncargs++] = cpp_in; … … 520 522 #endif // __DEBUG_H__ 521 523 522 if ( fork() == 0 ) { // child runs CFA524 if ( fork() == 0 ) { // child runs gcc 523 525 args[0] = compiler_path.c_str(); 524 526 args[nargs++] = "-S"; // only compile and put assembler output in specified file
Note: See TracChangeset
for help on using the changeset viewer.