Changeset fbfb38e for src/SymTab


Ignore:
Timestamp:
Apr 22, 2016, 1:42:36 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
67b1180
Parents:
dc2e7e0 (diff), 6812d89 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ctor

Location:
src/SymTab
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Indexer.cc

    rdc2e7e0 rfbfb38e  
    511511        }
    512512
    513         bool Indexer::hasIncompatibleCDecl( const std::string &id, const std::string &mangleName ) const {
     513        bool Indexer::hasIncompatibleCDecl( const std::string &id, const std::string &mangleName, unsigned long scope ) const {
    514514                if ( ! tables ) return false;
     515                if ( tables->scope < scope ) return false;
    515516
    516517                IdTable::const_iterator decls = tables->idTable.find( id );
     
    524525                }
    525526
    526                 return tables->base.hasIncompatibleCDecl( id, mangleName );
     527                return tables->base.hasIncompatibleCDecl( id, mangleName, scope );
    527528        }
    528529       
     
    617618                DeclarationWithType *existing = lookupIdAtScope( name, mangleName, scope );
    618619                if ( ! existing || ! addedIdConflicts( existing, decl ) ) {
    619                         // this ensures that no two declarations with the same unmangled name both have C linkage
    620                         if ( decl->get_linkage() == LinkageSpec::C && hasIncompatibleCDecl( name, mangleName ) ) {
     620                        // this ensures that no two declarations with the same unmangled name at the same scope both have C linkage
     621                        if ( decl->get_linkage() == LinkageSpec::C && hasIncompatibleCDecl( name, mangleName, scope ) ) {
    621622                                throw SemanticError( "invalid overload of C function ", decl );
    622623                        } // NOTE this is broken in Richard's original code in such a way that it never triggers (it
     
    783784            using std::cerr;
    784785
    785             cerr << "===idTable===" << std::endl;
    786             if ( tables ) dump( tables->idTable, os );
    787             cerr << "===typeTable===" << std::endl;
    788             if ( tables ) dump( tables->typeTable, os );
    789             cerr << "===structTable===" << std::endl;
    790             if ( tables ) dump( tables->structTable, os );
    791             cerr << "===enumTable===" << std::endl;
    792             if ( tables ) dump( tables->enumTable, os );
    793             cerr << "===unionTable===" << std::endl;
    794             if ( tables ) dump( tables->unionTable, os );
    795             cerr << "===contextTable===" << std::endl;
    796             if ( tables ) dump( tables->traitTable, os );
     786                if ( tables ) {
     787                        os << "--- scope " << tables->scope << " ---" << std::endl;
     788
     789                        os << "===idTable===" << std::endl;
     790                        dump( tables->idTable, os );
     791                        os << "===typeTable===" << std::endl;
     792                        dump( tables->typeTable, os );
     793                        os << "===structTable===" << std::endl;
     794                        dump( tables->structTable, os );
     795                        os << "===enumTable===" << std::endl;
     796                        dump( tables->enumTable, os );
     797                        os << "===unionTable===" << std::endl;
     798                        dump( tables->unionTable, os );
     799                        os << "===contextTable===" << std::endl;
     800                        dump( tables->traitTable, os );
     801
     802                        tables->base.print( os, indent );
     803                } else {
     804                        os << "--- end ---" << std::endl;
     805                }
     806               
    797807        }
    798808} // namespace SymTab
  • src/SymTab/Indexer.h

    rdc2e7e0 rfbfb38e  
    9999                DeclarationWithType *lookupIdAtScope( const std::string &id, const std::string &mangleName, unsigned long scope ) const;
    100100                /// returns true if there exists a declaration with C linkage and the given name with a different mangled name
    101                 bool hasIncompatibleCDecl( const std::string &id, const std::string &mangleName ) const;
     101                bool hasIncompatibleCDecl( const std::string &id, const std::string &mangleName, unsigned long scope ) const;
    102102                // equivalents to lookup functions that only look at tables at scope `scope` (which should be >= tables->scope)
    103103                NamedTypeDecl *lookupTypeAtScope( const std::string &id, unsigned long scope ) const;
  • src/SymTab/Validate.cc

    rdc2e7e0 rfbfb38e  
    515515                                }
    516516                                rtt->get_parameters().clear();
    517                                 cloneAll(typeInst->get_parameters(), rtt->get_parameters());
     517                                cloneAll( typeInst->get_parameters(), rtt->get_parameters() );
     518                                mutateAll( rtt->get_parameters(), *this );  // recursively fix typedefs on parameters
    518519                        } // if
    519520                        delete typeInst;
Note: See TracChangeset for help on using the changeset viewer.