- Timestamp:
- Sep 27, 2023, 9:56:47 PM (15 months ago)
- Branches:
- master
- Children:
- ca20b07
- Parents:
- 5a1ae14
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
r5a1ae14 r7350330f 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 9 11:36:44202313 // Update Count : 42 312 // Last Modified On : Mon Sep 25 11:07:22 2023 13 // Update Count : 427 14 14 // 15 15 16 16 #include <iostream> 17 using std::cerr;18 using std::endl;19 17 #include <string> 20 using std::string;21 18 #include <algorithm> // find 22 19 #include <cstdio> // stderr, stdout, perror, fprintf 23 20 #include <cstdlib> // getenv, exit, mkstemp 21 using namespace std; 24 22 #include <unistd.h> // execvp, fork, unlink 25 23 #include <sys/wait.h> // wait … … 52 50 if ( dot == string::npos ) return; 53 51 const string * end = suffixes + NumSuffixes; 54 if ( std::find( suffixes, end, arg.substr( dot + 1 ) ) != end ) {52 if ( find( suffixes, end, arg.substr( dot + 1 ) ) != end ) { 55 53 args[nargs++] = "-x"; 56 54 args[nargs++] = "c"; … … 153 151 154 152 #ifdef __DEBUG_H__ 155 cerr << " Stage1" << endl;153 cerr << "#########" << endl << "Stage1 " << string( 100, '#' ) << endl << "#########" << endl; 156 154 #endif // __DEBUG_H__ 157 155 checkEnv1(); // arguments passed via environment variables 158 156 #ifdef __DEBUG_H__ 157 cerr << string( 100, '*' ) << endl; 159 158 for ( int i = 1; i < argc; i += 1 ) { 160 159 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 161 160 } // for 161 cerr << string( 100, '*' ) << endl; 162 162 #endif // __DEBUG_H__ 163 163 … … 260 260 } else { 261 261 args[nargs++] = "-x"; 262 args[nargs++] = ( *new string( lang .c_str()) ).c_str();262 args[nargs++] = ( *new string( lang ) ).c_str(); 263 263 } // if 264 264 args[nargs++] = cpp_in; … … 275 275 } // for 276 276 cerr << endl; 277 cerr << string( 100, '*' ) << endl; 277 278 #endif // __DEBUG_H__ 278 279 … … 298 299 } else { 299 300 args[nargs++] = "-x"; 300 args[nargs++] = ( *new string( lang .c_str()) ).c_str();301 args[nargs++] = ( *new string( lang ) ).c_str(); 301 302 } // if 302 303 args[nargs++] = cpp_in; // input to cpp … … 346 347 347 348 #ifdef __DEBUG_H__ 348 cerr << " Stage2" << endl;349 cerr << "#########" << endl << "Stage2 " << string( 100, '#' ) << endl << "#########" << endl; 349 350 #endif // __DEBUG_H__ 350 351 checkEnv2( cargs, ncargs ); // arguments passed via environment variables 351 352 #ifdef __DEBUG_H__ 353 cerr << string( 100, '*' ) << endl; 352 354 for ( int i = 1; i < argc; i += 1 ) { 353 355 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 354 356 } // for 357 cerr << string( 100, '*' ) << endl; 355 358 #endif // __DEBUG_H__ 356 359 … … 473 476 if ( CFA_flag ) { // run cfa-cpp ? 474 477 if ( o_file.size() != 0 ) { // location for output 475 cargs[ncargs++] = ( *new string( o_file .c_str()) ).c_str();478 cargs[ncargs++] = ( *new string( o_file ) ).c_str(); 476 479 } // if 477 480 } else { … … 571 574 int main( const int argc, const char * const argv[], __attribute__((unused)) const char * const env[] ) { 572 575 #ifdef __DEBUG_H__ 573 for ( int i = 0; env[i] != nullptr; i += 1 ) { 574 cerr << env[i] << endl; 575 } // for 576 cerr << "#########" << endl << "main cc1 " << string( 100, '#' ) << endl << "#########" << endl; 576 577 #endif // __DEBUG_H__ 577 578
Note: See TracChangeset
for help on using the changeset viewer.