Changeset bec4d24 for driver/cfa.cc
- Timestamp:
- Sep 8, 2018, 8:56:30 AM (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:
- 7117ac3
- Parents:
- 245a92c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/cfa.cc
r245a92c rbec4d24 10 10 // Created On : Tue Aug 20 13:44:49 2002 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 23 15:41:55201813 // Update Count : 27 012 // Last Modified On : Mon Sep 3 16:47:59 2018 13 // Update Count : 275 14 14 // 15 15 … … 43 43 const string suffixes[NumSuffixes] = { "cfa", "hfa", }; 44 44 45 voidsuffix( string arg, const char * args[], int & nargs ) {45 bool suffix( string arg, const char * args[], int & nargs ) { 46 46 //std::cerr << arg << std::endl; 47 47 size_t dot = arg.find_last_of( "." ); 48 48 //std::cerr << dot << " " << (dot != string::npos ? arg.substr( dot + 1 ) : "fred" ) << std::endl; 49 if ( dot == string::npos ) return ;49 if ( dot == string::npos ) return false; 50 50 string sx = arg.substr( dot + 1 ); 51 51 for ( int i = 0; i < NumSuffixes; i += 1 ) { … … 55 55 args[nargs] = "c"; 56 56 nargs += 1; 57 return ;57 return true; 58 58 } // if 59 59 } // for 60 return false; 60 61 } // suffix 61 62 … … 128 129 #ifdef __DEBUG_H__ 129 130 cerr << "CFA:" << endl; 131 for ( int i = 1; i < argc; i += 1 ) { 132 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl; 133 } // for 130 134 #endif // __DEBUG_H__ 131 135 … … 133 137 134 138 for ( int i = 1; i < argc; i += 1 ) { 135 #ifdef __DEBUG_H__136 cerr << "argv[" << i << "]:\"" << argv[i] << "\"" << endl;137 #endif // __DEBUG_H__138 139 arg = argv[i]; // convert to string value 139 #ifdef __DEBUG_H__140 cerr << "arg:\"" << arg << "\"" << endl;141 #endif // __DEBUG_H__142 140 if ( prefix( arg, "-" ) ) { 143 141 // pass through arguments … … 202 200 args[nargs] = argv[i]; // pass the argument along 203 201 nargs += 1; 204 } else if ( arg == "-x" ) {205 xflag = true;206 args[nargs] = argv[i]; // pass the argument along207 nargs += 1;208 i += 1; // advance to argument209 args[nargs] = argv[i]; // pass the argument along210 nargs += 1;211 // args[nargs] = ( *new string( string("-D__GCC_X__=") + argv[i] ) ).c_str(); // add the argument for -x212 // nargs += 1;213 } else if ( prefix( arg, "-x" ) ) {214 xflag = true;215 args[nargs] = argv[i]; // pass the argument along216 nargs += 1;217 // args[nargs] = ( *new string( string("-D__GCC_X__=") + arg.substr(2) ) ).c_str(); // add the argument for -x218 // nargs += 1;219 202 } else if ( arg == "-w" ) { 220 203 args[nargs] = argv[i]; // pass the argument along … … 298 281 } // if 299 282 } else { 300 bool opt = false; 301 if ( ! xflag ) { 302 suffix( arg, args, nargs ); // check suffix 303 // args[nargs] = ( *new string( string("-D__GCC_X__=c") ) ).c_str(); // add the argument for -x 304 // nargs += 1; 305 opt = true; 306 } // if 307 // concatenate other arguments 308 args[nargs] = argv[i]; 283 bool cfa = suffix( arg, args, nargs ); // check suffix 284 args[nargs] = argv[i]; // concatenate file 309 285 nargs += 1; 310 if ( opt) {286 if ( cfa ) { 311 287 args[nargs] = "-x"; 312 288 nargs += 1; 313 289 args[nargs] = "none"; 314 290 nargs += 1; 315 // args[nargs] = ( *new string( string("-D__GCC_X__=none") ) ).c_str(); // add the argument for -x316 // nargs += 1;317 291 } // if 318 292 nonoptarg = true; … … 320 294 } // if 321 295 } // for 296 297 args[nargs] = "-x"; // turn off language 298 nargs += 1; 299 args[nargs] = "none"; 300 nargs += 1; 322 301 323 302 #ifdef __x86_64__
Note: See TracChangeset
for help on using the changeset viewer.