Changeset 0bf5340
- Timestamp:
- Sep 10, 2019, 9:01:32 AM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 216597d
- Parents:
- 7c8246d
- Location:
- driver
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
r7c8246d r0bf5340 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 30 15:36:42201913 // Update Count : 3 7712 // Last Modified On : Mon Sep 9 17:50:53 2019 13 // Update Count : 384 14 14 // 15 15 … … 58 58 59 59 60 static string __CFA_FLAGPREFIX__( "__CFA_FLAG" ); 60 static string __CFA_FLAGPREFIX__( "__CFA_FLAG" ); // "N__=" suffix 61 61 62 62 static void checkEnv1( const char * args[], int & nargs ) { // stage 1 … … 70 70 71 71 if ( prefix( arg, __CFA_FLAGPREFIX__ ) ) { 72 string val( arg.substr( __CFA_FLAGPREFIX__.size() + 4) );72 string val( arg.substr( arg.find_first_of( "=" ) + 1 ) ); 73 73 if ( prefix( val, "-compiler=" ) ) { 74 74 compiler_path = val.substr( 10 ); … … 89 89 90 90 if ( prefix( arg, __CFA_FLAGPREFIX__ ) ) { 91 string val( arg.substr( __CFA_FLAGPREFIX__.size() + 4) );91 string val( arg.substr( arg.find_first_of( "=" ) + 1 ) ); 92 92 if ( prefix( val, "-compiler=" ) ) { 93 93 compiler_path = val.substr( 10 ); … … 101 101 bprefix = val.substr( 3 ); 102 102 } else { // normal flag for cfa-cpp 103 args[nargs++] = ( *new string( arg.substr( __CFA_FLAGPREFIX__.size() + 4) ) ).c_str();103 args[nargs++] = ( *new string( arg.substr( arg.find_first_of( "=" ) + 1 ) ) ).c_str(); 104 104 } // if 105 105 } // if … … 108 108 109 109 110 static char tmpname[] = P_tmpdir "/CFAXXXXXX.i ";110 static char tmpname[] = P_tmpdir "/CFAXXXXXX.ifa"; 111 111 static int tmpfilefd = -1; 112 112 static bool startrm = false; … … 414 414 } // if 415 415 } else { 416 tmpfilefd = mkstemps( tmpname, 2);416 tmpfilefd = mkstemps( tmpname, 4 ); 417 417 if ( tmpfilefd == -1 ) { 418 418 perror( "CC1 Translator error: stage 2, mkstemp" ); … … 487 487 args[0] = compiler_path.c_str(); 488 488 args[nargs++] = "-S"; // only compile and put assembler output in specified file 489 if ( save_temps ) { // make gcc accept .ifa suffix 490 args[nargs++] = "-x"; 491 args[nargs++] = "cpp-output"; 492 } // if 489 args[nargs++] = "-x"; 490 args[nargs++] = "cpp-output"; 491 493 492 args[nargs++] = cfa_cpp_out.c_str(); 494 493 args[nargs] = nullptr; // terminate argument list … … 509 508 510 509 wait( &code ); // wait for child to finish 510 rmtmpfile(); // remove tmpname 511 511 512 512 if ( WIFSIGNALED(code) ) { // child failed ? 513 rmtmpfile(); // remove tmpname514 513 cerr << "CC1 Translator error: stage 2, child failed " << WTERMSIG(code) << endl; 515 514 exit( EXIT_FAILURE ); … … 520 519 #endif // __DEBUG_H__ 521 520 522 rmtmpfile(); // remove tmpname523 521 exit( WEXITSTATUS( code ) ); // stop regardless of success or failure 524 522 } // Stage2 -
driver/cfa.cc
r7c8246d r0bf5340 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Aug 27 06:11:24201913 // Update Count : 41 612 // Last Modified On : Mon Sep 9 17:57:40 2019 13 // Update Count : 417 14 14 // 15 15 … … 36 36 37 37 38 static string __CFA_FLAGPREFIX__( "__CFA_FLAG" ); // "N__=" suffix 39 38 40 void Putenv( char * argv[], string arg ) { 39 41 static int flags = 0; // environment variables must have unique names 40 42 41 if ( putenv( (char *)( *new string( string( "__CFA_FLAG"+ to_string( flags++ ) + "__=" ) + arg ) ).c_str() ) ) {43 if ( putenv( (char *)( *new string( string( __CFA_FLAGPREFIX__ + to_string( flags++ ) + "__=" ) + arg ) ).c_str() ) ) { 42 44 cerr << argv[0] << " error, cannot set environment variable." << endl; 43 45 exit( EXIT_FAILURE );
Note: See TracChangeset
for help on using the changeset viewer.