Changes in driver/cc1.cc [d6f4488:bf71cfd]
- File:
-
- 1 edited
-
driver/cc1.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
rd6f4488 rbf71cfd 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 23 09:48:40201813 // Update Count : 1 2212 // Last Modified On : Thu Jul 19 10:46:11 2018 13 // Update Count : 111 14 14 // 15 15 … … 47 47 const string suffixes[NumSuffixes] = { "cfa", "hfa", }; 48 48 49 50 void suffix( string arg, const char * args[], int & nargs ) { 49 bool suffix( string arg ) { 51 50 //std::cerr << arg << std::endl; 52 51 size_t dot = arg.find_last_of( "." ); 53 52 //std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl; 54 if ( dot == string::npos ) return ;53 if ( dot == string::npos ) return false; 55 54 string sx = arg.substr( dot + 1 ); 56 55 for ( int i = 0; i < NumSuffixes; i += 1 ) { 57 if ( sx == suffixes[i] ) { 58 args[nargs] = "-x"; 59 nargs += 1; 60 args[nargs] = "c"; 61 nargs += 1; 62 return; 63 } // if 64 } // for 56 if ( sx == suffixes[i] ) return true; 57 } // for 58 return false; 65 59 } // suffix 66 60 67 61 68 void checkEnv( const char * args[], int &nargs ) {62 void checkEnv( const char *args[], int &nargs ) { 69 63 char *value; 70 64 71 value = getenv( "__C FA_COMPILER__" );65 value = getenv( "__COMPILER__" ); 72 66 if ( value != NULL ) { 73 67 compiler_name = value; … … 269 263 270 264 args[0] = compiler_name.c_str(); 271 suffix( cpp_in, args, nargs ); // check suffix272 265 args[nargs] = cpp_in; 273 266 nargs += 1; … … 317 310 318 311 args[0] = compiler_name.c_str(); 319 suffix( cpp_in, args, nargs ); // check suffix 312 if ( suffix( cpp_in ) ) { 313 args[nargs] = "-x"; 314 nargs += 1; 315 args[nargs] = "c"; 316 nargs += 1; 317 } // if 320 318 args[nargs] = cpp_in; // input to cpp 321 319 nargs += 1; … … 356 354 357 355 if ( fork() == 0 ) { // child runs CFA 358 cargs[0] = ( *new string( bprefix + " cfa-cpp" ) ).c_str();356 cargs[0] = ( *new string( bprefix + "/cfa-cpp" ) ).c_str(); 359 357 360 358 // Source file-name used to generate routine names containing global initializations for TU.
Note:
See TracChangeset
for help on using the changeset viewer.