File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -325,22 +325,32 @@ func (d *deadcodePass) mark(symIdx, parent loader.Sym) {
325
325
if * flagDumpDep {
326
326
to := d .ldr .SymName (symIdx )
327
327
if to != "" {
328
- if d .ldr .AttrUsedInIface (symIdx ) {
329
- to += " <UsedInIface>"
330
- }
328
+ to = d .dumpDepAddFlags (to , symIdx )
331
329
from := "_"
332
330
if parent != 0 {
333
331
from = d .ldr .SymName (parent )
334
- if d .ldr .AttrUsedInIface (parent ) {
335
- from += " <UsedInIface>"
336
- }
332
+ from = d .dumpDepAddFlags (from , parent )
337
333
}
338
334
fmt .Printf ("%s -> %s\n " , from , to )
339
335
}
340
336
}
341
337
}
342
338
}
343
339
340
+ func (d * deadcodePass ) dumpDepAddFlags (name string , symIdx loader.Sym ) string {
341
+ var flags strings.Builder
342
+ if d .ldr .AttrUsedInIface (symIdx ) {
343
+ flags .WriteString ("<UsedInIface>" )
344
+ }
345
+ if d .ldr .IsReflectMethod (symIdx ) {
346
+ flags .WriteString ("<ReflectMethod>" )
347
+ }
348
+ if flags .Len () > 0 {
349
+ return name + " " + flags .String ()
350
+ }
351
+ return name
352
+ }
353
+
344
354
func (d * deadcodePass ) markMethod (m methodref ) {
345
355
relocs := d .ldr .Relocs (m .src )
346
356
d .mark (relocs .At (m .r ).Sym (), m .src )
You can’t perform that action at this time.
0 commit comments