Changeset a7c90d4 for src/SymTab/Validate.cc
- Timestamp:
- Mar 7, 2017, 8:33:43 AM (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:
- 64cb860, c3396e0
- Parents:
- 7fe2498
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r7fe2498 ra7c90d4 10 10 // Created On : Sun May 17 21:50:04 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 21:02:23201713 // Update Count : 3 3212 // Last Modified On : Tue Mar 7 07:51:36 2017 13 // Update Count : 349 14 14 // 15 15 … … 97 97 class ReturnTypeFixer final : public Visitor { 98 98 public: 99 100 99 typedef Visitor Parent; 101 100 using Parent::visit; … … 104 103 105 104 virtual void visit( FunctionDecl * functionDecl ); 106 107 105 virtual void visit( FunctionType * ftype ); 108 106 }; … … 161 159 private: 162 160 virtual void visit( FunctionDecl * functionDecl ); 163 164 161 virtual void visit( ReturnStmt * returnStmt ); 165 162 … … 211 208 212 209 class CompoundLiteral final : public GenPoly::DeclMutator { 213 DeclarationNode::StorageClass storageclass = DeclarationNode::NoStorageClass;210 DeclarationNode::StorageClasses storageClasses; 214 211 215 212 using GenPoly::DeclMutator::mutate; … … 694 691 if ( FunctionType *funtype = dynamic_cast<FunctionType *>( ret->get_type() ) ) { // function type? 695 692 // 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, objDecl->get_attributes(), ret->get_funcSpec() );693 FunctionDecl * newDecl = new FunctionDecl( ret->get_name(), ret->get_storageClasses(), ret->get_linkage(), funtype, 0, objDecl->get_attributes(), ret->get_funcSpec() ); 697 694 objDecl->get_attributes().clear(); 698 695 objDecl->set_type( nullptr ); … … 757 754 type = new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() ); 758 755 } // if 759 TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), DeclarationNode:: NoStorageClass, type ) );756 TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), DeclarationNode::StorageClasses(), type ) ); 760 757 typedefNames[ aggDecl->get_name() ] = std::make_pair( std::move( tyDecl ), scopeLevel ); 761 758 } // if … … 811 808 812 809 DeclarationWithType * CompoundLiteral::mutate( ObjectDecl *objectDecl ) { 813 storage class = objectDecl->get_storageClass();810 storageClasses = objectDecl->get_storageClasses(); 814 811 DeclarationWithType * temp = Mutator::mutate( objectDecl ); 815 storageclass = DeclarationNode::NoStorageClass;816 812 return temp; 817 813 } … … 822 818 static UniqueName indexName( "_compLit" ); 823 819 824 ObjectDecl *tempvar = new ObjectDecl( indexName.newName(), storage class, LinkageSpec::C, 0, compLitExpr->get_type(), compLitExpr->get_initializer() );820 ObjectDecl *tempvar = new ObjectDecl( indexName.newName(), storageClasses, LinkageSpec::C, 0, compLitExpr->get_type(), compLitExpr->get_initializer() ); 825 821 compLitExpr->set_type( 0 ); 826 822 compLitExpr->set_initializer( 0 ); … … 861 857 TupleType * tupleType = safe_dynamic_cast< TupleType * >( ResolvExpr::extractResultType( ftype ) ); 862 858 // ensure return value is not destructed by explicitly creating an empty ListInit node wherein maybeConstruct is false. 863 ObjectDecl * newRet = new ObjectDecl( "", DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer*>(), noDesignators, false ) );859 ObjectDecl * newRet = new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer*>(), noDesignators, false ) ); 864 860 deleteAll( retVals ); 865 861 retVals.clear();
Note: See TracChangeset
for help on using the changeset viewer.