Ignore:
Timestamp:
Aug 16, 2016, 3:20:06 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
1f6d4624
Parents:
950f7a7 (diff), 7880579 (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' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    r950f7a7 r7527e63  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 12 20:49:31 2016
    13 // Update Count     : 164
     12// Last Modified On : Mon Aug 15 20:48:55 2016
     13// Update Count     : 178
    1414//
    1515
     
    4949        newnode->name = name;
    5050        newnode->storageClasses = storageClasses;
    51         newnode->bitfieldWidth = maybeClone( bitfieldWidth );
     51        newnode->bitfieldWidth = bitfieldWidth;
    5252        newnode->hasEllipsis = hasEllipsis;
    5353        newnode->initializer = initializer;
    54         newnode->next = maybeClone( next );
     54        newnode->set_next( maybeClone( get_next() ) );
    5555        newnode->linkage = linkage;
    5656        return newnode;
     
    283283        newnode->type->array->dimension = size;
    284284        newnode->type->array->isStatic = isStatic;
    285         if ( newnode->type->array->dimension == 0 || dynamic_cast<ConstantNode *>( newnode->type->array->dimension ) ) {
     285        if ( newnode->type->array->dimension == 0 || dynamic_cast< ConstantExpr * >( newnode->type->array->dimension->build() ) ) {
    286286                newnode->type->array->isVarLen = false;
    287287        } else {
     
    469469
    470470                // there may be typedefs chained onto the type
    471                 if ( o->get_link() ) {
    472                         set_link( o->get_link()->clone() );
     471                if ( o->get_next() ) {
     472                        set_last( o->get_next()->clone() );
    473473                } // if
    474474        } // if
     
    756756DeclarationNode *DeclarationNode::appendList( DeclarationNode *node ) {
    757757        if ( node != 0 ) {
    758                 set_link( node );
     758                set_last( node );
    759759        } // if
    760760        return this;
     
    775775void buildList( const DeclarationNode *firstNode, std::list< Declaration * > &outputList ) {
    776776        SemanticError errors;
    777         std::back_insert_iterator< std::list< Declaration *> > out( outputList );
     777        std::back_insert_iterator< std::list< Declaration * > > out( outputList );
    778778        const DeclarationNode *cur = firstNode;
    779779        while ( cur ) {
     
    793793                        errors.append( e );
    794794                } // try
    795                 cur = dynamic_cast<DeclarationNode *>( cur->get_link() );
     795                cur = dynamic_cast< DeclarationNode * >( cur->get_next() );
    796796        } // while
    797797        if ( ! errors.isEmpty() ) {
     
    800800}
    801801
    802 void buildList( const DeclarationNode *firstNode, std::list< DeclarationWithType *> &outputList ) {
     802void buildList( const DeclarationNode *firstNode, std::list< DeclarationWithType * > &outputList ) {
    803803        SemanticError errors;
    804         std::back_insert_iterator< std::list< DeclarationWithType *> > out( outputList );
     804        std::back_insert_iterator< std::list< DeclarationWithType * > > out( outputList );
    805805        const DeclarationNode *cur = firstNode;
    806806        while ( cur ) {
     
    816816                        Declaration *decl = cur->build();
    817817                        if ( decl ) {
    818                                 if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType *>( decl ) ) {
     818                                if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {
    819819                                        *out++ = dwt;
    820                                 } else if ( StructDecl *agg = dynamic_cast< StructDecl *>( decl ) ) {
     820                                } else if ( StructDecl *agg = dynamic_cast< StructDecl * >( decl ) ) {
    821821                                        StructInstType *inst = new StructInstType( Type::Qualifiers(), agg->get_name() );
    822822                                        *out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, 0, inst, 0 );
    823823                                        delete agg;
    824                                 } else if ( UnionDecl *agg = dynamic_cast< UnionDecl *>( decl ) ) {
     824                                } else if ( UnionDecl *agg = dynamic_cast< UnionDecl * >( decl ) ) {
    825825                                        UnionInstType *inst = new UnionInstType( Type::Qualifiers(), agg->get_name() );
    826826                                        *out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, 0, inst, 0 );
     
    830830                        errors.append( e );
    831831                } // try
    832                 cur = dynamic_cast< DeclarationNode *>( cur->get_link() );
     832                cur = dynamic_cast< DeclarationNode * >( cur->get_next() );
    833833        } // while
    834834        if ( ! errors.isEmpty() ) {
     
    837837}
    838838
    839 void buildTypeList( const DeclarationNode *firstNode, std::list< Type *> &outputList ) {
     839void buildTypeList( const DeclarationNode *firstNode, std::list< Type * > &outputList ) {
    840840        SemanticError errors;
    841         std::back_insert_iterator< std::list< Type *> > out( outputList );
     841        std::back_insert_iterator< std::list< Type * > > out( outputList );
    842842        const DeclarationNode *cur = firstNode;
    843843        while ( cur ) {
     
    847847                        errors.append( e );
    848848                } // try
    849                 cur = dynamic_cast< DeclarationNode *>( cur->get_link() );
     849                cur = dynamic_cast< DeclarationNode * >( cur->get_next() );
    850850        } // while
    851851        if ( ! errors.isEmpty() ) {
Note: See TracChangeset for help on using the changeset viewer.