Ignore:
Timestamp:
Apr 6, 2020, 4:46:28 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
e3bc51c
Parents:
71d6bd8 (diff), 057298e (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 new-ast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cc

    r71d6bd8 r7030dab  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb 13 18:16:23 2019
    13 // Update Count     : 649
     12// Last Modified On : Mon Dec 16 07:56:46 2019
     13// Update Count     : 662
    1414//
    1515
     
    6767          case Aggregate:
    6868                // aggregate = new Aggregate_t;
    69                 aggregate.kind = DeclarationNode::NoAggregate;
     69                aggregate.kind = AggregateDecl::NoAggregate;
    7070                aggregate.name = nullptr;
    7171                aggregate.params = nullptr;
     
    345345                break;
    346346          case Aggregate:
    347                 os << DeclarationNode::aggregateNames[ aggregate.kind ] << ' ' << *aggregate.name << endl;
     347                os << AggregateDecl::aggrString( aggregate.kind ) << ' ' << *aggregate.name << endl;
    348348                if ( aggregate.params ) {
    349349                        os << string( indent + 2, ' ' ) << "with type parameters" << endl;
     
    489489        for ( typename ForallList::iterator i = outputList.begin(); i != outputList.end(); ++i, n = (DeclarationNode*)n->get_next() ) {
    490490                TypeDecl * td = static_cast<TypeDecl *>(*i);
    491                 if ( n->variable.tyClass == DeclarationNode::Otype ) {
     491                if ( n->variable.tyClass == TypeDecl::Otype ) {
    492492                        // add assertion parameters to `type' tyvars in reverse order
    493493                        // add dtor:  void ^?{}(T *)
     
    522522        switch ( td->kind ) {
    523523          case TypeData::Unknown:
    524                         // fill in implicit int
    525                         return new BasicType( buildQualifiers( td ), BasicType::SignedInt );
     524                // fill in implicit int
     525                return new BasicType( buildQualifiers( td ), BasicType::SignedInt );
    526526          case TypeData::Basic:
    527                         return buildBasicType( td );
     527                return buildBasicType( td );
    528528          case TypeData::Pointer:
    529                         return buildPointer( td );
     529                return buildPointer( td );
    530530          case TypeData::Array:
    531                         return buildArray( td );
     531                return buildArray( td );
    532532          case TypeData::Reference:
    533                         return buildReference( td );
     533                return buildReference( td );
    534534          case TypeData::Function:
    535                         return buildFunction( td );
     535                return buildFunction( td );
    536536          case TypeData::AggregateInst:
    537                         return buildAggInst( td );
     537                return buildAggInst( td );
    538538          case TypeData::EnumConstant:
    539                         // the name gets filled in later -- by SymTab::Validate
    540                         return new EnumInstType( buildQualifiers( td ), "" );
     539                // the name gets filled in later -- by SymTab::Validate
     540                return new EnumInstType( buildQualifiers( td ), "" );
    541541          case TypeData::SymbolicInst:
    542                         return buildSymbolicInst( td );
     542                return buildSymbolicInst( td );
    543543          case TypeData::Tuple:
    544                         return buildTuple( td );
     544                return buildTuple( td );
    545545          case TypeData::Typeof:
    546546          case TypeData::Basetypeof:
    547                         return buildTypeof( td );
     547                return buildTypeof( td );
    548548          case TypeData::Builtin:
    549                         if (td->builtintype == DeclarationNode::Zero) {
    550                                 return new ZeroType( noQualifiers );
    551                         }
    552                         else if (td->builtintype == DeclarationNode::One) {
    553                                 return new OneType( noQualifiers );
    554                         }
    555                         else {
    556                                 return new VarArgsType( buildQualifiers( td ) );
    557                         }
     549                switch ( td->builtintype ) {
     550                  case DeclarationNode::Zero:
     551                        return new ZeroType( noQualifiers );
     552                  case DeclarationNode::One:
     553                        return new OneType( noQualifiers );
     554                  default:
     555                        return new VarArgsType( buildQualifiers( td ) );
     556                } // switch
    558557          case TypeData::GlobalScope:
    559                         return new GlobalScopeType();
    560                 case TypeData::Qualified:
    561                         return new QualifiedType( buildQualifiers( td ), typebuild( td->qualified.parent ), typebuild( td->qualified.child ) );
     558                return new GlobalScopeType();
     559          case TypeData::Qualified:
     560                return new QualifiedType( buildQualifiers( td ), typebuild( td->qualified.parent ), typebuild( td->qualified.child ) );
    562561          case TypeData::Symbolic:
    563562          case TypeData::Enum:
    564563          case TypeData::Aggregate:
    565                         assert( false );
     564                assert( false );
    566565        } // switch
    567566
     
    768767        AggregateDecl * at;
    769768        switch ( td->aggregate.kind ) {
    770           case DeclarationNode::Struct:
    771           case DeclarationNode::Coroutine:
    772           case DeclarationNode::Monitor:
    773           case DeclarationNode::Thread:
     769          case AggregateDecl::Struct:
     770          case AggregateDecl::Coroutine:
     771          case AggregateDecl::Generator:
     772          case AggregateDecl::Monitor:
     773          case AggregateDecl::Thread:
    774774                at = new StructDecl( *td->aggregate.name, td->aggregate.kind, attributes, linkage );
    775775                buildForall( td->aggregate.params, at->get_parameters() );
    776776                break;
    777           case DeclarationNode::Union:
     777          case AggregateDecl::Union:
    778778                at = new UnionDecl( *td->aggregate.name, attributes, linkage );
    779779                buildForall( td->aggregate.params, at->get_parameters() );
    780780                break;
    781           case DeclarationNode::Trait:
     781          case AggregateDecl::Trait:
    782782                at = new TraitDecl( *td->aggregate.name, attributes, linkage );
    783783                buildList( td->aggregate.params, at->get_parameters() );
     
    809809                          AggregateDecl * typedecl = buildAggregate( type, attributes, linkage );
    810810                          switch ( type->aggregate.kind ) {
    811                                 case DeclarationNode::Struct:
    812                                 case DeclarationNode::Coroutine:
    813                                 case DeclarationNode::Monitor:
    814                                 case DeclarationNode::Thread:
     811                                case AggregateDecl::Struct:
     812                                case AggregateDecl::Coroutine:
     813                                case AggregateDecl::Monitor:
     814                                case AggregateDecl::Thread:
    815815                                  ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl );
    816816                                  break;
    817                                 case DeclarationNode::Union:
     817                                case AggregateDecl::Union:
    818818                                  ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl );
    819819                                  break;
    820                                 case DeclarationNode::Trait:
     820                                case AggregateDecl::Trait:
    821821                                  assert( false );
    822822                                  //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
     
    827827                  } else {
    828828                          switch ( type->aggregate.kind ) {
    829                                 case DeclarationNode::Struct:
    830                                 case DeclarationNode::Coroutine:
    831                                 case DeclarationNode::Monitor:
    832                                 case DeclarationNode::Thread:
     829                                case AggregateDecl::Struct:
     830                                case AggregateDecl::Coroutine:
     831                                case AggregateDecl::Monitor:
     832                                case AggregateDecl::Thread:
    833833                                  ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name );
    834834                                  break;
    835                                 case DeclarationNode::Union:
     835                                case AggregateDecl::Union:
    836836                                  ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name );
    837837                                  break;
    838                                 case DeclarationNode::Trait:
     838                                case AggregateDecl::Trait:
    839839                                  ret = new TraitInstType( buildQualifiers( type ), *type->aggregate.name );
    840840                                  break;
     
    863863          case TypeData::Aggregate: {
    864864                  switch ( type->aggregate.kind ) {
    865                         case DeclarationNode::Struct:
    866                         case DeclarationNode::Coroutine:
    867                         case DeclarationNode::Monitor:
    868                         case DeclarationNode::Thread:
     865                        case AggregateDecl::Struct:
     866                        case AggregateDecl::Coroutine:
     867                        case AggregateDecl::Monitor:
     868                        case AggregateDecl::Thread:
    869869                          ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name );
    870870                          break;
    871                         case DeclarationNode::Union:
     871                        case AggregateDecl::Union:
    872872                          ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name );
    873873                          break;
    874                         case DeclarationNode::Trait:
     874                        case AggregateDecl::Trait:
    875875                          ret = new TraitInstType( buildQualifiers( type ), *type->aggregate.name );
    876876                          break;
Note: See TracChangeset for help on using the changeset viewer.