Changeset d029162 for src/main.cc
- Timestamp:
- May 6, 2016, 2:07:41 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 9a92216
- Parents:
- 4e24610 (diff), 4acc87f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r4e24610 rd029162 10 10 // Created On : Fri May 15 23:12:02 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed May 04 16:54:52201613 // Update Count : 19912 // Last Modified On : Fri May 06 14:04:49 2016 13 // Update Count : 203 14 14 // 15 15 … … 98 98 std::ostream *output = &std::cout; 99 99 int long_index; 100 std::list< Declaration* > translationUnit; 100 std::list< Declaration * > translationUnit; 101 const char *filename = NULL; 101 102 102 103 opterr = 0; // prevent getopt from printing error messages 103 104 104 105 int c; 105 while ( (c = getopt_long( argc, argv, "abefglnpqrstvyzD: ", long_opts, &long_index )) != -1 ) {106 while ( (c = getopt_long( argc, argv, "abefglnpqrstvyzD:F:", long_opts, &long_index )) != -1 ) { 106 107 switch ( c ) { 107 108 case Ast: … … 163 164 break; 164 165 case 'D': // ignore -Dxxx 166 break; 167 case 'F': // source file-name without suffix 168 filename = optarg; 165 169 break; 166 170 case '?': … … 173 177 174 178 try { 175 std::string fileName;176 177 179 // choose to read the program from a file or stdin 178 180 if ( optind < argc ) { … … 182 184 exit( 1 ); 183 185 } // if 186 // if running cfa-cpp directly, might forget to pass -F option (and really shouldn't have to) 187 if ( filename == NULL ) filename = argv[ optind ]; 184 188 optind += 1; 185 186 // assert( optind < argc );187 fileName = argv[ optind-1 ]; // placeholder188 // optind += 1;189 189 } else { 190 190 input = stdin; … … 259 259 CodeGen::fixNames( translationUnit ); 260 260 OPTPRINT( "fixGlobalInit" ); 261 InitTweak::fixGlobalInit( translationUnit, file Name );261 InitTweak::fixGlobalInit( translationUnit, filename ); 262 262 OPTPRINT( "tweak" ) 263 263 InitTweak::tweak( translationUnit );
Note: See TracChangeset
for help on using the changeset viewer.