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