[PATCH] D159226: Emit line numbers in CodeView for trailing (after `ret`) blocks from inlined functions

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 15:45:29 PDT 2023


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm, thanks!



================
Comment at: lld/test/COFF/symbolizer-line-numbers.s:65-66
 # CHECK-NEXT: f2(int)
-# CHECK-NEXT: t.cpp:6:3
+# CHECK-NEXT: t.cpp:6:10
 	.cv_inline_site_id 2 within 1 inlined_at 1 6 10
 	.cv_loc	2 1 2 13                        # t.cpp:2:13
----------------
Right, this now reflects the call site, which was at column 10 instead of the return statement start at col 3.


================
Comment at: llvm/lib/MC/MCCodeView.cpp:539
     } else {
       auto I = SiteInfo->InlinedAtMap.find(Loc.getFunctionId());
       if (I != SiteInfo->InlinedAtMap.end()) {
----------------
I see more duplicated logic here, but that refactoring would be way out of scope for this change. It's been years, I think there was some vague intention to have `getFunctionLineEntries` usable for both inline and non-inline line tables, but I really cannot recall.


================
Comment at: llvm/test/DebugInfo/COFF/trailing-inlined-function.s:144
+
+	.section	.debug$S,"dr"
+	.p2align	2, 0x0
----------------
I see you already deleted the unneeded variable records (.cv_defrange*), so don't worry about this, but for next time, if you emit verbose assembly (default if you pass through llc), you get codeview comments, see them on godbolt:
https://gcc.godbolt.org/z/cjca5jPTE

You can see the S_LOCAL records and others, it makes it easier to hack up the assembly.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159226/new/

https://reviews.llvm.org/D159226



More information about the llvm-commits mailing list