clang does not generate a DW_TAG_label for the example below, while gcc does: int main(int argc, char** argv) { goto failure; failure: return 1; }
Created attachment 19885 [details] llvm-dwarfdump output for clang binary
Created attachment 19886 [details] llvm-dwarfdump output for gcc binary
I tried bisecting this but couldn't find any passing builds. Did we ever generate this TAG?
I have only ever seen DW_TAG_label being generated for assembler sources. In assembler there is no notion of a function, only labels.
Do you think generating a DW_TAG_label for C-language labels would be useful?
I'd like to say yes, assuming that it's a prerequisite to be able to break on labels in the debugger. I don't know if LLDB supports this, but I'm pretty sure GDB does.
Is it possible to distinguish user-specified labels from compiler-generated ones in LLVM IR and MIR? If yes, then this should be fairly straightforward to implement in AsmPrinter.