Ignore:
Timestamp:
Jul 4, 2017, 9:40:16 AM (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:
208e5be
Parents:
9c951e3 (diff), f7cb0bc (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r9c951e3 rb1e63ac5  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 12:34:05 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 17 15:46:33 2017
    13 // Update Count     : 1018
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Wed Jun 28 15:27:00 2017
     13// Update Count     : 1019
    1414//
    1515
     
    5757        variable.tyClass = NoTypeClass;
    5858        variable.assertions = nullptr;
     59        variable.initializer = nullptr;
    5960
    6061//      attr.name = nullptr;
     
    7071//      delete variable.name;
    7172        delete variable.assertions;
     73        delete variable.initializer;
    7274
    7375        delete type;
     
    101103        newnode->variable.tyClass = variable.tyClass;
    102104        newnode->variable.assertions = maybeClone( variable.assertions );
     105        newnode->variable.initializer = maybeClone( variable.initializer );
    103106
    104107//      newnode->attr.name = attr.name ? new string( *attr.name ) : nullptr;
     
    857860}
    858861
     862DeclarationNode * DeclarationNode::addTypeInitializer( DeclarationNode * init ) {
     863        assertf( variable.tyClass != NoTypeClass, "Called addTypeInitializer on something that isn't a type variable." );
     864        variable.initializer = init;
     865        return this;
     866}
     867
    859868DeclarationNode * DeclarationNode::cloneType( string * newName ) {
    860869        DeclarationNode * newnode = new DeclarationNode;
     
    10141023                assertf( sizeof(kindMap)/sizeof(kindMap[0] == NoTypeClass-1), "DeclarationNode::build: kindMap is out of sync." );
    10151024                assertf( variable.tyClass < sizeof(kindMap)/sizeof(kindMap[0]), "Variable's tyClass is out of bounds." );
    1016                 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ] );
     1025                TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.initializer ? variable.initializer->buildType() : nullptr );
    10171026                buildList( variable.assertions, ret->get_assertions() );
    10181027                return ret;
     
    10541063          case TypeData::Enum:
    10551064          case TypeData::Aggregate: {
    1056                   ReferenceToType * ret = buildComAggInst( type, attributes );
     1065                  ReferenceToType * ret = buildComAggInst( type, attributes, linkage );
    10571066                  buildList( type->aggregate.actuals, ret->get_parameters() );
    10581067                  return ret;
Note: See TracChangeset for help on using the changeset viewer.