Changeset 6a45bd78
- Timestamp:
- Dec 10, 2020, 3:59:41 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 3e3f236
- Parents:
- d4e338f
- Location:
- src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
rd4e338f r6a45bd78 233 233 const ast::Decl * namedTypePostamble( NamedTypeDecl * decl, const ast::NamedTypeDecl * node ) { 234 234 // base comes from constructor 235 decl->parameters = get<TypeDecl>().acceptL( node->params );236 235 decl->assertions = get<DeclarationWithType>().acceptL( node->assertions ); 237 236 declPostamble( decl, node ); … … 1704 1703 cache.emplace( old, decl ); 1705 1704 decl->assertions = GET_ACCEPT_V(assertions, DeclWithType); 1706 decl->params = GET_ACCEPT_V(parameters, TypeDecl);1707 1705 decl->extension = old->extension; 1708 1706 decl->uniqueId = old->uniqueId; … … 1720 1718 ); 1721 1719 decl->assertions = GET_ACCEPT_V(assertions, DeclWithType); 1722 decl->params = GET_ACCEPT_V(parameters, TypeDecl);1723 1720 decl->extension = old->extension; 1724 1721 decl->uniqueId = old->uniqueId; -
src/AST/Decl.hpp
rd4e338f r6a45bd78 154 154 public: 155 155 ptr<Type> base; 156 std::vector<ptr<TypeDecl>> params;157 156 std::vector<ptr<DeclWithType>> assertions; 158 157 … … 160 159 const CodeLocation & loc, const std::string & name, Storage::Classes storage, 161 160 const Type * b, Linkage::Spec spec = Linkage::Cforall ) 162 : Decl( loc, name, storage, spec ), base( b ), params(),assertions() {}161 : Decl( loc, name, storage, spec ), base( b ), assertions() {} 163 162 164 163 /// Produces a name for the kind of alias -
src/AST/Pass.impl.hpp
rd4e338f r6a45bd78 609 609 VISIT({ 610 610 guard_symtab guard { *this }; 611 maybe_accept( node, &TypeDecl::params );612 611 maybe_accept( node, &TypeDecl::base ); 613 612 }) … … 638 637 VISIT({ 639 638 guard_symtab guard { *this }; 640 maybe_accept( node, &TypedefDecl::params );641 639 maybe_accept( node, &TypedefDecl::base ); 642 640 }) -
src/AST/Print.cpp
rd4e338f r6a45bd78 221 221 ++indent; 222 222 node->base->accept( *this ); 223 --indent;224 }225 226 if ( ! node->params.empty() ) {227 os << endl << indent << "... with parameters" << endl;228 ++indent;229 printAll( node->params );230 223 --indent; 231 224 } -
src/Common/PassVisitor.impl.h
rd4e338f r6a45bd78 835 835 { 836 836 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 837 maybeAccept_impl( node->parameters, *this );838 837 maybeAccept_impl( node->base , *this ); 839 838 } … … 858 857 { 859 858 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 860 maybeAccept_impl( node->parameters, *this );861 859 maybeAccept_impl( node->base , *this ); 862 860 } … … 880 878 { 881 879 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 882 maybeMutate_impl( node->parameters, *this );883 880 maybeMutate_impl( node->base , *this ); 884 881 } … … 904 901 { 905 902 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 906 maybeAccept_impl( node->parameters, *this );907 903 maybeAccept_impl( node->base , *this ); 908 904 } … … 921 917 { 922 918 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 923 maybeAccept_impl( node->parameters, *this );924 919 maybeAccept_impl( node->base , *this ); 925 920 } … … 938 933 { 939 934 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 940 maybeMutate_impl( node->parameters, *this );941 935 maybeMutate_impl( node->base , *this ); 942 936 } -
src/Parser/TypeData.cc
rd4e338f r6a45bd78 900 900 ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl::Dtype, true ); 901 901 } // if 902 buildList( td->symbolic.params, ret->get_parameters() );903 902 buildList( td->symbolic.assertions, ret->get_assertions() ); 904 903 ret->base->attributes.splice( ret->base->attributes.end(), attributes ); -
src/SynTree/Declaration.h
rd4e338f r6a45bd78 181 181 public: 182 182 Type * base; 183 std::list< TypeDecl * > parameters;184 183 std::list< DeclarationWithType * > assertions; 185 184 … … 190 189 Type * get_base() const { return base; } 191 190 void set_base( Type * newValue ) { base = newValue; } 192 std::list< TypeDecl* > & get_parameters() { return parameters; }193 191 std::list< DeclarationWithType * >& get_assertions() { return assertions; } 194 192 -
src/SynTree/NamedTypeDecl.cc
rd4e338f r6a45bd78 29 29 NamedTypeDecl::NamedTypeDecl( const NamedTypeDecl &other ) 30 30 : Parent( other ), base( maybeClone( other.base ) ) { 31 cloneAll( other.parameters, parameters );32 31 cloneAll( other.assertions, assertions ); 33 32 } … … 35 34 NamedTypeDecl::~NamedTypeDecl() { 36 35 delete base; 37 deleteAll( parameters );38 36 deleteAll( assertions ); 39 37 } … … 56 54 base->print( os, indent+1 ); 57 55 } // if 58 if ( ! parameters.empty() ) {59 os << endl << indent << "... with parameters" << endl;60 printAll( parameters, os, indent+1 );61 } // if62 56 if ( ! assertions.empty() ) { 63 57 os << endl << indent << "... with assertions" << endl; … … 76 70 base->print( os, indent+1 ); 77 71 } // if 78 if ( ! parameters.empty() ) {79 os << endl << indent << "... with parameters" << endl;80 printAll( parameters, os, indent+1 );81 } // if82 72 } 83 73
Note: See TracChangeset
for help on using the changeset viewer.