Changes in src/Parser/DeclarationNode.cc [45161b4d:8e9cbb2]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r45161b4d r8e9cbb2 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // DeclarationNode.cc -- 7 // DeclarationNode.cc -- 8 8 // 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Apr 13 16:53:17201613 // Update Count : 16 112 // Last Modified On : Thu Jun 30 14:39:51 2016 13 // Update Count : 163 14 14 // 15 15 … … 97 97 os << endl << string( indent + 2, ' ' ) << "with initializer "; 98 98 initializer->printOneLine( os ); 99 os << " maybe constructed? " << initializer->get_maybeConstructed(); 100 99 101 } // if 100 102 … … 353 355 } // if 354 356 } 355 357 356 358 DeclarationNode *DeclarationNode::addQualifiers( DeclarationNode *q ) { 357 359 if ( q ) { … … 504 506 assert( false ); 505 507 } // switch 506 508 507 509 return this; 508 510 } … … 615 617 assert( a->type->kind == TypeData::Array ); 616 618 TypeData *lastArray = findLast( a->type ); 617 if ( type ) { 619 if ( type ) { 618 620 switch ( type->kind ) { 619 621 case TypeData::Aggregate: … … 659 661 } // if 660 662 } 661 663 662 664 DeclarationNode *DeclarationNode::addIdList( DeclarationNode *ids ) { 663 665 type = addIdListToType( type, ids ); … … 853 855 Declaration *DeclarationNode::build() const { 854 856 if ( type ) { 855 Declaration *newDecl = type->buildDecl( name, buildStorageClass(), maybeBuild< Expression >( bitfieldWidth ), buildFuncSpecifier( Inline ), buildFuncSpecifier( Noreturn ), linkage, maybeBuild< Initializer >(initializer) ); 856 return newDecl; 857 return type->buildDecl( name, buildStorageClass(), maybeBuild< Expression >( bitfieldWidth ), buildFuncSpecifier( Inline ), buildFuncSpecifier( Noreturn ), linkage, maybeBuild< Initializer >(initializer) )->set_extension( extension ); 857 858 } // if 858 859 if ( ! buildFuncSpecifier( Inline ) && ! buildFuncSpecifier( Noreturn ) ) { 859 return new ObjectDecl( name, buildStorageClass(), linkage, maybeBuild< Expression >( bitfieldWidth ), 0, maybeBuild< Initializer >( initializer ));860 return (new ObjectDecl( name, buildStorageClass(), linkage, maybeBuild< Expression >( bitfieldWidth ), 0, maybeBuild< Initializer >( initializer ) ))->set_extension( extension ); 860 861 } // if 861 862 throw SemanticError( "invalid function specifier in declaration of ", this ); … … 864 865 Type *DeclarationNode::buildType() const { 865 866 assert( type ); 866 867 867 868 switch ( type->kind ) { 868 869 case TypeData::Enum:
Note: See TracChangeset
for help on using the changeset viewer.