Changeset bec4d24 for driver/cc1.cc
- Timestamp:
- Sep 8, 2018, 8:56:30 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, 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:
- 7117ac3
- Parents:
- 245a92c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cc1.cc
r245a92c rbec4d24 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 : 12 212 // Last Modified On : Mon Sep 3 16:57:05 2018 13 // Update Count : 125 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__=" );35 34 string D__GCC_BPREFIX__( "-D__GCC_BPREFIX__=" ); 36 35 string D__CFA_FLAGPREFIX__( "-D__CFA_FLAG__=" ); … … 46 45 enum { NumSuffixes = 2 }; 47 46 const string suffixes[NumSuffixes] = { "cfa", "hfa", }; 48 49 47 50 48 void suffix( string arg, const char * args[], int & nargs ) { … … 116 114 void Stage1( const int argc, const char * const argv[] ) { 117 115 int code; 118 int i;119 116 120 117 string arg; … … 139 136 cerr << "Stage1" << endl; 140 137 #endif // __DEBUG_H__ 138 checkEnv( args, nargs ); // arguments passed via environment variables 139 #ifdef __DEBUG_H__ 140 for ( int i = 1; i < argc; i += 1 ) { 141 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 142 } // for 143 #endif // __DEBUG_H__ 141 144 142 145 // process all the arguments 143 146 144 checkEnv( args, nargs ); // arguments passed via environment variables 145 146 for ( i = 1; i < argc; i += 1 ) { 147 #ifdef __DEBUG_H__ 148 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 149 #endif // __DEBUG_H__ 147 for ( int i = 1; i < argc; i += 1 ) { 150 148 arg = argv[i]; 151 #ifdef __DEBUG_H__152 cerr << "arg:\"" << arg << "\"" << endl;153 #endif // __DEBUG_H__154 149 if ( prefix( arg, "-" ) ) { 155 150 // strip g++ flags that are inappropriate or cause duplicates in subsequent passes … … 185 180 ncargs += 1; 186 181 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 along191 // 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 along196 // nargs += 1;197 // i += 1; // and the argument198 182 } else if ( prefix( arg, D__GCC_BPREFIX__ ) ) { 199 183 bprefix = arg.substr( D__GCC_BPREFIX__.size() ); … … 251 235 #ifdef __DEBUG_H__ 252 236 cerr << "args:"; 253 for ( i = 1; i < nargs; i += 1 ) {237 for ( int i = 1; i < nargs; i += 1 ) { 254 238 cerr << " " << args[i]; 255 239 } // for … … 282 266 #ifdef __DEBUG_H__ 283 267 cerr << "nargs: " << nargs << endl; 284 for ( i = 0; args[i] != NULL; i += 1 ) {268 for ( int i = 0; args[i] != NULL; i += 1 ) { 285 269 cerr << args[i] << " "; 286 270 } // for … … 324 308 #ifdef __DEBUG_H__ 325 309 cerr << "cpp nargs: " << nargs << endl; 326 for ( i = 0; args[i] != NULL; i += 1 ) {310 for ( int i = 0; args[i] != NULL; i += 1 ) { 327 311 cerr << args[i] << " "; 328 312 } // for … … 377 361 #ifdef __DEBUG_H__ 378 362 cerr << "cfa-cpp ncargs: " << o_name << " " << CFA_flag << " " << ncargs << endl; 379 for ( i = 0; cargs[i] != NULL; i += 1 ) {363 for ( int i = 0; cargs[i] != NULL; i += 1 ) { 380 364 cerr << cargs[i] << " "; 381 365 } // for … … 407 391 408 392 void Stage2( const int argc, const char * const * argv ) { 409 int i;410 411 393 string arg; 412 394 … … 419 401 cerr << "Stage2" << endl; 420 402 #endif // __DEBUG_H__ 403 checkEnv( args, nargs ); // arguments passed via environment variables 404 #ifdef __DEBUG_H__ 405 for ( int i = 1; i < argc; i += 1 ) { 406 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 407 } // for 408 #endif // __DEBUG_H__ 421 409 422 410 // process all the arguments 423 411 424 checkEnv( args, nargs ); // arguments passed via environment variables 425 426 for ( i = 1; i < argc; i += 1 ) { 427 #ifdef __DEBUG_H__ 428 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 429 #endif // __DEBUG_H__ 412 for ( int i = 1; i < argc; i += 1 ) { 430 413 arg = argv[i]; 431 #ifdef __DEBUG_H__432 cerr << "arg:\"" << arg << "\"" << endl;433 #endif // __DEBUG_H__434 414 if ( prefix( arg, "-" ) ) { 435 415 // strip inappropriate flags … … 476 456 #ifdef __DEBUG_H__ 477 457 cerr << "args:"; 478 for ( i = 1; i < nargs; i += 1 ) {458 for ( int i = 1; i < nargs; i += 1 ) { 479 459 cerr << " " << args[i]; 480 460 } // for … … 492 472 #ifdef __DEBUG_H__ 493 473 cerr << "stage2 nargs: " << nargs << endl; 494 for ( i = 0; args[i] != NULL; i += 1 ) {474 for ( int i = 0; args[i] != NULL; i += 1 ) { 495 475 cerr << args[i] << " "; 496 476 } // for … … 506 486 int main( const int argc, const char * const argv[], __attribute__((unused)) const char * const env[] ) { 507 487 #ifdef __DEBUG_H__ 508 for ( int i = 0; env[i] != NULL; i += 1 ) {488 for ( int int i = 0; env[i] != NULL; i += 1 ) { 509 489 cerr << env[i] << endl; 510 490 } // for
Note: See TracChangeset
for help on using the changeset viewer.