Changeset dd020c0 for src/SymTab/Validate.cc
- Timestamp:
- Mar 3, 2017, 10:12:02 PM (8 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:
- 8191203
- Parents:
- f37147b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
rf37147b rdd020c0 10 10 // Created On : Sun May 17 21:50:04 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 23 21:33:55201713 // Update Count : 3 1812 // Last Modified On : Fri Mar 3 21:02:23 2017 13 // Update Count : 332 14 14 // 15 15 … … 660 660 // Note, qualifiers on the typedef are superfluous for the forward declaration. 661 661 if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( tyDecl->get_base() ) ) { 662 return aggDecl->get_baseStruct() ? Mutator::mutate( aggDecl->get_baseStruct() ) :new StructDecl( aggDecl->get_name() );662 return new StructDecl( aggDecl->get_name() ); 663 663 } else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( tyDecl->get_base() ) ) { 664 return aggDecl->get_baseUnion() ? Mutator::mutate( aggDecl->get_baseUnion() ) :new UnionDecl( aggDecl->get_name() );664 return new UnionDecl( aggDecl->get_name() ); 665 665 } else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( tyDecl->get_base() ) ) { 666 666 return new EnumDecl( enumDecl->get_name() ); … … 691 691 DeclarationWithType *ret = Mutator::mutate( objDecl ); 692 692 typedefNames.endScope(); 693 // is the type a function? 694 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( ret->get_type() ) ) { 693 694 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( ret->get_type() ) ) { // function type? 695 695 // replace the current object declaration with a function declaration 696 FunctionDecl * newDecl = new FunctionDecl( ret->get_name(), ret->get_storageClass(), ret->get_linkage(), funtype, 0, ret->get_isInline(), ret->get_isNoreturn(), objDecl->get_attributes() );696 FunctionDecl * newDecl = new FunctionDecl( ret->get_name(), ret->get_storageClass(), ret->get_linkage(), funtype, 0, objDecl->get_attributes(), ret->get_funcSpec() ); 697 697 objDecl->get_attributes().clear(); 698 698 objDecl->set_type( nullptr ); 699 699 delete objDecl; 700 700 return newDecl; 701 } else if ( objDecl->get_isInline() || objDecl->get_isNoreturn() ) {702 throw SemanticError( "invalid inline or _Noreturn specification in declaration of ", objDecl );703 701 } // if 704 702 return ret;
Note: See TracChangeset
for help on using the changeset viewer.