Changes in src/main.cc [faf8857:ca1c11f]
- File:
-
- 1 edited
-
src/main.cc (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
rfaf8857 rca1c11f 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 : T hu Dec 17 12:59:06 201513 // Update Count : 1 7911 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Jan 19 16:28:13 2016 13 // Update Count : 194 14 14 // 15 15 … … 42 42 #include "InitTweak/Mutate.h" 43 43 #include "InitTweak/RemoveInit.h" 44 #include "InitTweak/FixInit.h" 44 45 //#include "Explain/GenProlog.h" 45 46 //#include "Try/Visit.h" … … 61 62 astp = false, 62 63 bresolvep = false, 64 ctorinitp = false, 63 65 exprp = false, 64 66 expraltp = false, … … 74 76 codegenp = false; 75 77 76 enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, };78 enum { Ast, Bresolver, CtorInitFix, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Validate, }; 77 79 78 80 static struct option long_opts[] = { 79 81 { "ast", no_argument, 0, Ast }, 80 82 { "before-resolver", no_argument, 0, Bresolver }, 83 { "ctorinitfix", no_argument, 0, CtorInitFix }, 81 84 { "expr", no_argument, 0, Expr }, 82 85 { "expralt", no_argument, 0, ExprAlt }, … … 99 102 100 103 opterr = 0; // prevent getopt from printing error messages 101 104 102 105 int c; 103 while ( (c = getopt_long( argc, argv, "ab efglnpqrsvyzD:", long_opts, &long_index )) != -1 ) {106 while ( (c = getopt_long( argc, argv, "abcefFglnpqrsvyzD:", long_opts, &long_index )) != -1 ) { 104 107 switch ( c ) { 105 108 case Ast: … … 110 113 case 'b': // print before resolver steps 111 114 bresolvep = true; 115 break; 116 case CtorInitFix: 117 case 'c': 118 ctorinitp = true; 112 119 break; 113 120 case Expr: … … 182 189 output = new ofstream( argv[ optind ] ); 183 190 } // if 184 191 185 192 Parser::get_parser().set_debug( grammarp ); 186 193 … … 203 210 exit( 1 ); 204 211 } // if 205 212 206 213 parse( prelude, LinkageSpec::Intrinsic ); 207 214 } // if 208 215 } // if 209 216 210 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp ); 211 217 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp ); 218 212 219 if ( parsep ) { 213 220 Parser::get_parser().get_parseTree()->printList( std::cout ); … … 244 251 OPTPRINT( "mutate" ) 245 252 ControlStruct::mutate( translationUnit ); 246 OPTPRINT( "fixNames" ) 253 OPTPRINT( "fixNames" ) 247 254 CodeGen::fixNames( translationUnit ); 248 OPTPRINT( "tweak " )255 OPTPRINT( "tweakInit" ) 249 256 InitTweak::tweak( translationUnit ); 250 257 … … 263 270 if ( exprp ) { 264 271 dump( translationUnit ); 272 return 0; 273 } 274 275 OPTPRINT( "fixInit" ) 276 // fix ObjectDecl - replaces ConstructorInit nodes 277 InitTweak::fix( translationUnit ); 278 if ( ctorinitp ) { 279 dump ( translationUnit ); 280 return 0; 265 281 } 266 282 … … 331 347 std::list< Declaration * > decls; 332 348 if ( noprotop ) { 333 filter( translationUnit.begin(), translationUnit.end(), 349 filter( translationUnit.begin(), translationUnit.end(), 334 350 std::back_inserter( decls ), notPrelude ); 335 351 } else {
Note:
See TracChangeset
for help on using the changeset viewer.