Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    r5ee153d r9f5a19fa  
    99// Author           : Peter Buhr and Rob Schluntz
    1010// Created On       : Fri May 15 23:12:02 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Nov  8 11:42:00 2021
    13 // Update Count     : 656
     11// Last Modified By : Henry Xue
     12// Last Modified On : Mon Aug 23 15:42:08 2021
     13// Update Count     : 650
    1414//
    1515
     
    4343#include "Common/CodeLocationTools.hpp"     // for forceFillCodeLocations
    4444#include "Common/CompilerError.h"           // for CompilerError
    45 #include "Common/DeclStats.hpp"             // for printDeclStats
    46 #include "Common/ResolvProtoDump.hpp"       // for dumpAsResolverProto
    4745#include "Common/Stats.h"
    4846#include "Common/PassVisitor.h"
     
    5351#include "ControlStruct/ExceptDecl.h"       // for translateExcept
    5452#include "ControlStruct/ExceptTranslate.h"  // for translateEHM
    55 #include "ControlStruct/FixLabels.hpp"      // for fixLabels
    5653#include "ControlStruct/Mutate.h"           // for mutate
    5754#include "GenPoly/Box.h"                    // for box
     
    334331                } // if
    335332
     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
     353
    336354                CodeTools::fillLocations( translationUnit );
     355
     356                if ( resolvprotop ) {
     357                        CodeTools::dumpAsResolvProto( translationUnit );
     358                        return EXIT_SUCCESS;
     359                } // if
    337360
    338361                if( useNewAST ) {
     
    343366                        auto transUnit = convert( move( translationUnit ) );
    344367
    345                         forceFillCodeLocations( transUnit );
    346 
    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 ) );
    351368                        PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( transUnit ) );
    352 
    353                         if ( libcfap ) {
    354                                 // Generate the bodies of cfa library functions.
    355                                 LibCfa::makeLibCfa( transUnit );
    356                         } // if
    357 
    358                         if ( declstatsp ) {
    359                                 printDeclStats( transUnit );
    360                                 return EXIT_SUCCESS;
    361                         } // if
    362 
    363                         if ( bresolvep ) {
    364                                 dump( move( transUnit ) );
    365                                 return EXIT_SUCCESS;
    366                         } // if
    367 
    368                         if ( resolvprotop ) {
    369                                 dumpAsResolverProto( transUnit );
    370                                 return EXIT_SUCCESS;
    371                         } // if
    372 
     369                       
    373370                        PASS( "Resolve", ResolvExpr::resolve( transUnit ) );
    374371                        if ( exprp ) {
     
    380377
    381378                        PASS( "Fix Init", InitTweak::fix(transUnit, buildingLibrary()));
    382 
    383379                        translationUnit = convert( move( transUnit ) );
    384380                } else {
    385                         PASS( "Translate Throws", ControlStruct::translateThrows( translationUnit ) );
    386                         PASS( "Fix Labels", ControlStruct::fixLabels( translationUnit ) );
    387                         PASS( "Fix Names", CodeGen::fixNames( translationUnit ) );
    388                         PASS( "Gen Init", InitTweak::genInit( translationUnit ) );
    389381                        PASS( "Expand Member Tuples" , Tuples::expandMemberTuples( translationUnit ) );
    390 
    391                         if ( libcfap ) {
    392                                 // Generate the bodies of cfa library functions.
    393                                 LibCfa::makeLibCfa( translationUnit );
    394                         } // if
    395 
    396                         if ( declstatsp ) {
    397                                 CodeTools::printDeclStats( translationUnit );
    398                                 deleteAll( translationUnit );
    399                                 return EXIT_SUCCESS;
    400                         } // if
    401 
    402                         if ( bresolvep ) {
    403                                 dump( translationUnit );
    404                                 return EXIT_SUCCESS;
    405                         } // if
    406 
    407                         CodeTools::fillLocations( translationUnit );
    408 
    409                         if ( resolvprotop ) {
    410                                 CodeTools::dumpAsResolvProto( translationUnit );
    411                                 return EXIT_SUCCESS;
    412                         } // if
    413382
    414383                        PASS( "Resolve", ResolvExpr::resolve( translationUnit ) );
     
    474443                PASS( "Code Gen", CodeGen::generate( translationUnit, *output, ! genproto, prettycodegenp, true, linemarks ) );
    475444
    476                 CodeGen::FixMain::fix( translationUnit, *output,
    477                                 (PreludeDirector + "/bootloader.c").c_str() );
     445                CodeGen::FixMain::fix( *output, (PreludeDirector + "/bootloader.c").c_str() );
    478446                if ( output != &cout ) {
    479447                        delete output;
Note: See TracChangeset for help on using the changeset viewer.