Ignore:
Timestamp:
Mar 22, 2018, 4:49:53 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
dbc2c2c
Parents:
7e4b44db
Message:

Add static roots to GC; fix some static GC_Objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r7e4b44db rbd06384  
    588588                // must visit children (enum constants) to add them to the indexer
    589589                if ( enumDecl->has_body() ) {
    590                         EnumInstType enumInst( Type::Qualifiers(), enumDecl->get_name() );
    591                         enumInst.set_baseEnum( enumDecl );
    592                         EnumFuncGenerator gen( &enumInst, data, functionNesting, indexer );
     590                        auto enumInst = new EnumInstType{ Type::Qualifiers(), enumDecl->get_name() };
     591                        enumInst->set_baseEnum( enumDecl );
     592                        EnumFuncGenerator gen( enumInst, data, functionNesting, indexer );
    593593                        generateFunctions( gen, declsToAddAfter );
    594594                }
     
    598598                visit_children = false;
    599599                if ( structDecl->has_body() ) {
    600                         StructInstType structInst( Type::Qualifiers(), structDecl->name );
    601                         structInst.set_baseStruct( structDecl );
     600                        auto structInst = new StructInstType{ Type::Qualifiers(), structDecl->name };
     601                        structInst->set_baseStruct( structDecl );
    602602                        for ( TypeDecl * typeDecl : structDecl->parameters ) {
    603                                 structInst.parameters.push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->name, typeDecl ) ) );
    604                         }
    605                         StructFuncGenerator gen( structDecl, &structInst, data, functionNesting, indexer );
     603                                structInst->parameters.push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->name, typeDecl ) ) );
     604                        }
     605                        StructFuncGenerator gen( structDecl, structInst, data, functionNesting, indexer );
    606606                        generateFunctions( gen, declsToAddAfter );
    607607                } // if
     
    611611                visit_children = false;
    612612                if ( unionDecl->has_body()  ) {
    613                         UnionInstType unionInst( Type::Qualifiers(), unionDecl->get_name() );
    614                         unionInst.set_baseUnion( unionDecl );
     613                        auto unionInst = new UnionInstType{ Type::Qualifiers(), unionDecl->get_name() };
     614                        unionInst->set_baseUnion( unionDecl );
    615615                        for ( TypeDecl * typeDecl : unionDecl->get_parameters() ) {
    616                                 unionInst.get_parameters().push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), typeDecl ) ) );
    617                         }
    618                         UnionFuncGenerator gen( unionDecl, &unionInst, data, functionNesting, indexer );
     616                                unionInst->get_parameters().push_back( new TypeExpr( new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), typeDecl ) ) );
     617                        }
     618                        UnionFuncGenerator gen( unionDecl, unionInst, data, functionNesting, indexer );
    619619                        generateFunctions( gen, declsToAddAfter );
    620620                } // if
     
    625625                if ( ! typeDecl->base ) return;
    626626
    627                 TypeInstType refType( Type::Qualifiers(), typeDecl->name, typeDecl );
    628                 TypeFuncGenerator gen( typeDecl, &refType, data, functionNesting, indexer );
     627                auto refType = new TypeInstType{ Type::Qualifiers(), typeDecl->name, typeDecl };
     628                TypeFuncGenerator gen( typeDecl, refType, data, functionNesting, indexer );
    629629                generateFunctions( gen, declsToAddAfter );
    630630
Note: See TracChangeset for help on using the changeset viewer.