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