Changeset 713905fd for src/Validate
- Timestamp:
- Jul 10, 2023, 11:14:13 AM (2 years ago)
- Branches:
- master
- Children:
- c3f7dd9
- Parents:
- e6e1a12 (diff), b29a1e8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/Validate/LinkReferenceToTypes.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/LinkReferenceToTypes.cpp
re6e1a12 r713905fd 80 80 ast::EnumInstType const * LinkTypesCore::postvisit( ast::EnumInstType const * type ) { 81 81 ast::EnumDecl const * decl = symtab.lookupEnum( type->name ); 82 ast::EnumInstType * mut = ast::mutate( type ); 82 83 // It's not a semantic error if the enum is not found, just an implicit forward declaration. 83 84 if ( decl ) { 84 85 // Just linking in the node. 85 auto mut = ast::mutate( type );86 86 mut->base = decl; 87 type = mut;88 87 } 89 88 if ( !decl || !decl->body ) { 90 auto mut = ast::mutate( type );91 89 forwardEnums[ mut->name ].push_back( mut ); 92 type = mut; 93 } 94 return type; 90 } 91 return mut; 95 92 } 96 93 97 94 ast::StructInstType const * LinkTypesCore::postvisit( ast::StructInstType const * type ) { 98 95 ast::StructDecl const * decl = symtab.lookupStruct( type->name ); 96 ast::StructInstType * mut = ast::mutate( type ); 99 97 // It's not a semantic error if the struct is not found, just an implicit forward declaration. 100 98 if ( decl ) { 101 99 // Just linking in the node. 102 auto mut = ast::mutate( type );103 100 mut->base = decl; 104 type = mut;105 101 } 106 102 if ( !decl || !decl->body ) { 107 auto mut = ast::mutate( type );108 103 forwardStructs[ mut->name ].push_back( mut ); 109 type = mut; 110 } 111 return type; 104 } 105 return mut; 112 106 } 113 107 114 108 ast::UnionInstType const * LinkTypesCore::postvisit( ast::UnionInstType const * type ) { 115 109 ast::UnionDecl const * decl = symtab.lookupUnion( type->name ); 110 ast::UnionInstType * mut = ast::mutate( type ); 116 111 // It's not a semantic error if the union is not found, just an implicit forward declaration. 117 112 if ( decl ) { 118 113 // Just linking in the node. 119 auto mut = ast::mutate( type );120 114 mut->base = decl; 121 type = mut;122 115 } 123 116 if ( !decl || !decl->body ) { 124 auto mut = ast::mutate( type );125 117 forwardUnions[ mut->name ].push_back( mut ); 126 type = mut; 127 } 128 return type; 118 } 119 return mut; 129 120 } 130 121
Note:
See TracChangeset
for help on using the changeset viewer.