Changes in src/main.cc [1622af5:01d433e]
- File:
-
- 1 edited
-
src/main.cc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/main.cc
r1622af5 r01d433e 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 : Tue Nov 9 11:10:00202113 // Update Count : 65 711 // Last Modified By : Henry Xue 12 // Last Modified On : Tue Jul 20 04:27:35 2021 13 // Update Count : 658 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 … … 319 315 // add the assignment statement after the initialization of a type parameter 320 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 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) ); 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 321 353 322 354 CodeTools::fillLocations( translationUnit ); 355 356 if ( resolvprotop ) { 357 CodeTools::dumpAsResolvProto( translationUnit ); 358 return EXIT_SUCCESS; 359 } // if 323 360 324 361 if( useNewAST ) { … … 328 365 } 329 366 auto transUnit = convert( move( translationUnit ) ); 330 331 forceFillCodeLocations( transUnit );332 333 if ( symtabp ) {334 return EXIT_SUCCESS;335 } // if336 337 if ( expraltp ) {338 ResolvExpr::printCandidates( transUnit );339 return EXIT_SUCCESS;340 } // if341 342 if ( validp ) {343 dump( move( transUnit ) );344 return EXIT_SUCCESS;345 } // if346 347 PASS( "Translate Throws", ControlStruct::translateThrows( transUnit ) );348 PASS( "Fix Labels", ControlStruct::fixLabels( transUnit ) );349 PASS( "Fix Names", CodeGen::fixNames( transUnit ) );350 PASS( "Gen Init", InitTweak::genInit( transUnit ) );351 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( transUnit ) );352 353 if ( libcfap ) {354 // Generate the bodies of cfa library functions.355 LibCfa::makeLibCfa( transUnit );356 } // if357 358 if ( declstatsp ) {359 printDeclStats( transUnit );360 return EXIT_SUCCESS;361 } // if362 363 if ( bresolvep ) {364 dump( move( transUnit ) );365 return EXIT_SUCCESS;366 } // if367 368 if ( resolvprotop ) {369 dumpAsResolverProto( transUnit );370 return EXIT_SUCCESS;371 } // if372 373 367 PASS( "Resolve", ResolvExpr::resolve( transUnit ) ); 374 368 if ( exprp ) { … … 381 375 PASS( "Fix Init", InitTweak::fix(transUnit, buildingLibrary())); 382 376 377 // fix ObjectDecl - replaces ConstructorInit nodes 378 if ( ctorinitp ) { 379 dump( move( transUnit ) ); 380 return EXIT_SUCCESS; 381 } // if 382 383 // Currently not working due to unresolved issues with UniqueExpr 384 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 reused 383 385 translationUnit = convert( move( transUnit ) ); 384 386 } else { 385 if ( symtabp ) {386 deleteAll( translationUnit );387 return EXIT_SUCCESS;388 } // if389 390 if ( expraltp ) {391 PassVisitor<ResolvExpr::AlternativePrinter> printer( cout );392 acceptAll( translationUnit, printer );393 return EXIT_SUCCESS;394 } // if395 396 if ( validp ) {397 dump( translationUnit );398 return EXIT_SUCCESS;399 } // if400 401 PASS( "Translate Throws", ControlStruct::translateThrows( translationUnit ) );402 PASS( "Fix Labels", ControlStruct::fixLabels( translationUnit ) );403 PASS( "Fix Names", CodeGen::fixNames( translationUnit ) );404 PASS( "Gen Init", InitTweak::genInit( translationUnit ) );405 PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) );406 407 if ( libcfap ) {408 // Generate the bodies of cfa library functions.409 LibCfa::makeLibCfa( translationUnit );410 } // if411 412 if ( declstatsp ) {413 CodeTools::printDeclStats( translationUnit );414 deleteAll( translationUnit );415 return EXIT_SUCCESS;416 } // if417 418 if ( bresolvep ) {419 dump( translationUnit );420 return EXIT_SUCCESS;421 } // if422 423 CodeTools::fillLocations( translationUnit );424 425 if ( resolvprotop ) {426 CodeTools::dumpAsResolvProto( translationUnit );427 return EXIT_SUCCESS;428 } // if429 430 387 PASS( "Resolve", ResolvExpr::resolve( translationUnit ) ); 431 388 if ( exprp ) { … … 435 392 436 393 PASS( "Fix Init", InitTweak::fix( translationUnit, buildingLibrary() ) ); 394 395 // fix ObjectDecl - replaces ConstructorInit nodes 396 if ( ctorinitp ) { 397 dump ( translationUnit ); 398 return EXIT_SUCCESS; 399 } // if 400 401 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 437 402 } 438 439 // fix ObjectDecl - replaces ConstructorInit nodes440 if ( ctorinitp ) {441 dump ( translationUnit );442 return EXIT_SUCCESS;443 } // if444 445 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 reused446 403 447 404 PASS( "Translate Tries" , ControlStruct::translateTries( translationUnit ) ); … … 490 447 PASS( "Code Gen", CodeGen::generate( translationUnit, *output, ! genproto, prettycodegenp, true, linemarks ) ); 491 448 492 CodeGen::FixMain::fix( translationUnit, *output, 493 (PreludeDirector + "/bootloader.c").c_str() ); 449 CodeGen::FixMain::fix( *output, (PreludeDirector + "/bootloader.c").c_str() ); 494 450 if ( output != &cout ) { 495 451 delete output;
Note:
See TracChangeset
for help on using the changeset viewer.