Issue Details:
When building up line information for CodeView debug info, LLVM attempts to gather the "range" of instructions within a function as these are printed together in a single record. If there is an inlined function, then those lines are attributed to the original function to enable generating S_INLINESITE records. However, this thus requires there to be instructions from the inlining function after the inlined function otherwise the instruction range would not include the inlined function.
Fix Details:
Include any inlined functions when finding the extent of a function in getFunctionLineEntries
This seems like it only handles one level of inlining. If this cv_loc is for an inline call site two levels deep, you aren't going to update the extent of the parent non-inline function to include this cv_loc entry.
I think this code in the inline line table emitter is meant to expand the range of cv_loc entries that we consider for inline line tables:
https://github.com/llvm/llvm-project/blob/main/llvm/lib/MC/MCCodeView.cpp#L468
Could we solve the problem by adding similar logic to CodeViewContext::getFunctionLineEntries before it's main loop?