Changes in src/main.cc [37fe352:e523b07]
- File:
-
- 1 edited
-
src/main.cc (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r37fe352 re523b07 28 28 #include <string> // for char_traits, operator<< 29 29 30 #include "CompilationState.h" 30 31 #include "../config.h" // for CFA_LIBDIR 31 32 #include "CodeGen/FixMain.h" // for FixMain … … 33 34 #include "CodeGen/Generate.h" // for generate 34 35 #include "CodeTools/DeclStats.h" // for printDeclStats 36 #include "CodeTools/ResolvProtoDump.h" // for dumpAsResolvProto 35 37 #include "CodeTools/TrackLoc.h" // for fillLocations 36 38 #include "Common/CompilerError.h" // for CompilerError … … 72 74 DeclarationNode * parseTree = nullptr; // program parse tree 73 75 74 extern int yydebug; // set for -g flag (Grammar)75 bool76 astp = false,77 bresolvep = false,78 bboxp = false,79 bcodegenp = false,80 ctorinitp = false,81 declstatsp = false,82 exprp = false,83 expraltp = false,84 genericsp = false,85 libcfap = false,86 nopreludep = false,87 noprotop = false,88 nomainp = false,89 parsep = false,90 resolvep = false, // used in AlternativeFinder91 symtabp = false,92 treep = false,93 tuplep = false,94 validp = false,95 errorp = false,96 codegenp = false,97 prettycodegenp = false,98 linemarks = false;99 100 76 std::string PreludeDirector = ""; 101 77 … … 196 172 if ( filename == nullptr ) filename = argv[ optind ]; 197 173 // prelude filename comes in differently 198 if ( libcfap ) filename = "prelude.cf ";174 if ( libcfap ) filename = "prelude.cfa"; 199 175 optind += 1; 200 176 } else { // no input file name … … 223 199 if ( ! libcfap ) { 224 200 // read the prelude in, if not generating the cfa library 225 FILE * prelude = fopen( (PreludeDirector + "/prelude.cf ").c_str(), "r" );226 assertf( prelude, "cannot open prelude.cf \n" );201 FILE * prelude = fopen( (PreludeDirector + "/prelude.cfa").c_str(), "r" ); 202 assertf( prelude, "cannot open prelude.cfa\n" ); 227 203 parse( prelude, LinkageSpec::Intrinsic ); 228 204 … … 296 272 CodeTools::fillLocations( translationUnit ); 297 273 274 if ( resolvprotop ) { 275 CodeTools::dumpAsResolvProto( translationUnit ); 276 return 0; 277 } 278 298 279 PASS( "resolve", ResolvExpr::resolve( translationUnit ) ); 299 280 if ( exprp ) { … … 303 284 304 285 // fix ObjectDecl - replaces ConstructorInit nodes 305 PASS( "fixInit", InitTweak::fix( translationUnit, filename, libcfap || treep) );286 PASS( "fixInit", InitTweak::fix( translationUnit, buildingLibrary() ) ); 306 287 if ( ctorinitp ) { 307 288 dump ( translationUnit ); … … 401 382 402 383 void parse_cmdline( int argc, char * argv[], const char *& filename ) { 403 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };384 enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Linemarks, Nolinemarks, Nopreamble, Parse, PreludeDir, Prototypes, Resolver, ResolvProto, Symbol, Tree, TupleExpansion, Validate, }; 404 385 405 386 static struct option long_opts[] = { … … 420 401 { "no-prototypes", no_argument, 0, Prototypes }, 421 402 { "resolver", no_argument, 0, Resolver }, 403 { "resolv-proto", no_argument, 0, ResolvProto }, 422 404 { "symbol", no_argument, 0, Symbol }, 423 405 { "tree", no_argument, 0, Tree }, … … 432 414 bool Wsuppress = false, Werror = false; 433 415 int c; 434 while ( (c = getopt_long( argc, argv, "abBcCdefgGlLmnNpqr stTvwW:yzZD:F:", long_opts, &long_index )) != -1 ) {416 while ( (c = getopt_long( argc, argv, "abBcCdefgGlLmnNpqrRstTvwW:yzZD:F:", long_opts, &long_index )) != -1 ) { 435 417 switch ( c ) { 436 418 case Ast: … … 504 486 case 'r': // print resolver steps 505 487 resolvep = true; 488 break; 489 case 'R': // dump resolv-proto instance 490 resolvprotop = true; 506 491 break; 507 492 case Symbol:
Note:
See TracChangeset
for help on using the changeset viewer.