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