Changeset e9e9f56 for src/Validate/LinkReferenceToTypes.cpp
- Timestamp:
- Sep 21, 2022, 9:22:24 AM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 20737104
- Parents:
- b6c3688
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/LinkReferenceToTypes.cpp
rb6c3688 re9e9f56 10 10 // Created On : Thr Apr 21 11:41:00 2022 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Jun 28 14:58:00 202213 // Update Count : 112 // Last Modified On : Tue Sep 20 16:17:00 2022 13 // Update Count : 2 14 14 // 15 15 … … 26 26 27 27 struct LinkTypesCore : public WithNoIdSymbolTable, 28 public ast::WithCodeLocation, 28 29 public ast::WithGuards, 29 public ast::WithVisitorRef<LinkTypesCore>, 30 public ast::WithShortCircuiting { 31 30 public ast::WithShortCircuiting, 31 public ast::WithVisitorRef<LinkTypesCore> { 32 32 ast::TypeInstType const * postvisit( ast::TypeInstType const * type ); 33 33 ast::EnumInstType const * postvisit( ast::EnumInstType const * type ); … … 38 38 void postvisit( ast::QualifiedType const * type ); 39 39 40 void previsit( ast::ParseNode const * node );41 42 40 ast::EnumDecl const * postvisit( ast::EnumDecl const * decl ); 43 41 ast::StructDecl const * previsit( ast::StructDecl const * decl ); … … 60 58 ForwardEnumsType forwardEnums; 61 59 62 const CodeLocation * location = nullptr;63 60 /// true if currently in a generic type body, 64 61 /// so that type parameter instances can be renamed appropriately … … 177 174 // Linking only makes sense for the 'oldest ancestor' of the qualified type. 178 175 type->parent->accept( *visitor ); 179 }180 181 void LinkTypesCore::previsit( ast::ParseNode const * node ) {182 GuardValue( location ) = &node->location;183 176 } 184 177 … … 225 218 GuardValue( inGeneric ) = !decl->params.empty(); 226 219 if ( !inGeneric ) { 227 GuardValue( location ) = &decl->location;228 220 return decl; 229 221 } 230 222 auto mut = ast::mutate( decl ); 231 GuardValue( location ) = &mut->location;232 223 for ( ast::ptr<ast::TypeDecl> & typeDecl : mut->params ) { 233 224 typeDecl.get_and_mutate()->name = "__" + typeDecl->name + "_generic_";
Note: See TracChangeset
for help on using the changeset viewer.