Changes in src/driver/cc1.cc [1db21619:4c82a3c]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/driver/cc1.cc
r1db21619 r4c82a3c 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 16 17:09:14 201513 // Update Count : 5412 // Last Modified On : Fri Jun 10 09:27:37 2016 13 // Update Count : 80 14 14 // 15 15 … … 30 30 31 31 32 string compiler_name( GCC_PATH );// path/name of C compiler32 string compiler_name( CFA_BACKEND_CC ); // path/name of C compiler 33 33 34 34 string D__GCC_BPREFIX__( "-D__GCC_BPREFIX__=" ); … … 108 108 const char *args[argc + 100]; // leave space for 100 additional cpp command line values 109 109 int nargs = 1; // number of arguments in args list; 0 => command name 110 const char * uargs[20]; // leave space for 20 additional cfa-cpp command line values111 int n uargs = 1; // 0 => command name110 const char *cargs[20]; // leave space for 20 additional cfa-cpp command line values 111 int ncargs = 1; // 0 => command name 112 112 113 113 signal( SIGINT, sigTermHandler ); 114 114 signal( SIGTERM, sigTermHandler ); 115 116 #ifdef __DEBUG_H__ 117 cerr << "Stage1" << endl; 118 #endif // __DEBUG_H__ 115 119 116 120 // process all the arguments … … 147 151 i += 1; // and the argument 148 152 cpp_flag = true; 149 } else if ( arg == "-D__CFA_ _" ) {153 } else if ( arg == "-D__CFA_PREPROCESS__" ) { 150 154 CFA_flag = true; 151 } else if ( arg == "-D" && string( argv[i + 1] ) == "__CFA_ _" ) {155 } else if ( arg == "-D" && string( argv[i + 1] ) == "__CFA_PREPROCESS__" ) { 152 156 i += 1; // and the argument 153 157 CFA_flag = true; 154 158 } else if ( prefix( arg, D__CFA_FLAGPREFIX__ ) ) { 155 uargs[nuargs] = ( *new string( arg.substr( D__CFA_FLAGPREFIX__.size() ) ) ).c_str();156 n uargs += 1;159 cargs[ncargs] = ( *new string( arg.substr( D__CFA_FLAGPREFIX__.size() ) ) ).c_str(); 160 ncargs += 1; 157 161 } else if ( arg == "-D" && prefix( argv[i + 1], D__CFA_FLAGPREFIX__.substr(2) ) ) { 158 uargs[nuargs] = ( *new string( string( argv[i + 1] ).substr( D__CFA_FLAGPREFIX__.size() - 2 ) ) ).c_str();159 n uargs += 1;162 cargs[ncargs] = ( *new string( string( argv[i + 1] ).substr( D__CFA_FLAGPREFIX__.size() - 2 ) ) ).c_str(); 163 ncargs += 1; 160 164 i += 1; // and the argument 161 165 } else if ( prefix( arg, D__GCC_BPREFIX__ ) ) { … … 317 321 318 322 if ( fork() == 0 ) { // child runs CFA 319 uargs[0] = ( *new string( bprefix + "/cfa-cpp" ) ).c_str(); 320 321 uargs[nuargs] = tmpname; 322 nuargs += 1; 323 cargs[0] = ( *new string( bprefix + "/cfa-cpp" ) ).c_str(); 324 325 // Source file-name used to generate routine names containing global initializations for TU. 326 cargs[ncargs] = ( *new string( "-F" ) ).c_str(); 327 ncargs += 1; 328 cargs[ncargs] = ( *new string( string( cpp_in ) ) ).c_str(); 329 ncargs += 1; 330 331 cargs[ncargs] = tmpname; 332 ncargs += 1; 323 333 if ( o_name != NULL ) { 324 uargs[nuargs] = o_name;325 n uargs += 1;334 cargs[ncargs] = o_name; 335 ncargs += 1; 326 336 } else if ( ! CFA_flag ) { // run cfa-cpp ? 327 uargs[nuargs] = cpp_out;328 n uargs += 1;337 cargs[ncargs] = cpp_out; 338 ncargs += 1; 329 339 } // if 330 uargs[nuargs] = NULL; // terminate argument list331 332 #ifdef __DEBUG_H__ 333 cerr << "cfa-cpp n uargs: " << o_name << " " << CFA_flag << " " << nuargs << endl;334 for ( i = 0; uargs[i] != NULL; i += 1 ) {335 cerr << uargs[i] << " ";340 cargs[ncargs] = NULL; // terminate argument list 341 342 #ifdef __DEBUG_H__ 343 cerr << "cfa-cpp ncargs: " << o_name << " " << CFA_flag << " " << ncargs << endl; 344 for ( i = 0; cargs[i] != NULL; i += 1 ) { 345 cerr << cargs[i] << " "; 336 346 } // for 337 347 cerr << endl; 338 348 #endif // __DEBUG_H__ 339 349 340 execvp( uargs[0], (char * const *)uargs ); // should not return350 execvp( cargs[0], (char * const *)cargs ); // should not return 341 351 perror( "CFA Translator error: cpp level, execvp" ); 342 352 exit( EXIT_FAILURE ); … … 370 380 const char *args[argc + 100]; // leave space for 100 additional cfa command line values 371 381 int nargs = 1; // number of arguments in args list; 0 => command name 382 383 #ifdef __DEBUG_H__ 384 cerr << "Stage2" << endl; 385 #endif // __DEBUG_H__ 372 386 373 387 // process all the arguments … … 467 481 468 482 if ( arg == "-E" ) { 469 #ifdef __DEBUG_H__470 cerr << "Stage1" << endl;471 #endif // __DEBUG_H__472 483 Stage1( argc, argv ); 473 484 } else if ( arg == "-fpreprocessed" ) { 474 #ifdef __DEBUG_H__475 cerr << "Stage2" << endl;476 #endif // __DEBUG_H__477 485 Stage2( argc, argv ); 478 486 } else {
Note:
See TracChangeset
for help on using the changeset viewer.