Changes in driver/cc1.cc [bec4d24:d6f4488]
- File:
-
- 1 edited
-
driver/cc1.cc (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
rbec4d24 rd6f4488 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 3 16:57:05201813 // Update Count : 12 512 // Last Modified On : Thu Aug 23 09:48:40 2018 13 // Update Count : 122 14 14 // 15 15 … … 32 32 string compiler_name( CFA_BACKEND_CC ); // path/name of C compiler 33 33 34 string D__GCC_X__( "-D__GCC_X__=" ); 34 35 string D__GCC_BPREFIX__( "-D__GCC_BPREFIX__=" ); 35 36 string D__CFA_FLAGPREFIX__( "-D__CFA_FLAG__=" ); … … 45 46 enum { NumSuffixes = 2 }; 46 47 const string suffixes[NumSuffixes] = { "cfa", "hfa", }; 48 47 49 48 50 void suffix( string arg, const char * args[], int & nargs ) { … … 114 116 void Stage1( const int argc, const char * const argv[] ) { 115 117 int code; 118 int i; 116 119 117 120 string arg; … … 136 139 cerr << "Stage1" << endl; 137 140 #endif // __DEBUG_H__ 141 142 // process all the arguments 143 138 144 checkEnv( args, nargs ); // arguments passed via environment variables 139 #ifdef __DEBUG_H__ 140 for ( int i = 1; i < argc; i += 1 ) { 145 146 for ( i = 1; i < argc; i += 1 ) { 147 #ifdef __DEBUG_H__ 141 148 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 142 } // for 143 #endif // __DEBUG_H__ 144 145 // process all the arguments 146 147 for ( int i = 1; i < argc; i += 1 ) { 149 #endif // __DEBUG_H__ 148 150 arg = argv[i]; 151 #ifdef __DEBUG_H__ 152 cerr << "arg:\"" << arg << "\"" << endl; 153 #endif // __DEBUG_H__ 149 154 if ( prefix( arg, "-" ) ) { 150 155 // strip g++ flags that are inappropriate or cause duplicates in subsequent passes … … 180 185 ncargs += 1; 181 186 i += 1; // and the argument 187 // } else if ( prefix( arg, D__GCC_X__ ) ) { 188 // args[nargs] = "-x"; 189 // nargs += 1; 190 // args[nargs] = ( *new string( arg.substr( D__GCC_X__.size() ) ) ).c_str(); // pass the flag along 191 // nargs += 1; 192 // } else if ( arg == "-D" && prefix( argv[i + 1], D__GCC_X__.substr(2) ) ) { 193 // args[nargs] = "-x"; 194 // nargs += 1; 195 // args[nargs] = ( *new string( string( argv[i + 1] ).substr( D__GCC_X__.size() - 2 ) ) ).c_str(); // pass the flag along 196 // nargs += 1; 197 // i += 1; // and the argument 182 198 } else if ( prefix( arg, D__GCC_BPREFIX__ ) ) { 183 199 bprefix = arg.substr( D__GCC_BPREFIX__.size() ); … … 235 251 #ifdef __DEBUG_H__ 236 252 cerr << "args:"; 237 for ( i nt i= 1; i < nargs; i += 1 ) {253 for ( i = 1; i < nargs; i += 1 ) { 238 254 cerr << " " << args[i]; 239 255 } // for … … 266 282 #ifdef __DEBUG_H__ 267 283 cerr << "nargs: " << nargs << endl; 268 for ( i nt i= 0; args[i] != NULL; i += 1 ) {284 for ( i = 0; args[i] != NULL; i += 1 ) { 269 285 cerr << args[i] << " "; 270 286 } // for … … 308 324 #ifdef __DEBUG_H__ 309 325 cerr << "cpp nargs: " << nargs << endl; 310 for ( i nt i= 0; args[i] != NULL; i += 1 ) {326 for ( i = 0; args[i] != NULL; i += 1 ) { 311 327 cerr << args[i] << " "; 312 328 } // for … … 361 377 #ifdef __DEBUG_H__ 362 378 cerr << "cfa-cpp ncargs: " << o_name << " " << CFA_flag << " " << ncargs << endl; 363 for ( i nt i= 0; cargs[i] != NULL; i += 1 ) {379 for ( i = 0; cargs[i] != NULL; i += 1 ) { 364 380 cerr << cargs[i] << " "; 365 381 } // for … … 391 407 392 408 void Stage2( const int argc, const char * const * argv ) { 409 int i; 410 393 411 string arg; 394 412 … … 401 419 cerr << "Stage2" << endl; 402 420 #endif // __DEBUG_H__ 421 422 // process all the arguments 423 403 424 checkEnv( args, nargs ); // arguments passed via environment variables 404 #ifdef __DEBUG_H__ 405 for ( int i = 1; i < argc; i += 1 ) { 425 426 for ( i = 1; i < argc; i += 1 ) { 427 #ifdef __DEBUG_H__ 406 428 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 407 } // for 408 #endif // __DEBUG_H__ 409 410 // process all the arguments 411 412 for ( int i = 1; i < argc; i += 1 ) { 429 #endif // __DEBUG_H__ 413 430 arg = argv[i]; 431 #ifdef __DEBUG_H__ 432 cerr << "arg:\"" << arg << "\"" << endl; 433 #endif // __DEBUG_H__ 414 434 if ( prefix( arg, "-" ) ) { 415 435 // strip inappropriate flags … … 456 476 #ifdef __DEBUG_H__ 457 477 cerr << "args:"; 458 for ( i nt i= 1; i < nargs; i += 1 ) {478 for ( i = 1; i < nargs; i += 1 ) { 459 479 cerr << " " << args[i]; 460 480 } // for … … 472 492 #ifdef __DEBUG_H__ 473 493 cerr << "stage2 nargs: " << nargs << endl; 474 for ( i nt i= 0; args[i] != NULL; i += 1 ) {494 for ( i = 0; args[i] != NULL; i += 1 ) { 475 495 cerr << args[i] << " "; 476 496 } // for … … 486 506 int main( const int argc, const char * const argv[], __attribute__((unused)) const char * const env[] ) { 487 507 #ifdef __DEBUG_H__ 488 for ( int i nt i= 0; env[i] != NULL; i += 1 ) {508 for ( int i = 0; env[i] != NULL; i += 1 ) { 489 509 cerr << env[i] << endl; 490 510 } // for
Note:
See TracChangeset
for help on using the changeset viewer.