Changeset 8217e8f for src/Parser


Ignore:
Timestamp:
Aug 14, 2017, 2:07:34 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
6cfe8bb
Parents:
36a5a77 (diff), bd46af4 (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 references

Location:
src/Parser
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r36a5a77 r8217e8f  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Jul 14 16:55:00 2017
    13 // Update Count     : 1020
     12// Last Modified On : Thr Aug 10 17:02:00 2017
     13// Update Count     : 1021
    1414//
    1515
     
    275275        return newnode;
    276276} // DeclarationNode::newEnumConstant
    277 
    278 DeclarationNode * DeclarationNode::newTreeStruct( Aggregate kind, const string * name, const string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body ) {
    279         assert( name );
    280         DeclarationNode * newnode = new DeclarationNode;
    281         newnode->type = new TypeData( TypeData::Aggregate );
    282         newnode->type->aggregate.kind = kind;
    283         newnode->type->aggregate.name = name;
    284         newnode->type->aggregate.actuals = actuals;
    285         newnode->type->aggregate.fields = fields;
    286         newnode->type->aggregate.body = body;
    287         newnode->type->aggregate.tagged = true;
    288         newnode->type->aggregate.parent = parent;
    289         return newnode;
    290 } // DeclarationNode::newTreeStruct
    291277
    292278DeclarationNode * DeclarationNode::newName( string * name ) {
  • src/Parser/ParseNode.h

    r36a5a77 r8217e8f  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 13:28:16 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 27 12:08:08 2017
    13 // Update Count     : 788
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thu Aug 10 16:54:00 2017
     13// Update Count     : 789
    1414//
    1515
     
    248248        static DeclarationNode * newAsmStmt( StatementNode * stmt ); // gcc external asm statement
    249249
    250         // Perhaps this would best fold into newAggragate.
    251         static DeclarationNode * newTreeStruct( Aggregate kind, const std::string * name, const std::string * parent, ExpressionNode * actuals, DeclarationNode * fields, bool body );
    252 
    253250        DeclarationNode();
    254251        ~DeclarationNode();
     
    335332
    336333        static UniqueName anonymous;
    337 
    338         // Temp to test TreeStruct
    339         const std::string * parent_name;
    340334}; // DeclarationNode
    341335
  • src/Parser/TypeData.cc

    r36a5a77 r8217e8f  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Aug  9 13:50:00 2017
    13 // Update Count     : 567
     12// Last Modified On : Mon Aug 14 10:41:00 2017
     13// Update Count     : 568
    1414//
    1515
     
    6464                aggregate.fields = nullptr;
    6565                aggregate.body = false;
    66                 aggregate.tagged = false;
    67                 aggregate.parent = nullptr;
    6866                break;
    6967          case AggregateInst:
     
    125123                delete aggregate.actuals;
    126124                delete aggregate.fields;
    127                 delete aggregate.parent;
    128125                // delete aggregate;
    129126                break;
     
    640637        switch ( td->aggregate.kind ) {
    641638          case DeclarationNode::Struct:
    642                 if ( td->aggregate.tagged ) {
    643                         at = new StructDecl( *td->aggregate.name, td->aggregate.parent, attributes, linkage );
    644                         buildForall( td->aggregate.params, at->get_parameters() );
    645                         break;
    646                 }
    647639          case DeclarationNode::Coroutine:
    648640          case DeclarationNode::Monitor:
     
    652644                break;
    653645          case DeclarationNode::Union:
    654                 at = new UnionDecl( *td->aggregate.name, attributes );
     646                at = new UnionDecl( *td->aggregate.name, attributes, linkage );
    655647                buildForall( td->aggregate.params, at->get_parameters() );
    656648                break;
    657649          case DeclarationNode::Trait:
    658                 at = new TraitDecl( *td->aggregate.name, attributes );
     650                at = new TraitDecl( *td->aggregate.name, attributes, linkage );
    659651                buildList( td->aggregate.params, at->get_parameters() );
    660652                break;
     
    673665          case TypeData::Enum: {
    674666                  if ( type->enumeration.body ) {
    675                           EnumDecl * typedecl = buildEnum( type, attributes );
     667                          EnumDecl * typedecl = buildEnum( type, attributes, linkage );
    676668                          return new EnumInstType( buildQualifiers( type ), typedecl );
    677669                  } else {
     
    778770} // buildSymbolic
    779771
    780 EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes ) {
     772EnumDecl * buildEnum( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) {
    781773        assert( td->kind == TypeData::Enum );
    782         EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes );
     774        EnumDecl * ret = new EnumDecl( *td->enumeration.name, attributes, linkage );
    783775        buildList( td->enumeration.constants, ret->get_members() );
    784776        list< Declaration * >::iterator members = ret->get_members().begin();
     
    831823                return buildAggregate( td, attributes, linkage );
    832824        } else if ( td->kind == TypeData::Enum ) {
    833                 return buildEnum( td, attributes );
     825                return buildEnum( td, attributes, linkage );
    834826        } else if ( td->kind == TypeData::Symbolic ) {
    835827                return buildSymbolic( td, name, scs, linkage );
  • src/Parser/TypeData.h

    r36a5a77 r8217e8f  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 15:18:36 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:32:47 2017
    13 // Update Count     : 188
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Mon Aug 14 10:38:00 2017
     13// Update Count     : 189
    1414//
    1515
     
    108108ReferenceToType * buildAggInst( const TypeData * );
    109109TypeDecl * buildVariable( const TypeData * );
    110 EnumDecl * buildEnum( const TypeData *, std::list< Attribute * > );
     110EnumDecl * buildEnum( const TypeData *, std::list< Attribute * >, LinkageSpec::Spec );
    111111TypeInstType * buildSymbolicInst( const TypeData * );
    112112TupleType * buildTuple( const TypeData * );
Note: See TracChangeset for help on using the changeset viewer.