Changeset 80eefcb


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

Forall list now uses vector

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    r8d25360 r80eefcb  
    282282
    283283        void markAssertions( AssertionSet &assertion1, AssertionSet &assertion2, Type *type ) {
    284                 for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
    285                         for ( std::list< DeclarationWithType* >::const_iterator assert = (*tyvar)->get_assertions().begin(); assert != (*tyvar)->get_assertions().end(); ++assert ) {
    286                                 markAssertionSet( assertion1, *assert );
    287                                 markAssertionSet( assertion2, *assert );
     284                for ( auto tyvar : type->get_forall() ) {
     285                        for ( auto assert : tyvar->get_assertions() ) {
     286                                markAssertionSet( assertion1, assert );
     287                                markAssertionSet( assertion2, assert );
    288288                        } // for
    289289                } // for
  • 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 ) {
  • src/SynTree/Type.h

    r8d25360 r80eefcb  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Sep 25 14:14:01 2017
    13 // Update Count     : 154
     12// Last Modified On : Fri Feb  8 09:17:09 2019
     13// Update Count     : 164
    1414//
    1515
     
    1818#include <strings.h>         // for ffs
    1919#include <cassert>           // for assert, assertf
    20 #include <list>              // for list, _List_iterator
     20#include <list>
    2121#include <ostream>           // for ostream, operator<<, basic_ostream
    2222#include <string>            // for string
    23 #include <vector>
     23#include <vector>            // for vector
    2424
    2525#include "BaseSyntaxNode.h"  // for BaseSyntaxNode
     
    134134        }; // Qualifiers
    135135
    136         typedef std::list<TypeDecl *> ForallList;
     136        typedef std::vector<TypeDecl *> ForallList;
    137137
    138138        Qualifiers tq;
Note: See TracChangeset for help on using the changeset viewer.