Changeset 711eee5 for src/main.cc
- Timestamp:
- May 4, 2016, 4:57:43 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:
- 4e24610
- Parents:
- 1b7ea43
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r1b7ea43 r711eee5 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // main.cc -- 7 // main.cc -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Fri May 15 23:12:02 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Jan 27 22:20:20201611 // Last Modified By : Rob Schluntz 12 // Last Modified On : Wed May 04 16:54:52 2016 13 13 // Update Count : 199 14 14 // … … 41 41 #include "InitTweak/Mutate.h" 42 42 #include "InitTweak/RemoveInit.h" 43 #include "InitTweak/FixGlobalInit.h" 43 44 //#include "Explain/GenProlog.h" 44 45 //#include "Try/Visit.h" … … 100 101 101 102 opterr = 0; // prevent getopt from printing error messages 102 103 103 104 int c; 104 105 while ( (c = getopt_long( argc, argv, "abefglnpqrstvyzD:", long_opts, &long_index )) != -1 ) { … … 172 173 173 174 try { 175 std::string fileName; 176 174 177 // choose to read the program from a file or stdin 175 178 if ( optind < argc ) { 176 179 input = fopen( argv[ optind ], "r" ); 177 180 if ( ! input ) { 178 std::cout << "Error: can't open " << argv[ optind] << std::endl;181 std::cout << "Error: can't open " << argv[ optind ] << std::endl; 179 182 exit( 1 ); 180 183 } // if 181 184 optind += 1; 185 186 // assert( optind < argc ); 187 fileName = argv[ optind-1 ]; // placeholder 188 // optind += 1; 182 189 } else { 183 190 input = stdin; … … 187 194 output = new ofstream( argv[ optind ] ); 188 195 } // if 189 196 190 197 Parser::get_parser().set_debug( grammarp ); 191 198 … … 208 215 exit( 1 ); 209 216 } // if 210 217 211 218 parse( prelude, LinkageSpec::Intrinsic ); 212 219 } // if 213 220 } // if 214 221 215 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp ); 216 222 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp ); 223 217 224 if ( parsep ) { 218 225 Parser::get_parser().get_parseTree()->printList( std::cout ); … … 249 256 OPTPRINT( "mutate" ) 250 257 ControlStruct::mutate( translationUnit ); 251 OPTPRINT( "fixNames" ) 258 OPTPRINT( "fixNames" ) 252 259 CodeGen::fixNames( translationUnit ); 260 OPTPRINT( "fixGlobalInit" ); 261 InitTweak::fixGlobalInit( translationUnit, fileName ); 253 262 OPTPRINT( "tweak" ) 254 263 InitTweak::tweak( translationUnit ); … … 278 287 OPTPRINT( "box" ) 279 288 GenPoly::box( translationUnit ); 280 289 281 290 // print tree right before code generation 282 291 if ( codegenp ) { … … 334 343 std::list< Declaration * > decls; 335 344 if ( noprotop ) { 336 filter( translationUnit.begin(), translationUnit.end(), 345 filter( translationUnit.begin(), translationUnit.end(), 337 346 std::back_inserter( decls ), notPrelude ); 338 347 } else {
Note: See TracChangeset
for help on using the changeset viewer.