Changeset 4a3386b4 for src/Parser/DeclarationNode.cc
- Timestamp:
- Jan 19, 2017, 2:56:51 PM (9 years ago)
- 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:
- 8f49a54
- Parents:
- 765aa76 (diff), c2416d5 (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
-
src/Parser/DeclarationNode.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r765aa76 r4a3386b4 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 13 14:43:38 201613 // Update Count : 66 012 // Last Modified On : Sat Jan 14 14:36:23 2017 13 // Update Count : 669 14 14 // 15 15 … … 22 22 #include "TypeData.h" 23 23 24 #include "SynTree/Attribute.h" 24 25 #include "SynTree/Declaration.h" 25 26 #include "SynTree/Expression.h" … … 397 398 } 398 399 400 DeclarationNode * DeclarationNode::newAttribute( string * name, ExpressionNode * expr ) { 401 DeclarationNode * newnode = new DeclarationNode; 402 newnode->type = nullptr; 403 std::list< Expression * > exprs; 404 buildList( expr, exprs ); 405 newnode->attributes.push_back( new Attribute( *name, exprs ) ); 406 delete name; 407 return newnode; 408 } 409 399 410 void appendError( string & dst, const string & src ) { 400 411 if ( src.empty() ) return; … … 435 446 storageClass = q->storageClass; 436 447 } // if 448 attributes.splice( attributes.end(), q->attributes ); 437 449 return this; 438 450 } // DeclarationNode::copyStorageClasses … … 958 970 959 971 if ( type ) { 960 return buildDecl( type, name ? *name : string( "" ), storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, asmName, maybeBuild< Initializer >(initializer) )->set_extension( extension );972 return buildDecl( type, name ? *name : string( "" ), storageClass, maybeBuild< Expression >( bitfieldWidth ), isInline, isNoreturn, linkage, asmName, maybeBuild< Initializer >(initializer), attributes )->set_extension( extension ); 961 973 } // if 962 974
Note:
See TracChangeset
for help on using the changeset viewer.