Changeset 68f9c43 for src/main.cc


Ignore:
Timestamp:
Mar 16, 2018, 5:15:02 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
8d7bef2
Parents:
6171841
git-author:
Aaron Moss <a3moss@…> (03/16/18 17:04:24)
git-committer:
Aaron Moss <a3moss@…> (03/16/18 17:15:02)
Message:

First pass at delete removal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    r6171841 r68f9c43  
    3737#include "Common/PassVisitor.h"
    3838#include "Common/CompilerError.h"           // for CompilerError
     39#include "Common/GC.h"                                          // for GC
    3940#include "Common/SemanticError.h"           // for SemanticError
    4041#include "Common/UnimplementedError.h"      // for UnimplementedError
     
    5758#include "SymTab/Validate.h"                // for validate
    5859#include "SynTree/Declaration.h"            // for Declaration
     60#include "SynTree/GcTracer.h"               // for GC << TranslationUnit
    5961#include "SynTree/Visitor.h"                // for acceptAll
    6062#include "Tuples/Tuples.h"                  // for expandMemberTuples, expan...
     
    6466
    6567#define OPTPRINT(x) if ( errorp ) cerr << x << endl;
    66 
    6768
    6869LinkageSpec::Spec linkage = LinkageSpec::Cforall;
     
    233234                delete parseTree;
    234235                parseTree = nullptr;
     236                collect( translationUnit );
    235237
    236238                if ( astp ) {
     
    242244                OPTPRINT( "validate" )
    243245                SymTab::validate( translationUnit, symtabp );
    244                 if ( symtabp ) {
    245                         deleteAll( translationUnit );
    246                         return 0;
    247                 } // if
     246                collect( translationUnit );
     247                if ( symtabp ) return 0;
    248248
    249249                if ( expraltp ) {
     
    266266                OPTPRINT( "expandMemberTuples" );
    267267                Tuples::expandMemberTuples( translationUnit );
     268                collect( translationUnit );
    268269                if ( libcfap ) {
    269270                        // generate the bodies of cfa library functions
     
    273274                if ( declstatsp ) {
    274275                        CodeTools::printDeclStats( translationUnit );
    275                         deleteAll( translationUnit );
    276276                        return 0;
    277277                }
     
    286286                OPTPRINT( "resolve" )
    287287                ResolvExpr::resolve( translationUnit );
     288                collect( translationUnit );
    288289                if ( exprp ) {
    289290                        dump( translationUnit );
     
    294295                OPTPRINT( "fixInit" )
    295296                InitTweak::fix( translationUnit, filename, libcfap || treep );
     297                collect( translationUnit );
    296298                if ( ctorinitp ) {
    297299                        dump ( translationUnit );
     
    313315                OPTPRINT( "expandTuples" ); // xxx - is this the right place for this?
    314316                Tuples::expandTuples( translationUnit );
     317                collect( translationUnit );
    315318                if ( tuplep ) {
    316319                        dump( translationUnit );
     
    323326                OPTPRINT("instantiateGenerics")
    324327                GenPoly::instantiateGeneric( translationUnit );
     328                collect( translationUnit );
    325329                if ( genericsp ) {
    326330                        dump( translationUnit );
    327331                        return 0;
    328332                }
     333
    329334                OPTPRINT( "convertLvalue" )
    330335                GenPoly::convertLvalue( translationUnit );
    331 
    332 
     336                collect( translationUnit );
    333337                if ( bboxp ) {
    334338                        dump( translationUnit );
    335339                        return 0;
    336340                } // if
     341
    337342                OPTPRINT( "box" )
    338343                GenPoly::box( translationUnit );
    339 
     344                collect( translationUnit );
    340345                if ( bcodegenp ) {
    341346                        dump( translationUnit );
     
    383388        } // try
    384389
    385         deleteAll( translationUnit );
    386390        return 0;
    387391} // main
     
    568572                printAll( decls, out );
    569573        }
    570         deleteAll( translationUnit );
    571574} // dump
    572575
Note: See TracChangeset for help on using the changeset viewer.