Changeset 0d7fc00
- Timestamp:
- Jul 14, 2023, 3:44:17 PM (17 months ago)
- Branches:
- master
- Children:
- dbf5e18
- Parents:
- c25f16b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/LinkReferenceToTypes.cpp
rc25f16b r0d7fc00 71 71 /// The "leaveNamespace" is handled by guard. 72 72 void enterNamespace(); 73 /// Puts the decl on the back of declsToAdd Beforeonce traversal is73 /// Puts the decl on the back of declsToAddAfter once traversal is 74 74 /// outside of any namespaces. 75 void addDecl BeforeOutside( ast::Decl const * );75 void addDeclAfterOutside( ast::Decl const * ); 76 76 }; 77 77 … … 81 81 GuardAction( [this](){ 82 82 inNamespace = false; 83 declsToAdd Before.splice( declsToAddBefore.begin(), declsToAddOutside );83 declsToAddAfter.splice( declsToAddAfter.begin(), declsToAddOutside ); 84 84 } ); 85 85 } 86 86 87 void LinkTypesCore::addDecl BeforeOutside( ast::Decl const * decl ) {87 void LinkTypesCore::addDeclAfterOutside( ast::Decl const * decl ) { 88 88 if ( inNamespace ) { 89 89 declsToAddOutside.emplace_back( decl ); 90 90 } else { 91 declsToAdd Before.emplace_back( decl );91 declsToAddAfter.emplace_back( decl ); 92 92 } 93 93 } … … 113 113 if ( !decl || decl->location.isUnset() ) { 114 114 assert( location ); 115 decl = new ast::EnumDecl( *location, type->name ); 115 ast::EnumDecl * mut = new ast::EnumDecl( *location, type->name ); 116 mut->linkage = ast::Linkage::Compiler; 117 decl = mut; 116 118 symtab.addEnum( decl ); 117 addDecl BeforeOutside( decl );119 addDeclAfterOutside( decl ); 118 120 } 119 121 … … 135 137 if ( !decl || decl->location.isUnset() ) { 136 138 assert( location ); 137 decl = new ast::StructDecl( *location, type->name ); 139 ast::StructDecl * mut = new ast::StructDecl( *location, type->name ); 140 mut->linkage = ast::Linkage::Compiler; 141 decl = mut; 138 142 symtab.addStruct( decl ); 139 addDecl BeforeOutside( decl );143 addDeclAfterOutside( decl ); 140 144 } 141 145 … … 157 161 if ( !decl || decl->location.isUnset() ) { 158 162 assert( location ); 159 decl = new ast::UnionDecl( *location, type->name ); 163 ast::UnionDecl * mut = new ast::UnionDecl( *location, type->name ); 164 mut->linkage = ast::Linkage::Compiler; 165 decl = mut; 160 166 symtab.addUnion( decl ); 161 addDecl BeforeOutside( decl );167 addDeclAfterOutside( decl ); 162 168 } 163 169
Note: See TracChangeset
for help on using the changeset viewer.