Changeset b230091


Ignore:
Timestamp:
Mar 29, 2022, 4:09:51 PM (2 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
6e47b49
Parents:
dfd3410
Message:

Added a 'missing' TypeInstType? constructor and rewrote some calls to use it.

Location:
src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    rdfd3410 rb230091  
    27172717
    27182718                for (auto & param : foralls) {
    2719                         ty->forall.emplace_back(new ast::TypeInstType(param->name, param));
     2719                        ty->forall.emplace_back(new ast::TypeInstType(param));
    27202720                        for (auto asst : param->assertions) {
    27212721                                ty->assertions.emplace_back(new ast::VariableExpr({}, asst));
  • src/AST/Decl.cpp

    rdfd3410 rb230091  
    6868        }
    6969        for (auto & tp : this->type_params) {
    70                 ftype->forall.emplace_back(new TypeInstType(tp->name, tp));
     70                ftype->forall.emplace_back(new TypeInstType(tp));
    7171                for (auto & ap: tp->assertions) {
    7272                        ftype->assertions.emplace_back(new VariableExpr(loc, ap));
  • src/AST/Type.cpp

    rdfd3410 rb230091  
    147147// --- TypeInstType
    148148
     149TypeInstType::TypeInstType( const TypeDecl * b,
     150        CV::Qualifiers q, std::vector<ptr<Attribute>> && as )
     151: BaseInstType( b->name, q, move(as) ), base( b ), kind( b->kind ) {}
     152
    149153void TypeInstType::set_base( const TypeDecl * b ) {
    150154        base = b;
  • src/AST/Type.hpp

    rdfd3410 rb230091  
    421421                std::vector<ptr<Attribute>> && as = {} )
    422422        : BaseInstType( n, q, std::move(as) ), base( b ), kind( b->kind ) {}
     423
     424        TypeInstType( const TypeDecl * b,
     425                CV::Qualifiers q = {}, std::vector<ptr<Attribute>> && as = {} );
     426
    423427        TypeInstType( const std::string& n, TypeDecl::Kind k, CV::Qualifiers q = {},
    424428                std::vector<ptr<Attribute>> && as = {} )
  • src/Concurrency/KeywordsNew.cpp

    rdfd3410 rb230091  
    8888                auto typeDecl = ast::deepCopy( typeParam );
    8989                mutFunc->type_params.push_back( typeDecl );
    90                 mutType->forall.push_back(
    91                         new ast::TypeInstType( typeDecl->name, typeDecl ) );
     90                mutType->forall.push_back( new ast::TypeInstType( typeDecl ) );
    9291                for ( auto & assertion : typeDecl->assertions ) {
    9392                        mutFunc->assertions.push_back( assertion );
     
    108107        for ( const ast::ptr<ast::TypeDecl> & typeDecl : mutFunc->type_params ) {
    109108                paramTypeInst->params.push_back(
    110                         new ast::TypeExpr( location,
    111                                 new ast::TypeInstType( typeDecl->name, typeDecl ) ) );
     109                        new ast::TypeExpr( location, new ast::TypeInstType( typeDecl ) ) );
    112110                typeParamInst->params.push_back(
    113                         new ast::TypeExpr( location,
    114                                 new ast::TypeInstType( typeDecl->name, typeDecl ) ) );
     111                        new ast::TypeExpr( location, new ast::TypeInstType( typeDecl ) ) );
    115112        }
    116113
  • src/ResolvExpr/Resolver.cc

    rdfd3410 rb230091  
    13851385                        for (auto & typeParam : mutDecl->type_params) {
    13861386                                symtab.addType(typeParam);
    1387                                 mutType->forall.emplace_back(new ast::TypeInstType(typeParam->name, typeParam));
     1387                                mutType->forall.emplace_back(new ast::TypeInstType(typeParam));
    13881388                        }
    13891389                        for (auto & asst : mutDecl->assertions) {
  • src/Validate/Autogen.cpp

    rdfd3410 rb230091  
    248248                structInst.params.push_back( new ast::TypeExpr(
    249249                        typeDecl->location,
    250                         new ast::TypeInstType( typeDecl->name, typeDecl )
     250                        new ast::TypeInstType( typeDecl )
    251251                ) );
    252252        }
     
    264264                unionInst.params.push_back( new ast::TypeExpr(
    265265                        unionDecl->location,
    266                         new ast::TypeInstType( typeDecl->name, typeDecl )
     266                        new ast::TypeInstType( typeDecl )
    267267                ) );
    268268        }
  • src/Validate/ForallPointerDecay.cpp

    rdfd3410 rb230091  
    4141        for ( auto & type_param : decl->type_params ) {
    4242                type->forall.emplace_back(
    43                         new ast::TypeInstType( type_param->name, type_param ) );
     43                        new ast::TypeInstType( type_param ) );
    4444        }
    4545        for ( auto & assertion : decl->assertions ) {
Note: See TracChangeset for help on using the changeset viewer.