Closed ghost closed 8 years ago
Do you mean unused entries in a classfile's constant pool? Or unused constants in the assembly file?
For the first: Well it's possible, though it will require some work to ensure that every single Constant Pool reference is counted. The big question is what the point is. I think you're unlikely to find any classes with unused cp entries because compilers aren't going to generate them. So unless you have a class that was handwritten and someone intentionally added unused entries, there's not much point.
For the second: In this case it's easier to check, but again there's not much point. Unless you're deliberately adding them by assigning to raw indices, unused entries won't be generated in the output classfile. All it means is potentially some extra clutter in the assembly file.
Well the first one, more of in case something isn't added during the disassemble process
This is obsolete due to the new disassembler.
Would it be possible to add a debug output that shows us anything in the Constant Pool that is unused?