Changeset 80eefcb for src/SymTab


Ignore:
Timestamp:
Feb 14, 2019, 11:14:50 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
no_list
Children:
99614c2
Parents:
8d25360
Message:

Forall list now uses vector

Location:
src/SymTab
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Demangle.cc

    r8d25360 r80eefcb  
    543543                                if (done()) return nullptr;
    544544
    545                                 std::list<TypeDecl *> forall;
     545                                Type::ForallList forall;
    546546                                if (isPrefix(Encoding::forall)) {
    547547                                        PRINT( std::cerr << "polymorphic with..." << std::endl; )
  • src/SymTab/Indexer.cc

    r8d25360 r80eefcb  
    674674        }
    675675
    676         void Indexer::addTypes( const std::list< TypeDecl * > & tds ) {
     676        void Indexer::addTypes( const Type::ForallList & tds ) {
    677677                for ( auto td : tds ) {
    678678                        addType( td );
  • src/SymTab/Indexer.h

    r8d25360 r80eefcb  
    2121#include <functional>         // for function
    2222
     23#include "SynTree/Type.h"  // for AST nodes
     24#include "SynTree/SynTree.h"  // for AST nodes
    2325#include "SynTree/Visitor.h"  // for Visitor
    24 #include "SynTree/SynTree.h"  // for AST nodes
    2526
    2627namespace ResolvExpr {
     
    119120
    120121                /// convenience function for adding a list of forall parameters to the indexer
    121                 void addTypes( const std::list< TypeDecl * > & tds );
     122                void addTypes( const Type::ForallList & tds );
    122123
    123124                /// convenience function for adding all of the declarations in a function type to the indexer
  • src/SymTab/Validate.cc

    r8d25360 r80eefcb  
    808808
    809809        /// Fix up assertions - flattens assertion lists, removing all trait instances
    810         void forallFixer( std::list< TypeDecl * > & forall, BaseSyntaxNode * node ) {
     810        template<typename container_t>
     811        void forallFixer( container_t & forall, BaseSyntaxNode * node ) {
    811812                for ( TypeDecl * type : forall ) {
    812                         std::list< DeclarationWithType * > asserts;
    813                         asserts.splice( asserts.end(), type->assertions );
     813                        decltype(type->assertions) asserts;
     814                        std::swap(asserts, type->assertions );
    814815                        // expand trait instances into their members
    815816                        for ( DeclarationWithType * assertion : asserts ) {
Note: See TracChangeset for help on using the changeset viewer.