Changeset b740f0b for driver/cc1.cc
- Timestamp:
- Aug 22, 2018, 9:39:45 PM (5 years ago)
- Branches:
- aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- d6f4488
- Parents:
- 92f413c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
r92f413c rb740f0b 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Jul 19 10:46:11201813 // Update Count : 1 1112 // Last Modified On : Wed Aug 22 17:26:09 2018 13 // Update Count : 120 14 14 // 15 15 … … 47 47 const string suffixes[NumSuffixes] = { "cfa", "hfa", }; 48 48 49 bool suffix( string arg ) { 49 50 void suffix( string arg, const char * args[], int & nargs ) { 50 51 //std::cerr << arg << std::endl; 51 52 size_t dot = arg.find_last_of( "." ); 52 53 //std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl; 53 if ( dot == string::npos ) return false;54 if ( dot == string::npos ) return; 54 55 string sx = arg.substr( dot + 1 ); 55 56 for ( int i = 0; i < NumSuffixes; i += 1 ) { 56 if ( sx == suffixes[i] ) return true; 57 } // for 58 return false; 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 59 65 } // suffix 60 66 61 67 62 void checkEnv( const char * args[], int &nargs ) {68 void checkEnv( const char * args[], int & nargs ) { 63 69 char *value; 64 70 … … 263 269 264 270 args[0] = compiler_name.c_str(); 271 suffix( cpp_in, args, nargs ); // check suffix 265 272 args[nargs] = cpp_in; 266 273 nargs += 1; … … 310 317 311 318 args[0] = compiler_name.c_str(); 312 if ( suffix( cpp_in ) ) { 313 args[nargs] = "-x"; 314 nargs += 1; 315 args[nargs] = "c"; 316 nargs += 1; 317 } // if 319 suffix( cpp_in, args, nargs ); // check suffix 318 320 args[nargs] = cpp_in; // input to cpp 319 321 nargs += 1; … … 354 356 355 357 if ( fork() == 0 ) { // child runs CFA 356 cargs[0] = ( *new string( bprefix + " /cfa-cpp" ) ).c_str();358 cargs[0] = ( *new string( bprefix + "cfa-cpp" ) ).c_str(); 357 359 358 360 // Source file-name used to generate routine names containing global initializations for TU.
Note: See TracChangeset
for help on using the changeset viewer.