Changes in src/main.cc [39786813:d3b7937]
- File:
-
- 1 edited
-
src/main.cc (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r39786813 rd3b7937 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 : Thu Mar 31 14:00:12201613 // Update Count : 20011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 27 22:20:20 2016 13 // Update Count : 199 14 14 // 15 15 … … 24 24 #include "SynTree/Declaration.h" 25 25 #include "SynTree/Visitor.h" 26 #include "GenPoly/InstantiateGeneric.h" 26 27 #include "GenPoly/Lvalue.h" 27 28 #include "GenPoly/Specialize.h" … … 41 42 #include "InitTweak/Mutate.h" 42 43 #include "InitTweak/RemoveInit.h" 43 #include "InitTweak/FixInit.h"44 44 //#include "Explain/GenProlog.h" 45 45 //#include "Try/Visit.h" … … 61 61 astp = false, 62 62 bresolvep = false, 63 ctorinitp = false,64 63 exprp = false, 65 64 expraltp = false, … … 76 75 codegenp = false; 77 76 78 enum { Ast, Bresolver, CtorInitFix,Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, Validate, };77 enum { Ast, Bresolver, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, Validate, }; 79 78 80 79 static struct option long_opts[] = { 81 80 { "ast", no_argument, 0, Ast }, 82 81 { "before-resolver", no_argument, 0, Bresolver }, 83 { "ctorinitfix", no_argument, 0, CtorInitFix },84 82 { "expr", no_argument, 0, Expr }, 85 83 { "expralt", no_argument, 0, ExprAlt }, … … 103 101 104 102 opterr = 0; // prevent getopt from printing error messages 105 103 106 104 int c; 107 while ( (c = getopt_long( argc, argv, "ab cefFglnpqrstvyzD:", long_opts, &long_index )) != -1 ) {105 while ( (c = getopt_long( argc, argv, "abefglnpqrstvyzD:", long_opts, &long_index )) != -1 ) { 108 106 switch ( c ) { 109 107 case Ast: … … 114 112 case 'b': // print before resolver steps 115 113 bresolvep = true; 116 break;117 case CtorInitFix:118 case 'c':119 ctorinitp = true;120 114 break; 121 115 case Expr: … … 194 188 output = new ofstream( argv[ optind ] ); 195 189 } // if 196 190 197 191 Parser::get_parser().set_debug( grammarp ); 198 192 … … 215 209 exit( 1 ); 216 210 } // if 217 211 218 212 parse( prelude, LinkageSpec::Intrinsic ); 219 213 } // if 220 214 } // if 221 215 222 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp ); 223 216 parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp ); 217 224 218 if ( parsep ) { 225 219 Parser::get_parser().get_parseTree()->printList( std::cout ); … … 256 250 OPTPRINT( "mutate" ) 257 251 ControlStruct::mutate( translationUnit ); 258 OPTPRINT( "fixNames" ) 252 OPTPRINT( "fixNames" ) 259 253 CodeGen::fixNames( translationUnit ); 260 OPTPRINT( "tweak Init" )254 OPTPRINT( "tweak" ) 261 255 InitTweak::tweak( translationUnit ); 262 256 … … 275 269 if ( exprp ) { 276 270 dump( translationUnit ); 277 return 0;278 271 } 279 272 280 OPTPRINT( "fixInit" ) 281 // fix ObjectDecl - replaces ConstructorInit nodes 282 InitTweak::fix( translationUnit ); 283 if ( ctorinitp ) { 284 dump ( translationUnit ); 285 return 0; 286 } 287 273 OPTPRINT( "instantiateGeneric" ) 274 GenPoly::instantiateGeneric( translationUnit ); 288 275 OPTPRINT( "copyParams" ); 289 276 GenPoly::copyParams( translationUnit ); … … 330 317 } // try 331 318 332 deleteAll( translationUnit );333 319 return 0; 334 320 } // main … … 351 337 std::list< Declaration * > decls; 352 338 if ( noprotop ) { 353 filter( translationUnit.begin(), translationUnit.end(), 339 filter( translationUnit.begin(), translationUnit.end(), 354 340 std::back_inserter( decls ), notPrelude ); 355 341 } else {
Note:
See TracChangeset
for help on using the changeset viewer.