[llvm-dev] [RFC] Generate Debug Information for Labels in Function

via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 29 10:53:43 PDT 2018


> Based on that I think it might be sufficient to have a flag on an IR label
> that marks a user-originated label and triggers the backend to create a
> DW_TAG_label for it. If we do need source location information for the
> DW_TAG_label, we could grab it from the first instruction.

Are there languages where labels are scoped?  If so we'd need explicit
metadata to identify the parent scope.  In C/C++ the only scope is the
containing function, which I'm guessing we wouldn't need to specify
(except for inlined functions? that might need some care to get right).

I feel compelled to point out that the top instructions in a block do not
necessarily have a valid source location so we might want to carry that
explicitly just for sanity's sake.
--paulr



More information about the llvm-dev mailing list