Changes in src/main.cc [ce36b55:9f5a19fa]
- File:
-
- 1 edited
-
src/main.cc (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
rce36b55 r9f5a19fa 9 9 // Author : Peter Buhr and Rob Schluntz 10 10 // Created On : Fri May 15 23:12:02 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Nov 12 11:06:00202113 // Update Count : 65 811 // Last Modified By : Henry Xue 12 // Last Modified On : Mon Aug 23 15:42:08 2021 13 // Update Count : 650 14 14 // 15 15 … … 43 43 #include "Common/CodeLocationTools.hpp" // for forceFillCodeLocations 44 44 #include "Common/CompilerError.h" // for CompilerError 45 #include "Common/DeclStats.hpp" // for printDeclStats46 #include "Common/ResolvProtoDump.hpp" // for dumpAsResolverProto47 45 #include "Common/Stats.h" 48 46 #include "Common/PassVisitor.h" … … 53 51 #include "ControlStruct/ExceptDecl.h" // for translateExcept 54 52 #include "ControlStruct/ExceptTranslate.h" // for translateEHM 55 #include "ControlStruct/FixLabels.hpp" // for fixLabels56 53 #include "ControlStruct/Mutate.h" // for mutate 57 54 #include "GenPoly/Box.h" // for box … … 65 62 #include "Parser/TypedefTable.h" // for TypedefTable 66 63 #include "ResolvExpr/AlternativePrinter.h" // for AlternativePrinter 67 #include "ResolvExpr/CandidatePrinter.hpp" // for printCandidates68 64 #include "ResolvExpr/Resolver.h" // for resolve 69 65 #include "SymTab/Validate.h" // for validate … … 72 68 #include "SynTree/Visitor.h" // for acceptAll 73 69 #include "Tuples/Tuples.h" // for expandMemberTuples, expan... 74 #include "Validate/FindSpecialDecls.h" // for findGlobalDecls75 #include "Validate/InitializerLength.hpp" // for setLengthFromInitializer76 #include "Validate/LabelAddressFixer.hpp" // for fixLabelAddresses77 70 #include "Virtual/ExpandCasts.h" // for expandCasts 78 71 … … 321 314 322 315 // add the assignment statement after the initialization of a type parameter 323 PASS( "Validate-A", SymTab::validate_A( translationUnit ) ); 324 PASS( "Validate-B", SymTab::validate_B( translationUnit ) ); 325 PASS( "Validate-C", SymTab::validate_C( translationUnit ) ); 326 PASS( "Validate-D", SymTab::validate_D( translationUnit ) ); 327 PASS( "Validate-E", SymTab::validate_E( translationUnit ) ); 316 PASS( "Validate", SymTab::validate( translationUnit, symtabp ) ); 317 if ( symtabp ) { 318 deleteAll( translationUnit ); 319 return EXIT_SUCCESS; 320 } // if 321 322 if ( expraltp ) { 323 PassVisitor<ResolvExpr::AlternativePrinter> printer( cout ); 324 acceptAll( translationUnit, printer ); 325 return EXIT_SUCCESS; 326 } // if 327 328 if ( validp ) { 329 dump( translationUnit ); 330 return EXIT_SUCCESS; 331 } // if 332 333 PASS( "Translate Throws", ControlStruct::translateThrows( translationUnit ) ); 334 PASS( "Fix Labels", ControlStruct::fixLabels( translationUnit ) ); 335 PASS( "Fix Names", CodeGen::fixNames( translationUnit ) ); 336 PASS( "Gen Init", InitTweak::genInit( translationUnit ) ); 337 338 if ( libcfap ) { 339 // generate the bodies of cfa library functions 340 LibCfa::makeLibCfa( translationUnit ); 341 } // if 342 343 if ( declstatsp ) { 344 CodeTools::printDeclStats( translationUnit ); 345 deleteAll( translationUnit ); 346 return EXIT_SUCCESS; 347 } // if 348 349 if ( bresolvep ) { 350 dump( translationUnit ); 351 return EXIT_SUCCESS; 352 } // if 328 353 329 354 CodeTools::fillLocations( translationUnit ); 355 356 if ( resolvprotop ) { 357 CodeTools::dumpAsResolvProto( translationUnit ); 358 return EXIT_SUCCESS; 359 } // if 330 360 331 361 if( useNewAST ) { … … 336 366 auto transUnit = convert( move( translationUnit ) ); 337 367 338 forceFillCodeLocations( transUnit );339 340 PASS( "Set Length From Initializer", Validate::setLengthFromInitializer( transUnit ) );341 PASS( "Find Global Decls", Validate::findGlobalDecls( transUnit ) );342 PASS( "Fix Label Address", Validate::fixLabelAddresses( transUnit ) );343 344 if ( symtabp ) {345 return EXIT_SUCCESS;346 } // if347 348 if ( expraltp ) {349 ResolvExpr::printCandidates( transUnit );350 return EXIT_SUCCESS;351 } // if352 353 if ( validp ) {354 dump( move( transUnit ) );355 return EXIT_SUCCESS;356 } // if357 358 PASS( "Translate Throws", ControlStruct::translateThrows( transUnit ) );359 PASS( "Fix Labels", ControlStruct::fixLabels( transUnit ) );360 PASS( "Fix Names", CodeGen::fixNames( transUnit ) );361 PASS( "Gen Init", InitTweak::genInit( transUnit ) );362 368 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( transUnit ) ); 363 364 if ( libcfap ) { 365 // Generate the bodies of cfa library functions. 366 LibCfa::makeLibCfa( transUnit ); 367 } // if 368 369 if ( declstatsp ) { 370 printDeclStats( transUnit ); 371 return EXIT_SUCCESS; 372 } // if 373 374 if ( bresolvep ) { 375 dump( move( transUnit ) ); 376 return EXIT_SUCCESS; 377 } // if 378 379 if ( resolvprotop ) { 380 dumpAsResolverProto( transUnit ); 381 return EXIT_SUCCESS; 382 } // if 383 369 384 370 PASS( "Resolve", ResolvExpr::resolve( transUnit ) ); 385 371 if ( exprp ) { … … 391 377 392 378 PASS( "Fix Init", InitTweak::fix(transUnit, buildingLibrary())); 393 394 // fix ObjectDecl - replaces ConstructorInit nodes395 if ( ctorinitp ) {396 dump( move( transUnit ) );397 return EXIT_SUCCESS;398 } // if399 400 // Currently not working due to unresolved issues with UniqueExpr401 PASS( "Expand Unique Expr", Tuples::expandUniqueExpr( transUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused402 379 translationUnit = convert( move( transUnit ) ); 403 380 } else { 404 PASS( "Validate-F", SymTab::validate_F( translationUnit ) );405 406 if ( symtabp ) {407 deleteAll( translationUnit );408 return EXIT_SUCCESS;409 } // if410 411 if ( expraltp ) {412 PassVisitor<ResolvExpr::AlternativePrinter> printer( cout );413 acceptAll( translationUnit, printer );414 return EXIT_SUCCESS;415 } // if416 417 if ( validp ) {418 dump( translationUnit );419 return EXIT_SUCCESS;420 } // if421 422 PASS( "Translate Throws", ControlStruct::translateThrows( translationUnit ) );423 PASS( "Fix Labels", ControlStruct::fixLabels( translationUnit ) );424 PASS( "Fix Names", CodeGen::fixNames( translationUnit ) );425 PASS( "Gen Init", InitTweak::genInit( translationUnit ) );426 381 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) ); 427 428 if ( libcfap ) {429 // Generate the bodies of cfa library functions.430 LibCfa::makeLibCfa( translationUnit );431 } // if432 433 if ( declstatsp ) {434 CodeTools::printDeclStats( translationUnit );435 deleteAll( translationUnit );436 return EXIT_SUCCESS;437 } // if438 439 if ( bresolvep ) {440 dump( translationUnit );441 return EXIT_SUCCESS;442 } // if443 444 CodeTools::fillLocations( translationUnit );445 446 if ( resolvprotop ) {447 CodeTools::dumpAsResolvProto( translationUnit );448 return EXIT_SUCCESS;449 } // if450 382 451 383 PASS( "Resolve", ResolvExpr::resolve( translationUnit ) ); … … 456 388 457 389 PASS( "Fix Init", InitTweak::fix( translationUnit, buildingLibrary() ) ); 458 459 // fix ObjectDecl - replaces ConstructorInit nodes460 if ( ctorinitp ) {461 dump ( translationUnit );462 return EXIT_SUCCESS;463 } // if464 465 PASS( "Expand Unique Expr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused466 390 } 391 392 // fix ObjectDecl - replaces ConstructorInit nodes 393 if ( ctorinitp ) { 394 dump ( translationUnit ); 395 return EXIT_SUCCESS; 396 } // if 397 398 PASS( "Expand Unique Expr", Tuples::expandUniqueExpr( translationUnit ) ); // xxx - is this the right place for this? want to expand ASAP so tha, sequent passes don't need to worry about double-visiting a unique expr - needs to go after InitTweak::fix so that copy constructed return declarations are reused 467 399 468 400 PASS( "Translate Tries" , ControlStruct::translateTries( translationUnit ) ); … … 511 443 PASS( "Code Gen", CodeGen::generate( translationUnit, *output, ! genproto, prettycodegenp, true, linemarks ) ); 512 444 513 CodeGen::FixMain::fix( translationUnit, *output, 514 (PreludeDirector + "/bootloader.c").c_str() ); 445 CodeGen::FixMain::fix( *output, (PreludeDirector + "/bootloader.c").c_str() ); 515 446 if ( output != &cout ) { 516 447 delete output;
Note:
See TracChangeset
for help on using the changeset viewer.