Changeset 1a45263


Ignore:
Timestamp:
Oct 20, 2022, 2:50:26 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
8bd886e
Parents:
df6cc9d (diff), bc899d6 (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 pthread-emulation

Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/containers/array.hfa

    rdf6cc9d r1a45263  
    175175
    176176// Wrapper
    177 struct all_t {} all;
     177extern struct all_t {} all;
    178178forall( [N], S & | sized(S), Te &, result &, Tbase & | { tag(result) enq_( tag(Tbase), tag(N), tag(S), tag(Te) ); } )
    179179static inline result & ?[?]( arpk(N, S, Te, Tbase) & this, all_t ) {
  • src/AST/module.mk

    rdf6cc9d r1a45263  
    6767        AST/Util.cpp \
    6868        AST/Util.hpp \
     69        AST/Vector.hpp \
    6970        AST/Visitor.hpp
    7071
  • src/GenPoly/InstantiateGenericNew.cpp

    rdf6cc9d r1a45263  
    2626#include "AST/Pass.hpp"                // for Pass, WithGuard, WithShortCi...
    2727#include "AST/TranslationUnit.hpp"     // for TranslationUnit
     28#include "AST/Vector.hpp"              // for vector
    2829#include "CodeGen/OperatorTable.h"     // for isAssignment
    2930#include "Common/ScopedMap.h"          // for ScopedMap
     
    3940// Utilities:
    4041
    41 using type_vector = std::vector< ast::ptr< ast::TypeExpr > >;
     42using type_vector = ast::vector< ast::TypeExpr >;
    4243
    4344/// Abstracts type equality for a list of parameter types.
    4445struct TypeList {
    4546        TypeList() : params() {}
    46         TypeList( std::vector< ast::ptr< ast::Type > > const & params ) :
     47        TypeList( ast::vector< ast::Type > const & params ) :
    4748                params( params ) {}
    48         TypeList( std::vector< ast::ptr< ast::Type > > && params ) :
     49        TypeList( ast::vector< ast::Type > && params ) :
    4950                params( std::move( params ) ) {}
    5051        TypeList( TypeList const & that ) : params( that.params ) {}
    5152        TypeList( TypeList && that ) : params( std::move( that.params ) ) {}
    5253
    53         TypeList( std::vector< ast::ptr< ast::TypeExpr > > const & exprs ) :
     54        TypeList( ast::vector< ast::TypeExpr > const & exprs ) :
    5455                        params() {
    5556                for ( auto expr : exprs ) {
     
    8283        }
    8384
    84         std::vector<ast::ptr<ast::Type>> params;
     85        ast::vector<ast::Type> params;
    8586};
    8687
     
    103104        /// returns null if no such value exists.
    104105        ast::AggregateDecl const * lookup(
    105                         ast::AggregateDecl const * key, type_vector const & params ) const {
     106                        ast::AggregateDecl const * key,
     107                        type_vector const & params ) const {
    106108                // This type repackaging is used for the helpers.
    107109                ast::ptr<ast::AggregateDecl> ptr = key;
     
    150152}
    151153
    152 bool isDtypeStatic( std::vector<ast::ptr<ast::TypeDecl>> const & baseParams ) {
     154bool isDtypeStatic( ast::vector<ast::TypeDecl> const & baseParams ) {
    153155        return std::all_of( baseParams.begin(), baseParams.end(),
    154156                []( ast::TypeDecl const * td ){ return !td->isComplete(); }
     
    161163/// least one parameter type, and dynamic if there is no concrete instantiation.
    162164GenericType makeSubstitutions(
    163                 std::vector<ast::ptr<ast::TypeExpr>> & out,
    164                 std::vector<ast::ptr<ast::TypeDecl>> const & baseParams,
    165                 std::vector<ast::ptr<ast::Expr>> const & params ) {
     165                ast::vector<ast::TypeExpr> & out,
     166                ast::vector<ast::TypeDecl> const & baseParams,
     167                ast::vector<ast::Expr> const & params ) {
    166168        GenericType gt = GenericType::dtypeStatic;
    167169
     
    214216/// Substitutes types of members according to baseParams => typeSubs,
    215217/// returning the result in a new vector.
    216 std::vector<ast::ptr<ast::Decl>> substituteMembers(
    217                 std::vector<ast::ptr<ast::Decl>> const & members,
    218                 std::vector<ast::ptr<ast::TypeDecl>> const & baseParams,
    219                 std::vector<ast::ptr<ast::TypeExpr>> const & typeSubs ) {
    220         std::vector<ast::ptr<ast::Decl>> out;
     218ast::vector<ast::Decl> substituteMembers(
     219                ast::vector<ast::Decl> const & members,
     220                ast::vector<ast::TypeDecl> const & baseParams,
     221                ast::vector<ast::TypeExpr> const & typeSubs ) {
     222        ast::vector<ast::Decl> out;
    221223        ast::TypeSubstitution subs( baseParams, typeSubs );
    222224        for ( ast::ptr<ast::Decl> const & member : members ) {
     
    235237/// modifying them in-place.
    236238void substituteMembersHere(
    237                 std::vector<ast::ptr<ast::Decl>> & members,
    238                 std::vector<ast::ptr<ast::TypeDecl>> const & baseParams,
    239                 std::vector<ast::ptr<ast::TypeExpr>> const & typeSubs ) {
     239                ast::vector<ast::Decl> & members,
     240                ast::vector<ast::TypeDecl> const & baseParams,
     241                ast::vector<ast::TypeExpr> const & typeSubs ) {
    240242        ast::TypeSubstitution subs( baseParams, typeSubs );
    241243        for ( ast::ptr<ast::Decl> & member : members ) {
     
    285287
    286288        ast::Expr const * fixMemberExpr(
    287                 std::vector<ast::ptr<ast::TypeDecl>> const & baseParams,
     289                ast::vector<ast::TypeDecl> const & baseParams,
    288290                ast::MemberExpr const * memberExpr );
    289291
     
    349351
    350352ast::Expr const * FixDtypeStatic::fixMemberExpr(
    351                 std::vector<ast::ptr<ast::TypeDecl>> const & baseParams,
     353                ast::vector<ast::TypeDecl> const & baseParams,
    352354                ast::MemberExpr const * memberExpr ) {
    353355        // Need to cast dtype-static member expressions to their actual type
     
    461463                type_vector const & typeSubs, ast::UnionDecl const * decl );
    462464
    463         void replaceParametersWithConcrete( std::vector<ast::ptr<ast::Expr>> & params );
     465        void replaceParametersWithConcrete( ast::vector<ast::Expr> & params );
    464466        ast::Type const * replaceWithConcrete( ast::Type const * type, bool doClone );
    465467
     
    470472        /// marks it as stripped.
    471473        void stripDtypeParams( ast::AggregateDecl * base,
    472                 std::vector<ast::ptr<ast::TypeDecl>> & baseParams,
    473                 std::vector<ast::ptr<ast::TypeExpr>> const & typeSubs );
     474                ast::vector<ast::TypeDecl> & baseParams,
     475                ast::vector<ast::TypeExpr> const & typeSubs );
    474476};
    475477
     
    511513        // and put substitutions in typeSubs.
    512514        assertf( inst->base, "Base data-type has parameters." );
    513         std::vector<ast::ptr<ast::TypeExpr>> typeSubs;
     515        ast::vector<ast::TypeExpr> typeSubs;
    514516        GenericType gt = makeSubstitutions( typeSubs, inst->base->params, inst->params );
    515517        switch ( gt ) {
     
    570572                ast::AggregateDecl const * aggr =
    571573                        expr->aggregate->result.strict_as<ast::BaseInstType>()->aggr();
    572                 std::vector<ast::ptr<ast::Decl>> const & members = aggr->members;
     574                ast::vector<ast::Decl> const & members = aggr->members;
    573575                auto it = std::find( members.begin(), members.end(), expr->member );
    574576                memberIndex = std::distance( members.begin(), it );
     
    643645
    644646void GenericInstantiator::replaceParametersWithConcrete(
    645                 std::vector<ast::ptr<ast::Expr>> & params ) {
     647                ast::vector<ast::Expr> & params ) {
    646648        for ( ast::ptr<ast::Expr> & param : params ) {
    647649                auto paramType = param.as<ast::TypeExpr>();
     
    673675void GenericInstantiator::stripDtypeParams(
    674676                ast::AggregateDecl * base,
    675                 std::vector<ast::ptr<ast::TypeDecl>> & baseParams,
    676                 std::vector<ast::ptr<ast::TypeExpr>> const & typeSubs ) {
     677                ast::vector<ast::TypeDecl> & baseParams,
     678                ast::vector<ast::TypeExpr> const & typeSubs ) {
    677679        substituteMembersHere( base->members, baseParams, typeSubs );
    678680
  • src/Parser/ParseNode.h

    rdf6cc9d r1a45263  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct 18 14:15:37 2022
    13 // Update Count     : 936
     12// Last Modified On : Tue Oct 18 16:22:15 2022
     13// Update Count     : 937
    1414//
    1515
     
    468468                cur = dynamic_cast< const NodeType * >( temp ); // should not return nullptr
    469469                if ( ! cur && temp ) {                                                  // non-homogeneous nodes ?
    470                         SemanticError( cur->location, "internal error, non-homogeneous nodes founds in buildList processing." );
     470                        SemanticError( temp->location, "internal error, non-homogeneous nodes founds in buildList processing." );
    471471                } // if
    472472        } // while
Note: See TracChangeset for help on using the changeset viewer.