Changeset 3e5dd913 for src/SymTab


Ignore:
Timestamp:
Dec 16, 2020, 2:43:12 PM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
53449a4
Parents:
13fece5
Message:

reimplement function type and eliminate deep copy

Location:
src/SymTab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Mangler.cc

    r13fece5 r3e5dd913  
    671671                                        int dcount = 0, fcount = 0, vcount = 0, acount = 0;
    672672                                        mangleName += Encoding::forall;
    673                                         for ( const ast::TypeDecl * decl : ptype->forall ) {
     673                                        for ( auto & decl : ptype->forall ) {
    674674                                                switch ( decl->kind ) {
    675675                                                case ast::TypeDecl::Kind::Dtype:
     
    686686                                                } // switch
    687687                                                varNums[ decl->name ] = std::make_pair( nextVarNum, (int)decl->kind );
    688                                                 for ( const ast::DeclWithType * assert : decl->assertions ) {
    689                                                         ast::Pass<Mangler_new> sub_mangler(
    690                                                                 mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums );
    691                                                         assert->accept( sub_mangler );
    692                                                         assertionNames.push_back( sub_mangler.core.get_mangleName() );
    693                                                         acount++;
    694                                                 } // for
     688                                        } // for
     689                                        for ( auto & assert : ptype->assertions ) {
     690                                                ast::Pass<Mangler_new> sub_mangler(
     691                                                        mangleOverridable, typeMode, mangleGenericParams, nextVarNum, varNums );
     692                                                assert->var->accept( sub_mangler );
     693                                                assertionNames.push_back( sub_mangler.core.get_mangleName() );
     694                                                acount++;
    695695                                        } // for
    696696                                        mangleName += std::to_string( dcount ) + "_" + std::to_string( fcount ) + "_" + std::to_string( vcount ) + "_" + std::to_string( acount ) + "_";
  • src/SymTab/Validate.cc

    r13fece5 r3e5dd913  
    14631463        }
    14641464
     1465        /*
     1466
    14651467        /// Associates forward declarations of aggregates with their definitions
    14661468        class LinkReferenceToTypes_new final
     
    18441846                }
    18451847        };
     1848        */
    18461849} // anonymous namespace
    18471850
     1851/*
    18481852const ast::Type * validateType(
    18491853                const CodeLocation & loc, const ast::Type * type, const ast::SymbolTable & symtab ) {
     
    18541858        return type->accept( lrt )->accept( fpd );
    18551859}
     1860*/
    18561861
    18571862} // namespace SymTab
Note: See TracChangeset for help on using the changeset viewer.