Indicate whether a label is used only for debugging in the tree API
ASM knows when a label is just for debugging (line numbers) or not (control
flow):
Label.java:
/**
* Indicates if this label is only used for debug attributes. Such a label
* is not the start of a basic block, the target of a jump instruction, or
* an exception handler. It can be safely ignored in control flow graph
* analysis algorithms (for optimization purposes).
*/
static final int DEBUG = 1;
It would be useful to have this information exported in the tree API.
The only workaround I found is to search for a label in all the non-debugging
label references I found: JumpInsnNode.label, TryCatchBlockNode.
{start,end,handler}, ... That's obviously unwieldy.
I assume that finding a LineNumberNode.start pointing at a label is not
sufficient to guarantee that said label is used only for debugging.