@@ -159,23 +159,29 @@ public ValueTask ExecuteAsync(IConsole console)
159159 annotationsData [ location . File ] = [ ] ;
160160 annotationsData [ location . File ] . Add ( processed . Data ) ;
161161
162+ //if (processed.Data is FunctionSymbolModel function && processed.Target is ASTMethod method)
163+ //{
164+ // if (method.IsConstructor) {
165+
166+ // }
167+ //}
168+
162169 if ( processed . Data is VirtualTableSymbolModel vtable && processed . Target is ASTClass cls )
163170 {
164171 // Create helper symbol $vtable_for_X$ for virtual tables
165- {
166- string [ ] reverseClassName = [ .. cls . FullName . Split ( "::" ) . Reverse ( ) , "" ] ;
167- string mangled = $ "?$vtable_for_ { vtable . ForWhat . Replace ( "::" , "$" ) } @ { string . Join ( "@" , reverseClassName ) } @2_KA" ;
168- annotationsData [ location . File ] . Add ( new VariableSymbolModel
169- {
170- Name = mangled ,
172+ foreach ( var variable in cls . Variables . Where ( v => v . MangledName . StartsWith ( $ "?$vtable_for_ { vtable . ForWhat . Replace ( "::" , "$" ) } " ) ) ) {
173+ bool exists = processor . ProcessedAnnotations . Select ( a => a . Data ) . OfType < VariableSymbolModel > ( ) . FirstOrDefault ( v => v . Name == variable . MangledName ) is not null ;
174+ if ( exists )
175+ continue ;
176+ annotationsData [ location . File ] . Add ( new VariableSymbolModel {
177+ Name = variable . MangledName ,
171178 Address = vtable . Address ,
172179 IsVirtualTableAddress = true
173180 } ) ;
174181 }
175182
176183 // Add vtable symbol so MSVC keeps being happy
177- if ( vtable . VtableMangledLabel is not null )
178- {
184+ if ( vtable . VtableMangledLabel is not null ) {
179185 annotationsData [ location . File ] . Add ( new VariableSymbolModel
180186 {
181187 Name = vtable . VtableMangledLabel ,
0 commit comments