Changeset 7527e63 for src/Parser/DeclarationNode.cc
- Timestamp:
- Aug 16, 2016, 3:20:06 PM (9 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r950f7a7 r7527e63 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jul 12 20:49:31201613 // Update Count : 1 6412 // Last Modified On : Mon Aug 15 20:48:55 2016 13 // Update Count : 178 14 14 // 15 15 … … 49 49 newnode->name = name; 50 50 newnode->storageClasses = storageClasses; 51 newnode->bitfieldWidth = maybeClone( bitfieldWidth );51 newnode->bitfieldWidth = bitfieldWidth; 52 52 newnode->hasEllipsis = hasEllipsis; 53 53 newnode->initializer = initializer; 54 newnode-> next = maybeClone( next);54 newnode->set_next( maybeClone( get_next() ) ); 55 55 newnode->linkage = linkage; 56 56 return newnode; … … 283 283 newnode->type->array->dimension = size; 284 284 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() ) ) { 286 286 newnode->type->array->isVarLen = false; 287 287 } else { … … 469 469 470 470 // there may be typedefs chained onto the type 471 if ( o->get_ link() ) {472 set_l ink( o->get_link()->clone() );471 if ( o->get_next() ) { 472 set_last( o->get_next()->clone() ); 473 473 } // if 474 474 } // if … … 756 756 DeclarationNode *DeclarationNode::appendList( DeclarationNode *node ) { 757 757 if ( node != 0 ) { 758 set_l ink( node );758 set_last( node ); 759 759 } // if 760 760 return this; … … 775 775 void buildList( const DeclarationNode *firstNode, std::list< Declaration * > &outputList ) { 776 776 SemanticError errors; 777 std::back_insert_iterator< std::list< Declaration * > > out( outputList );777 std::back_insert_iterator< std::list< Declaration * > > out( outputList ); 778 778 const DeclarationNode *cur = firstNode; 779 779 while ( cur ) { … … 793 793 errors.append( e ); 794 794 } // try 795 cur = dynamic_cast< DeclarationNode *>( cur->get_link() );795 cur = dynamic_cast< DeclarationNode * >( cur->get_next() ); 796 796 } // while 797 797 if ( ! errors.isEmpty() ) { … … 800 800 } 801 801 802 void buildList( const DeclarationNode *firstNode, std::list< DeclarationWithType * > &outputList ) {802 void buildList( const DeclarationNode *firstNode, std::list< DeclarationWithType * > &outputList ) { 803 803 SemanticError errors; 804 std::back_insert_iterator< std::list< DeclarationWithType * > > out( outputList );804 std::back_insert_iterator< std::list< DeclarationWithType * > > out( outputList ); 805 805 const DeclarationNode *cur = firstNode; 806 806 while ( cur ) { … … 816 816 Declaration *decl = cur->build(); 817 817 if ( decl ) { 818 if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( decl ) ) {818 if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType * >( decl ) ) { 819 819 *out++ = dwt; 820 } else if ( StructDecl *agg = dynamic_cast< StructDecl * >( decl ) ) {820 } else if ( StructDecl *agg = dynamic_cast< StructDecl * >( decl ) ) { 821 821 StructInstType *inst = new StructInstType( Type::Qualifiers(), agg->get_name() ); 822 822 *out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, 0, inst, 0 ); 823 823 delete agg; 824 } else if ( UnionDecl *agg = dynamic_cast< UnionDecl * >( decl ) ) {824 } else if ( UnionDecl *agg = dynamic_cast< UnionDecl * >( decl ) ) { 825 825 UnionInstType *inst = new UnionInstType( Type::Qualifiers(), agg->get_name() ); 826 826 *out++ = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, 0, inst, 0 ); … … 830 830 errors.append( e ); 831 831 } // try 832 cur = dynamic_cast< DeclarationNode * >( cur->get_link() );832 cur = dynamic_cast< DeclarationNode * >( cur->get_next() ); 833 833 } // while 834 834 if ( ! errors.isEmpty() ) { … … 837 837 } 838 838 839 void buildTypeList( const DeclarationNode *firstNode, std::list< Type * > &outputList ) {839 void buildTypeList( const DeclarationNode *firstNode, std::list< Type * > &outputList ) { 840 840 SemanticError errors; 841 std::back_insert_iterator< std::list< Type * > > out( outputList );841 std::back_insert_iterator< std::list< Type * > > out( outputList ); 842 842 const DeclarationNode *cur = firstNode; 843 843 while ( cur ) { … … 847 847 errors.append( e ); 848 848 } // try 849 cur = dynamic_cast< DeclarationNode * >( cur->get_link() );849 cur = dynamic_cast< DeclarationNode * >( cur->get_next() ); 850 850 } // while 851 851 if ( ! errors.isEmpty() ) {
Note:
See TracChangeset
for help on using the changeset viewer.